v1
latestOpenAPI 3.1.02026-07-2414103.5 MBSegment Marketing Channels - All Traffic
Returns visits per traffic channel for a website segment. All Traffic devices. Historical data goes back 37 months, depending on your subscription.
get/{segment_id}/total-marketing-channels/query
Path parameters
segment_idstring required
Enter a segment ID, as defined on the Similarweb platform - without brackets {}.
Query parameters
api_keystring required
Your Similarweb API key.
start_datestring
Start month (format: YYYY-MM)
end_datestring
End month (format: YYYY-MM)
countrystring required
Country filter, as a 2-letter ISO country code, or "world" for worldwide. To see the country filters you have access to, please refer to the Check Capabilities endpoint.
metricsstring required
Return visits per traffic channel
granularitystring required
Return data with monthly granularity
formatstring
[optional] Format in which the reply should be returned. Possible values: 'json' (default) or 'xml'.
Response
200
Example response
{
"meta": {
"request": {
"granularity": "Monthly",
"segment_name": "amazon",
"segment": "434ad4ca-3306-4ff9-8227-f0b915602bf5",
"metrics": [
"Visits"
],
"format": "json",
"start_date": "2024-01-01",
"end_date": "2024-03-31",
"country": "us"
},
"status": "Success",
"last_updated": "2025-02-28",
"device": "Total"
},
"segments": [
{
"source_type": "Internal Referrals",
"metrics": [
{
"date": "2024-01-01",
"confidence": "High",
"visits": 353998.1356116912
}
]
}
]
}