Analytics
Analytics breakdown
Top-N rows for one dimension — the same tables the dashboard shows. Pick the dimension with the dimension query param; the row shape varies per dimension (see the field guide on this page).
Analytics breakdown
curl --request GET \
--url 'https://api.nookdocs.com/v1/projects/{id}/analytics/breakdown' \
--header 'Authorization: Bearer <token>'{
"range": {
"to": "2023-11-07T05:31:56Z",
"from": "2023-11-07T05:31:56Z"
},
"results": [
{}
],
"dimension": "<string>",
"exclude_bots": true
}The results row shape depends on the dimension you query:
| Dimension | Row fields |
pages | path, views, unique_visitors |
searches | query, count, avg_result_count |
countries | country (ISO 3166-1 alpha-2), visitors |
regions | region, country, visitors |
cities | city, country, visitors |
browsers / os / devices | name, visitors |
channels | channel (Direct, Organic Search, AI, Referral, …), visitors |
referrers | referrer (hostname), visitors |
campaigns | campaign (from utm_campaign), visitors |
keywords | keyword (from utm_term), visitors |
Authorizations
AuthorizationstringheaderrequiredAPI key issued from your dashboard (Settings → API Keys). Format: nook_... — pass as Authorization: Bearer nook_.... Keys carry scopes (projects:read/write, pages:read, deployments:read/trigger, analytics:read) — calls without the required scope return 403.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path parameters
idstring (uuid)pathrequiredProject UUID
Query parameters
dimensionenum<string>queryrequiredWhich breakdown to return
options:
pagessearchescountriesregionscitiesbrowsersosdeviceschannelsreferrerscampaignskeywordsfromstring (date-time)queryWindow start (inclusive), ISO 8601. Default: 30 days ago.
tostring (date-time)queryWindow end (exclusive), ISO 8601. Default: now.
limitintegerquerydefault: 20Maximum rows to return (1–250)
botsenum<string>querydefault: excludedInclude or exclude UA-classified bot traffic
options:
includedexcludedResponse
Breakdown rows, highest traffic first
rangeobjectresultsobject[]Row shape varies by dimension. Examples: `pages` rows are `{path, views, unique_visitors}`; `countries` rows are `{country, visitors}`; `referrers` rows are `{referrer, visitors}`. Full field guide on this page.
dimensionstringThe dimension that was queried
exclude_botsbooleanerrorstringrequiredMachine-readable error code (e.g. `invalid_request`, `unauthorized`, `not_found`)
messagestringrequiredHuman-readable error description
errorstringrequiredMachine-readable error code (e.g. `invalid_request`, `unauthorized`, `not_found`)
messagestringrequiredHuman-readable error description
errorstringrequiredMachine-readable error code (e.g. `invalid_request`, `unauthorized`, `not_found`)
messagestringrequiredHuman-readable error description
errorstringrequiredMachine-readable error code (e.g. `invalid_request`, `unauthorized`, `not_found`)
messagestringrequiredHuman-readable error description