v1

latestOpenAPI 3.1.02026-07-2414103.5 MB

Segment Marketing Channels - Desktop

Returns traffic and engagement data per traffic channel for a predefined website segment. Desktop devices only. Historical data goes back 37 months, depending on your subscription.

get/{segment_id}/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

List the metrics for which you would like to retrieve data for, separated by commas. Possible values: visits, pages-per-visit, page-views, bounce-rate, and visit-duration.

granularitystring required

Set the granularity for the returned values. Possible values: 'weekly' or 'monthly'.

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": "Segment Name",
      "segment": "001d2632-dccd-4c1b-bbde-d49fd0ac4d4e",
      "metrics": [
        "Visits"
      ],
      "format": "json",
      "start_date": "2023-01-01",
      "end_date": "2023-03-31",
      "country": "us"
    },
    "status": "Success",
    "last_updated": "2024-09-30",
    "device": "Desktop"
  },
  "segments": [
    {
      "source_type": "Paid Search",
      "metrics": [
        {
          "date": "2023-01-01",
          "confidence": "High",
          "visits": 4122.098034259826,
          "bounce_rate": 0.8695538404445536,
          "pages_per_visit": 1.4039165853782025,
          "visit_duration": 42.66338312898276,
          "page_views": 5787.081796852256
        }
      ]
    }
  ]
}