https://api.visitors.now/v1/analytics/utmsReturns UTM campaign data ranked by visitors. Requires a type parameter. Supports cursor-based pagination.
const res = await fetch("https://api.visitors.now/v1/analytics/utms?period=7d&type=source", {
headers: { Authorization: `Bearer ${VISITORS_API_KEY}` },
});
const { data, nextCursor } = await res.json();UTM type. One of source, medium, campaign, content, term.
Time period. Default: 30d.
Custom start date (ISO 8601).
Custom end date (ISO 8601).
Timezone. Default: UTC.
JSON-encoded filter object.
Pagination cursor from a previous response.
Number of results per page. Default: 50.
{
"items": [
{
"value": "twitter",
"people": 312,
"views": 891
},
{
"value": "newsletter",
"people": 198,
"views": 423
},
{
"value": "producthunt",
"people": 145,
"views": 312
}
// ...
],
"nextCursor": null
}