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
curl "https://console.brevily.com/api/NORTHWIND/links/01JC6Y8QH2M4ZK7T9VRW3XNB5D/stats" \ -H "x-api-key: brv_ak_7Fq2Lw9xK3" \ -H "x-api-secret: $BREVILY_SECRET"const res = await fetch("https://console.brevily.com/api/NORTHWIND/links/01JC6Y8QH2M4ZK7T9VRW3XNB5D/stats", { headers: { "x-api-key": "brv_ak_7Fq2Lw9xK3", "x-api-secret": process.env.BREVILY_SECRET, },});const answer = await res.json();Example answer
{ "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 } ]}{ "code": "VALIDATION_FAILED", "message": "Check the form. (root): Not a value this field takes.", "details": { "fields": { "(root)": "Not a value this field takes." } }, "requestId": "18188559082372202519"}Made-up values.
PathPermalink
| Name | Type | Required | Description | Allowed values |
|---|---|---|---|---|
ORG | string | required | Your organisation’s code. | — |
link | string | required | — |
AnswerPermalink
LinkSeries
| Name | Type | Description | Allowed values |
|---|---|---|---|
days | integer | The days covered: 30, or fewer when the plan keeps fewer. | — |
clicks | integer | Clicks over those days. | — |
visitors | integer | Unique visitors per day, summed. | — |
qrScans | integer | Of the clicks, those from the QR code. | — |
change | Changes | On finished days; null when the plan keeps no days before. | or null |
series | Day[] | One entry per day, oldest first. | — |
Fields of change
| Name | Type | Description | Allowed values |
|---|---|---|---|
clicks | Change | — | |
visitors | Change | — |
Fields of change.clicks
| Name | Type | Description | Allowed values |
|---|---|---|---|
current | integer | This span. | — |
previous | integer | The same span before it. | — |
Fields of change.visitors
| Name | Type | Description | Allowed values |
|---|---|---|---|
current | integer | This span. | — |
previous | integer | The same span before it. | — |
Fields of series
| Name | Type | Description | Allowed values |
|---|---|---|---|
day | string | The day, YYYY-MM-DD, in the organisation’s time zone. | — |
clicks | integer | Clicks that day. | — |
visitors | integer | Unique visitors that day. | — |
qr | integer | QR scans that day. | — |
ErrorsPermalink
| 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. |
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.
Type a call, a field or a guide.