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, "visits": 12980, "pageviews": 15230, "revenue": 1834.5, "aiVisitors": 190,
    "bounceRate": 0.41, "noReadRate": 0.27, "avgSessionSeconds": 96, "conversions": 22, "conversionRate": 0.0046, "conversionRatePerVisit": 0.003,
    "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.
goalsGoal events received. Your configured goals are always included, even when rare.
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.

A note on limit for goals

limit caps the ranking by volume, but the goals you configured are returned on top of it. Asking for one row can therefore return two: the busiest event, plus your own goal. That is deliberate. A goal you explicitly created should never vanish from a list because five other events happen more often — and it used to vanish more as the period grew longer, which is the opposite of what anyone expects.

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_…"