Перейти к содержимому

Get link analytics summary

GET
/api/v1/links/{code}/analytics/summary
curl --request GET \
--url 'https://example.com/api/v1/links/example/analytics/summary?from=2026-02-01T00%3A00%3A00Z&to=2026-02-27T23%3A59%3A59Z&granularity=hour&limit=20&limit_countries=20&limit_cities=20&compare=prev_period' \
--header 'Authorization: Bearer <token>'
code
required
string

Short code or custom alias

from
string

Example

2026-02-01T00:00:00Z

Start date (ISO 8601). Default: 30 days ago

to
string

Example

2026-02-27T23:59:59Z

End date (ISO 8601). Default: now

granularity
string
default: day
Allowed values: hour day week month
limit
number
default: 20 >= 1 <= 100
limit_countries
number
default: 20 <= 250

Limit for countries (geo endpoint)

limit_cities
number
default: 20 <= 100

Limit for cities (geo endpoint)

countries
Array<string>

Filter by ISO 3166-1 alpha-2 country codes (comma-separated)

compare
string
Allowed values: prev_period prev_year

Compare with a previous period

Media typeapplication/json
object
linkId
required
string
shortCode
required
string
customAlias
object
totalClicks
required
number
uniqueClicks
required
number
clicksToday
required
number
clicksThisWeek
required
number
clicksThisMonth
required
number
topCountry
object
code
required
string
name
required
string
clicks
required
number
topReferrer
object
domain
required
string
clicks
required
number
topDevice
object
topBrowser
object
createdAt
required
string
lastClickAt
object
botClicks
required
number
botPercentage
required
number
comparison
object
from
required
string
to
required
string
totalClicks
required
number
uniqueClicks
required
number
totalClicksDelta
required
number
totalClicksChangePercent
required
object

Example generated

{
"linkId": "example",
"shortCode": "example",
"customAlias": {},
"totalClicks": 1,
"uniqueClicks": 1,
"clicksToday": 1,
"clicksThisWeek": 1,
"clicksThisMonth": 1,
"topCountry": {
"code": "example",
"name": "example",
"clicks": 1
},
"topReferrer": {
"domain": "example",
"clicks": 1
},
"topDevice": {},
"topBrowser": {},
"createdAt": "example",
"lastClickAt": {},
"botClicks": 1,
"botPercentage": 1,
"comparison": {
"from": "example",
"to": "example",
"totalClicks": 1,
"uniqueClicks": 1,
"totalClicksDelta": 1,
"totalClicksChangePercent": {}
}
}

Forbidden — not the owner

Link not found