Endpoint
GET/analytics/values
APIs that can be used to work with State programmatically
This API method returns unique values for a field from the clicks table within a defined period. Values are paginated and ordered by title.
Supported field values are
Authorization required.
| Parameter | Description |
|---|---|
| field | Required. Exact value |
| 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 |
| search | Case-insensitive string to match anywhere in the title |
| page | the page number for pagination, default 0 |
| limit | the number of items per page. default 25. available values: 10,25,50,75,100 |
curl https://state.sk/api/analytics/values?field=city \
-H 'x-api-key: state_xxxxxxxxxx'
Currently, both title and value are the same string, but this may change in the future.
It’s recommended to display the title (e.g., in dropdowns) and use the value for API requests.
{
"items": [
{
"title": "Melbourne",
"value": "Melbourne"
},
{
"title": "Mumbai",
"value": "Mumbai"
},
{
"title": "San José",
"value": "San José"
},
{
"title": "Shanghai",
"value": "Shanghai"
},
{
"title": "Stockholm",
"value": "Stockholm"
}
],
"total": 5,
"limit": 25,
"offset": 0
}