stats

One route, every metric

All aggregated analytics come from a single endpoint. Pick a dataset, add a period and optional filter.

GET/api/v1/sites/{id}/stats/{dataset}
curl "https://datalenk.com/api/v1/sites/3/stats/summary?range=7d" -H "Authorization: Bearer dlk_live_…"
response
{
  "range": "Last 7 days",
  "data": {
    "visitors": 8420, "pageviews": 15230, "revenue": 1834.5, "aiVisitors": 190,
    "bounceRate": 0.41, "avgSessionSeconds": 96, "conversions": 22, "conversionRate": 0.0046,
    "delta": { "visitors": 0.12, "revenue": 0.08 }
  }
}

Datasets

DatasetReturns
summaryVisitors, pageviews, revenue, AI traffic, bounce, avg session, conversion rate, plus deltas.
timeseriesPer-bucket series. Add ?newReturning=1 for the new vs returning split.
revenueRevenue by channel plus new / renewal / expansion breakdown.
keywordsSearch queries with clicks, impressions, position, CTR and attributed revenue.
goalsConfigured goals and their conversions.
web-vitalsSpeed score plus LCP / FCP / TTFB / CLS / INP (p75), by device, slowest pages.
onlineLive visitors right now (never cached).
ai-crawlersAI bot visits by crawler.
channels · referrers · campaignsAcquisition sources.
pages · entry-pages · exit-linksContent.
countries · regions · citiesGeography.
devices · browsers · os · languagesAudience.
ai-engines · search-engines · socialDetailed sources.

Dimension datasets

Channels, pages, devices and the other dimension datasets return the same row shape:

response
{
  "range": "Last 7 days",
  "data": [
    { "key": "Organic Search", "visitors": 5120, "revenue": 980.5, "conversions": 12 },
    { "key": "Direct", "visitors": 1900, "revenue": 420.0, "conversions": 5 }
  ]
}

Combine period, filter and limit freely, for example the top pages that Organic Search brought over the last 30 days:

curl "https://datalenk.com/api/v1/sites/3/stats/pages?range=30d&filter[channel]=Organic%20Search&limit=20" \
  -H "Authorization: Bearer dlk_live_…"