Analytics › Get the traffic figures

Analytics

Get the traffic figures

GET/api/{ORG}/analytics/statsPermalink

Answers the AnalyticsFigures.

Permission
Analytics · view
Plan
Plans that include the API: Pricing
Retry
Safe: a read changes nothing

Example request

bash
curl "https://console.brevily.com/api/NORTHWIND/analytics/stats" \  -H "x-api-key: brv_ak_7Fq2Lw9xK3" \  -H "x-api-secret: $BREVILY_SECRET"

Example answer

json
{  "days": 1,  "history": 1,  "from": "example",  "to": "example",  "zone": "example",  "clicks": {    "value": 1,    "change": {      "current": 1,      "previous": 1    }  },  "uniqueVisitors": {    "value": 1,    "change": {      "current": 1,      "previous": 1    }  },  "qrScans": {    "value": 1,    "change": {      "current": 1,      "previous": 1    }  },  "linksClicked": {    "value": 1,    "change": {      "current": 1,      "previous": 1    }  }}

Made-up values.

PathPermalink

Path parameters
NameTypeRequiredDescriptionAllowed values
ORGstringrequiredYour organisation’s code.—

QueryPermalink

Query parameters
NameTypeRequiredDescriptionAllowed values
rangestringoptionalNarrows the answer: ?range=<value>, or ?range=eq:<value>.—
linkstringoptionalNarrows the answer: ?link=<value>, or ?link=eq:<value>.—
domainstringoptionalNarrows the answer: ?domain=<value>, or ?domain=eq:<value>.—
comparestringoptionalNarrows the answer: ?compare=<value>, or ?compare=eq:<value>.—
tagstringoptionalNarrows the answer: ?tag=<value>, or ?tag=eq:<value>.—
folderstringoptionalNarrows the answer: ?folder=<value>, or ?folder=eq:<value>.—
appstringoptionalNarrows the answer: ?app=<value>, or ?app=eq:<value>.—
bystringoptionalNarrows the answer: ?by=<value>, or ?by=eq:<value>.—
monthstringoptionalNarrows the answer: ?month=<value>, or ?month=eq:<value>.—
daystringoptionalNarrows the answer: ?day=<value>, or ?day=eq:<value>.—
campaignstringoptionalNarrows the answer: ?campaign=<value>, or ?campaign=eq:<value>.—
sourcestringoptionalNarrows the answer: ?source=<value>, or ?source=eq:<value>.—
mediumstringoptionalNarrows the answer: ?medium=<value>, or ?medium=eq:<value>.—
qstringoptionalA search term.—

AnswerPermalink

AnalyticsFigures

Answer fields
NameTypeDescriptionAllowed values
daysintegerThe days reported, in the organisation’s time zone: the range asked for, cut to what the plan keeps (0: it keeps none).—
historyintegerThe days of daily totals the plan keeps; null for unlimited.or null
fromstringThe first day, YYYY-MM-DD (the organisation’s time zone).—
tostringThe last day, YYYY-MM-DD (the organisation’s time zone), today.—
zonestringThe IANA time zone the days are counted in: the organisation’s, or UTC when it set none.—
clicksFigureHuman clicks.—
uniqueVisitorsFigureUnique visitors, summed per link per day.—
qrScansFigureOf the clicks, QR scans.—
linksClickedFigureLinks clicked at least once.—
Fields of clicks
Fields of clicks
NameTypeDescriptionAllowed values
valueintegerOver the whole range, today included.—
changeChangeWhat a change is measured on; null when the plan keeps no days before the range, or the range has no finished day.or null
Fields of clicks.change
Fields of clicks.change
NameTypeDescriptionAllowed values
currentintegerThe range’s finished days.—
previousintegerAs many days before them.—
Fields of uniqueVisitors
Fields of uniqueVisitors
NameTypeDescriptionAllowed values
valueintegerOver the whole range, today included.—
changeChangeWhat a change is measured on; null when the plan keeps no days before the range, or the range has no finished day.or null
Fields of uniqueVisitors.change
Fields of uniqueVisitors.change
NameTypeDescriptionAllowed values
currentintegerThe range’s finished days.—
previousintegerAs many days before them.—
Fields of qrScans
Fields of qrScans
NameTypeDescriptionAllowed values
valueintegerOver the whole range, today included.—
changeChangeWhat a change is measured on; null when the plan keeps no days before the range, or the range has no finished day.or null
Fields of qrScans.change
Fields of qrScans.change
NameTypeDescriptionAllowed values
currentintegerThe range’s finished days.—
previousintegerAs many days before them.—
Fields of linksClicked
Fields of linksClicked
NameTypeDescriptionAllowed values
valueintegerOver the whole range, today included.—
changeChangeWhat a change is measured on; null when the plan keeps no days before the range, or the range has no finished day.or null
Fields of linksClicked.change
Fields of linksClicked.change
NameTypeDescriptionAllowed values
currentintegerThe range’s finished days.—
previousintegerAs many days before them.—

ErrorsPermalink

Errors
Status Code When
400 VALIDATION_FAILED A field, a parameter or the body is wrong; details.fields says which.
401 UNAUTHENTICATED No key, a key that does not match, or one expired or revoked.
403 ACCESS_DENIED The key lacks Analytics · view, or the organisation’s plan does not include it.
404 NOT_FOUND No organisation with that code for this key, or no such record in it.
429 RATE_LIMITED Too many calls: wait Retry-After seconds.

Rate limitsPermalink

Counted with every other call of the organisation, by plan: Pricing. The answer carries RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset; more on rate limits.