API Reference

GET Cities

List city analytics for the authenticated site.

GET Cities

GET https://api.faurya.com/api/v1/analytics/cities

List city 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/cities", {
  headers: {
    Authorization: `Bearer ${process.env.FAURYA_API_KEY}`,
  },
});

const result = await response.json();

Query parameters

  • period (string): day, week, month, year, or all.
  • startDate or startAt (string): Custom range start. Must be used with an end date.
  • endDate or endAt (string): Custom range end. Must be used with a start date.
  • limit (number): Number of rows to return. Defaults to 100, maximum 100.
  • offset (number): Number of rows to skip. Defaults to 0.
  • device, os, browser, path, country, city, utm, referrer, hostname, goal (string): Optional analytics filters.

Response

Each row includes city, visitors, goalVisitors, revenue, and optional code or flag.

{
  "status": "success",
  "data": [
    {
      "city": "San Francisco",
      "visitors": 21,
      "goalVisitors": 5,
      "revenue": 59.99
    }
  ],
  "pagination": {
    "limit": 100,
    "offset": 0,
    "total": 1,
    "hasMore": false
  }
}