Analytics › Get a link’s click figures

Analytics

Get a link’s click figures

GET/api/{ORG}/links/{link}/statsPermalink

Answers the LinkSeries.

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

Example request

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

Example answer

json
{  "days": 1,  "clicks": 1,  "visitors": 1,  "qrScans": 1,  "change": {    "clicks": {      "current": 1,      "previous": 1    },    "visitors": {      "current": 1,      "previous": 1    }  },  "series": [    {      "day": "example",      "clicks": 1,      "visitors": 1,      "qr": 1    }  ]}

Made-up values.

Path parameters
NameTypeRequiredDescriptionAllowed values
ORGstringrequiredYour organisation’s code.—
linkstringrequired—

LinkSeries

Answer fields
NameTypeDescriptionAllowed values
daysintegerThe days covered: 30, or fewer when the plan keeps fewer.—
clicksintegerClicks over those days.—
visitorsintegerUnique visitors per day, summed.—
qrScansintegerOf the clicks, those from the QR code.—
changeChangesOn finished days; null when the plan keeps no days before.or null
seriesDay[]One entry per day, oldest first.—
Fields of change
Fields of change
NameTypeDescriptionAllowed values
clicksChange—
visitorsChange—
Fields of change.clicks
Fields of change.clicks
NameTypeDescriptionAllowed values
currentintegerThis span.—
previousintegerThe same span before it.—
Fields of change.visitors
Fields of change.visitors
NameTypeDescriptionAllowed values
currentintegerThis span.—
previousintegerThe same span before it.—
Fields of series
Fields of series
NameTypeDescriptionAllowed values
daystringThe day, YYYY-MM-DD, in the organisation’s time zone.—
clicksintegerClicks that day.—
visitorsintegerUnique visitors that day.—
qrintegerQR scans that day.—
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 Links · 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.

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.