API Reference
GET Campaigns
List campaign analytics for the authenticated site.
GET Campaigns
GET https://api.faurya.com/api/v1/analytics/campaigns
List campaign breakdown analytics for the site attached to your API key. Requires Bearer Token authentication.
Example request
const response = await fetch(
"https://api.faurya.com/api/v1/analytics/campaigns",
{
headers: {
Authorization: `Bearer ${process.env.FAURYA_API_KEY}`,
},
},
);
const result = await response.json();Query parameters
period(string):day,week,month,year, orall.startDateorstartAt(string): Custom range start. Must be used with an end date.endDateorendAt(string): Custom range end. Must be used with a start date.limit(number): Number of rows to return. Defaults to100, maximum100.offset(number): Number of rows to skip. Defaults to0.device,os,browser,path,country,city,utm,referrer,hostname,goal(string): Optional analytics filters.
Response
Each row includes campaign, visitors, goalVisitors, revenue, and optional query or params.
{
"status": "success",
"data": [
{
"campaign": "spring_launch",
"visitors": 44,
"goalVisitors": 9,
"revenue": 89.99,
"query": "utm_campaign=spring_launch",
"params": {
"utm_campaign": "spring_launch"
}
}
],
"pagination": {
"limit": 100,
"offset": 0,
"total": 1,
"hasMore": false
}
}