Endpoint
GET/analytics/groups
This API method returns data grouped by one or more fields, sorted by click count in descending order.
Authorization required.
All parameters are optional except groups. By default, it returns clicks from the last 30 days, with results paginated.
| Parameter | Description |
|---|---|
| groups | it can be a single field i.e. os, or combination or field names, separated with comma. i.e. os,device or language,continent,browser |
| link_id | Exact match |
| period | today, yesterday, week, lastweek, month, lastmonth, year, all, or a custom range, period=YYYY-MM-DD,YYYY-MM-DD, i.e. period=2025-10-01,2025-10-13 |
| domain_id | filter by domain id. You can get a list of available domains from Domains API |
| folder_id | filter by folder id. You can get IDs from Folders API |
| tag_id | filter by tag id. You can get IDs from Tags API |
| search | Case-insensitive string to match anywhere in the URL, or short link |
| country | Two-letter uppercase country code |
| city | City name in English (exact match) |
| region | Region name in English (exact match) |
| continent | Continent name in English (exact match) |
| browser | Browser name |
| os | Operating system |
| device | Device type |
| page | always 0 |
| limit | the number of items per page. default 25. available values: 10,25,50,75,100 |
Available values for country, city, region, continent, browser, os, and device can be retrieved via a dedicated API.
curl https://state.sk/api/analytics/groups?groups=os,device \
-H 'x-api-key: state_xxxxxxxxxx'
The response provides paginated results for each field in the group.
It can be used for country, region, and city as well, though dedicated endpoints return more detailed data.
{
"os": {
"items": [
{
"title": "macOS",
"clicks": 34
},
{
"title": "Windows",
"clicks": 15
}
],
"total": 49,
"limit": 25,
"offset": 0
},
"device": {
"items": [
{
"title": "desktop",
"clicks": 32
},
{
"title": "mobile",
"clicks": 17
}
],
"total": 49,
"limit": 25,
"offset": 0
}
}