Analytics › Get clicks per day
Analytics
Get clicks per day
GET/api/{ORG}/analytics/chartPermalink
Answers the AnalyticsSeries.
- Permission
- Analytics · view
- Plan
- Plans that include the API: Pricing
- Retry
- Safe: a read changes nothing
Example request
curl "https://console.brevily.com/api/NORTHWIND/analytics/chart" \ -H "x-api-key: brv_ak_7Fq2Lw9xK3" \ -H "x-api-secret: $BREVILY_SECRET"const res = await fetch("https://console.brevily.com/api/NORTHWIND/analytics/chart", { headers: { "x-api-key": "brv_ak_7Fq2Lw9xK3", "x-api-secret": process.env.BREVILY_SECRET, },});const answer = await res.json();Example answer
{ "days": 1, "history": 1, "from": "example", "to": "example", "zone": "example", "series": [ { "day": "example", "clicks": 1, "qrScans": 1, "uniqueVisitors": 1 } ], "previous": [ { "day": "example", "clicks": 1 } ]}{ "code": "VALIDATION_FAILED", "message": "Check the form. range: Not a value this field takes.", "details": { "fields": { "range": "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. | — |
QueryPermalink
| Name | Type | Required | Description | Allowed values |
|---|---|---|---|---|
range | string | optional | Narrows the answer: ?range=<value>, or ?range=eq:<value>. | — |
link | string | optional | Narrows the answer: ?link=<value>, or ?link=eq:<value>. | — |
domain | string | optional | Narrows the answer: ?domain=<value>, or ?domain=eq:<value>. | — |
compare | string | optional | Narrows the answer: ?compare=<value>, or ?compare=eq:<value>. | — |
tag | string | optional | Narrows the answer: ?tag=<value>, or ?tag=eq:<value>. | — |
folder | string | optional | Narrows the answer: ?folder=<value>, or ?folder=eq:<value>. | — |
app | string | optional | Narrows the answer: ?app=<value>, or ?app=eq:<value>. | — |
by | string | optional | Narrows the answer: ?by=<value>, or ?by=eq:<value>. | — |
month | string | optional | Narrows the answer: ?month=<value>, or ?month=eq:<value>. | — |
day | string | optional | Narrows the answer: ?day=<value>, or ?day=eq:<value>. | — |
campaign | string | optional | Narrows the answer: ?campaign=<value>, or ?campaign=eq:<value>. | — |
source | string | optional | Narrows the answer: ?source=<value>, or ?source=eq:<value>. | — |
medium | string | optional | Narrows the answer: ?medium=<value>, or ?medium=eq:<value>. | — |
q | string | optional | A search term. | — |
AnswerPermalink
AnalyticsSeries
| Name | Type | Description | Allowed values |
|---|---|---|---|
days | integer | The days reported, in the organisation’s time zone: the range asked for, cut to what the plan keeps (0: it keeps none). | — |
history | integer | The days of daily totals the plan keeps; null for unlimited. | or null |
from | string | The first day, YYYY-MM-DD (the organisation’s time zone). | — |
to | string | The last day, YYYY-MM-DD (the organisation’s time zone), today. | — |
zone | string | The IANA time zone the days are counted in: the organisation’s, or UTC when it set none. | — |
series | ReportDay[] | One entry per day, oldest first. | — |
previous | PreviousDay[] | The period before, a day per day of series (compare=1); null when not asked for. | or null |
Fields of series
| Name | Type | Description | Allowed values |
|---|---|---|---|
day | string | The day, YYYY-MM-DD, in the organisation’s time zone. | — |
clicks | integer | Human clicks that day. | — |
qrScans | integer | Of them, QR scans. | — |
uniqueVisitors | integer | Unique visitors that day. | — |
Fields of previous
| Name | Type | Description | Allowed values |
|---|---|---|---|
day | string | The day, the range’s length before the series’ day. | — |
clicks | integer | Human clicks that day; null for a day the plan no longer keeps. | or null |
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 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.
Type a call, a field or a guide.