Statistics
A page's views and a short link's clicks, over the period you choose, with their breakdown by source, country and device.
Clicks on a short link
GET/v1/links/{id}/stats
?days= is 1, 7, 30 (default), 90, or 0 for all time. Read scope.
total— the period total;previous_totalthe previous period's andchange_pctthe change in percentall_time_total— the total since creationdaily— the daily series; with?days=0it is replaced bymonthly, one entry per month (month,count)referrers— the source: a domain name,directorunknowncountries— the two-letter country code, orunknowndevices—desktop,mobile,tablet,console,tvorunknown
curl "https://api.tinylink.fr/v1/links/promo/stats?days=7" \
-H "Authorization: Bearer tl_your_token"
const response = await fetch('https://api.tinylink.fr/v1/links/promo/stats?days=7', {
headers: { Authorization: 'Bearer tl_your_token' },
});
const data = await response.json();
$ch = curl_init('https://api.tinylink.fr/v1/links/promo/stats?days=7');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer tl_your_token'],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import requests
response = requests.get(
'https://api.tinylink.fr/v1/links/promo/stats?days=7',
headers={'Authorization': 'Bearer tl_your_token'},
)
data = response.json()
Possible responses
{
"metric": "clicks",
"days": 7,
"from": "2026-09-29",
"to": "2026-10-05",
"total": 42,
"previous_total": 35,
"change_pct": 20.0,
"all_time_total": 318,
"daily": [
{
"date": "2026-09-29",
"count": 4
},
{
"date": "2026-09-30",
"count": 9
},
{
"date": "2026-10-01",
"count": 6
},
{
"date": "2026-10-02",
"count": 3
},
{
"date": "2026-10-03",
"count": 8
},
{
"date": "2026-10-04",
"count": 7
},
{
"date": "2026-10-05",
"count": 5
}
],
"referrers": [
{
"source": "instagram.com",
"count": 25
},
{
"source": "direct",
"count": 17
}
],
"countries": [
{
"country": "FR",
"count": 36
},
{
"country": "BE",
"count": 6
}
],
"devices": [
{
"device": "mobile",
"count": 31
},
{
"device": "desktop",
"count": 11
}
]
} No token in the request
{
"error": {
"code": "missing_token",
"message": "Send your token in the header: Authorization: Bearer tl_…"
}
} Unknown or revoked token
{
"error": {
"code": "invalid_token",
"message": "This token does not exist or has been revoked."
}
} The owner's plan does not include the API
{
"error": {
"code": "plan_required",
"message": "The TinyLink API is included in the Pro and Business plans. Upgrade the plan of this environment's owner to use it."
}
} The token does not carry the Read scope
{
"error": {
"code": "insufficient_scope",
"message": "This token does not have the \"read\" scope.",
"details": {
"required_scope": "read"
}
}
} No short link with this id or slug in the environment
{
"error": {
"code": "not_found",
"message": "Link not found in this environment."
}
} Period not offered
{
"error": {
"code": "validation_failed",
"message": "The \"days\" parameter must be one of: 1, 7, 30, 90, 0 (all time).",
"details": {
"field": "days"
}
}
} More than 120 requests within the minute
{
"error": {
"code": "rate_limited",
"message": "Too many requests: 120 per minute per token."
}
} Views of a page
GET/v1/pages/{id}/stats
Same parameters and same fields, with metric set to views. On top comes links: the clicks on each of the page's links over the period. Read scope.
curl "https://api.tinylink.fr/v1/pages/my-page/stats?days=7" \
-H "Authorization: Bearer tl_your_token"
const response = await fetch('https://api.tinylink.fr/v1/pages/my-page/stats?days=7', {
headers: { Authorization: 'Bearer tl_your_token' },
});
const data = await response.json();
$ch = curl_init('https://api.tinylink.fr/v1/pages/my-page/stats?days=7');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer tl_your_token'],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import requests
response = requests.get(
'https://api.tinylink.fr/v1/pages/my-page/stats?days=7',
headers={'Authorization': 'Bearer tl_your_token'},
)
data = response.json()
Possible responses
{
"metric": "views",
"days": 7,
"from": "2026-09-29",
"to": "2026-10-05",
"total": 42,
"previous_total": 35,
"change_pct": 20.0,
"all_time_total": 318,
"daily": [
{
"date": "2026-09-29",
"count": 4
},
{
"date": "2026-09-30",
"count": 9
},
{
"date": "2026-10-01",
"count": 6
},
{
"date": "2026-10-02",
"count": 3
},
{
"date": "2026-10-03",
"count": 8
},
{
"date": "2026-10-04",
"count": 7
},
{
"date": "2026-10-05",
"count": 5
}
],
"referrers": [
{
"source": "instagram.com",
"count": 25
},
{
"source": "direct",
"count": 17
}
],
"countries": [
{
"country": "FR",
"count": 36
},
{
"country": "BE",
"count": 6
}
],
"devices": [
{
"device": "mobile",
"count": 31
},
{
"device": "desktop",
"count": 11
}
],
"links": [
{
"id": "L6ac4011edb7c6",
"title": "My website",
"clicks": 19
},
{
"id": "L6ac4011ee9fab",
"title": "Contact",
"clicks": 4
}
]
} No token in the request
{
"error": {
"code": "missing_token",
"message": "Send your token in the header: Authorization: Bearer tl_…"
}
} Unknown or revoked token
{
"error": {
"code": "invalid_token",
"message": "This token does not exist or has been revoked."
}
} The owner's plan does not include the API
{
"error": {
"code": "plan_required",
"message": "The TinyLink API is included in the Pro and Business plans. Upgrade the plan of this environment's owner to use it."
}
} The token does not carry the Read scope
{
"error": {
"code": "insufficient_scope",
"message": "This token does not have the \"read\" scope.",
"details": {
"required_scope": "read"
}
}
} No page with this id or slug in the environment
{
"error": {
"code": "not_found",
"message": "Page not found in this environment."
}
} Period not offered
{
"error": {
"code": "validation_failed",
"message": "The \"days\" parameter must be one of: 1, 7, 30, 90, 0 (all time).",
"details": {
"field": "days"
}
}
} More than 120 requests within the minute
{
"error": {
"code": "rate_limited",
"message": "Too many requests: 120 per minute per token."
}
}