Get traffic sources
Read the Sources report: channels, referrers or campaigns.
GET https://cotlet.dev/api/v1/plausible/sources
read
Returns the rows of the Sources tab you pick, most visitors first. The campaigns view lists the UTM data the Campaigns tab shows. A visit with no referrer is listed as direct traffic, the way the dashboard lists it.
Parameters
| Name | Type | Description |
|---|---|---|
| site string required | string | Domain of the site as the Sites page lists it, e.g. acme-shop.example. |
| view string | string | channels (default), referrers or campaigns. |
| from string | string | First day of the date range, YYYY-MM-DD. Default: the last 30 days. |
| to string | string | Last day of the date range, YYYY-MM-DD. Default: today. |
Request
curl "https://cotlet.dev/api/v1/plausible/sources?site=site" \
-H "Authorization: Bearer $COTLET_API_KEY" result = client.call("plausible", "get_sources", {"site":"site"}) const result = await cotlet.call('plausible', 'get_sources', {"site":"site"}); cotlet call plausible get_sources --data '{"site":"site"}' Example response
{
"site": "acme-shop.example",
"view": "channels",
"rows": [
{
"source": "Organic Search",
"visitors": 1480
},
{
"source": "Direct",
"visitors": 1120
},
{
"source": "Email",
"visitors": 390
}
]
}