Stats API

Pull pageviews, revenue, and top pages programmatically - Cloud & Self-hosted

Pull your dashboard numbers into your own code, sheets, or AI.

1) Get an API key

Dashboard → Website → Settings → API Keys → Create → copy owt_...

Create API key

Use it as Bearer:

Authorization: Bearer owt_your_api_key_here

Keys are per-website. Create one per site.

2) Find your websiteId

  • URL: /dashboard/<websiteId>/...
  • Or call MCP list_websites → or GET /api/v1/websites if available

3) Call stats

Endpoint: GET /api/v1/{websiteId}/stats

Query params

ParamTypeRequiredDefaultDetails
startDatestringNo24h agoISO 8601 2026-03-01
endDatestringNonowISO 8601
granularitystringNodailyhourly daily weekly monthly

cURL - copy/paste

curl "https://your-domain.com/api/v1/550e8400-e29b-41d4-a716-446655440000/stats?granularity=daily" 
  -H "Authorization: Bearer owt_..."

For Cloud use https://cloud.openwebtrack.one as your-domain.com. For Self-hosted use your ORIGIN.

JS fetch

const res = await fetch(
  `https://your-domain.com/api/v1/${websiteId}/stats?startDate=2026-03-01&endDate=2026-03-31`,
  { headers: { Authorization: `Bearer ${token}` } }
);
const data = await res.json();
console.log(data.summary, data.topPages);

Response

{
  "summary": {
    "pageviews": 1250,
    "sessions": 450,
    "visitors": 380,
    "bounceRate": 42,
    "dateRange": { "start": "2026-03-26T00:00:00.000Z", "end": "2026-04-01T23:59:59.999Z" }
  },
  "timeSeries": [{ "date": "2026-03-26", "pageviews": 9 }],
  "topPages": [{ "pathname": "/", "views": 500 }],
  "topReferrers": [{ "referrer": "google.com", "sessions": 120 }]
}
  • Times in website’s timezone
  • topPages / topReferrers → top 10

Errors

StatusWhy
400Bad websiteId or date format
401Missing / wrong owt_ key
404Site not found or key belongs to another site

Next