Skip to main content

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).

GET/projects/{id}/analytics/breakdown
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:

DimensionRow fields
pagespath, views, unique_visitors
searchesquery, count, avg_result_count
countriescountry (ISO 3166-1 alpha-2), visitors
regionsregion, country, visitors
citiescity, country, visitors
browsers / os / devicesname, visitors
channelschannel (Direct, Organic Search, AI, Referral, …), visitors
referrersreferrer (hostname), visitors
campaignscampaign (from utm_campaign), visitors
keywordskeyword (from utm_term), visitors

Authorizations

Authorizationstringheaderrequired

API 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)pathrequired
Project UUID

Query parameters

dimensionenum<string>queryrequired
Which breakdown to return
options:pagessearchescountriesregionscitiesbrowsersosdeviceschannelsreferrerscampaignskeywords
fromstring (date-time)query
Window start (inclusive), ISO 8601. Default: 30 days ago.
tostring (date-time)query
Window end (exclusive), ISO 8601. Default: now.
limitintegerquerydefault: 20
Maximum rows to return (1–250)
botsenum<string>querydefault: excluded
Include or exclude UA-classified bot traffic
options:includedexcluded

Response

application/json

Breakdown rows, highest traffic first

rangeobject
resultsobject[]
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.
dimensionstring
The dimension that was queried
exclude_botsboolean