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

Parameters: get_sources
NameTypeDescription
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
curl "https://cotlet.dev/api/v1/plausible/sources?site=site" \
  -H "Authorization: Bearer $COTLET_API_KEY"
Python
result = client.call("plausible", "get_sources", {"site":"site"})
Node.js
const result = await cotlet.call('plausible', 'get_sources', {"site":"site"});
CLI
cotlet call plausible get_sources --data '{"site":"site"}'

Example response

JSON

{
  "site": "acme-shop.example",
  "view": "channels",
  "rows": [
    {
      "source": "Organic Search",
      "visitors": 1480
    },
    {
      "source": "Direct",
      "visitors": 1120
    },
    {
      "source": "Email",
      "visitors": 390
    }
  ]
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.