Statistiche
Le visualizzazioni di una pagina e i clic di un link breve, nel periodo che preferisci, con la loro ripartizione per provenienza, paese e dispositivo.
Clic di un link breve
GET/v1/links/{id}/stats
?days= vale 1, 7, 30 (predefinito), 90, oppure 0 per da sempre. Ambito Lettura.
total— il totale del periodo;previous_totalquello del periodo precedente echange_pctla variazione in percentualeall_time_total— il totale dalla creazionedaily— la serie per giorno; con?days=0, viene sostituita damonthly, una voce per mese (month,count)referrers— la provenienza: un nome di dominio,directounknowncountries— il codice del paese di due lettere, ounknowndevices—desktop,mobile,tablet,console,tvounknown
curl "https://api.tinylink.fr/v1/links/promo/stats?days=7" \
-H "Authorization: Bearer tl_il_tuo_token"
const response = await fetch('https://api.tinylink.fr/v1/links/promo/stats?days=7', {
headers: { Authorization: 'Bearer tl_il_tuo_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_il_tuo_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_il_tuo_token'},
)
data = response.json()
Risposte possibili
{
"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
}
]
} Token assente dalla richiesta
{
"error": {
"code": "missing_token",
"message": "Send your token in the header: Authorization: Bearer tl_…"
}
} Token sconosciuto o revocato
{
"error": {
"code": "invalid_token",
"message": "This token does not exist or has been revoked."
}
} Il piano del proprietario non include l'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."
}
} Il token non ha l'ambito Lettura
{
"error": {
"code": "insufficient_scope",
"message": "This token does not have the \"read\" scope.",
"details": {
"required_scope": "read"
}
}
} Nessun link breve con questo identificativo o questo slug nello spazio di lavoro
{
"error": {
"code": "not_found",
"message": "Link not found in this environment."
}
} Periodo non previsto
{
"error": {
"code": "validation_failed",
"message": "The \"days\" parameter must be one of: 1, 7, 30, 90, 0 (all time).",
"details": {
"field": "days"
}
}
} Più di 120 richieste nel minuto
{
"error": {
"code": "rate_limited",
"message": "Too many requests: 120 per minute per token."
}
} Visualizzazioni di una pagina
GET/v1/pages/{id}/stats
Stessi parametri e stessi campi, con metric a views. Si aggiunge links: i clic di ciascuno dei link della pagina nel periodo. Ambito Lettura.
curl "https://api.tinylink.fr/v1/pages/ma-page/stats?days=7" \
-H "Authorization: Bearer tl_il_tuo_token"
const response = await fetch('https://api.tinylink.fr/v1/pages/ma-page/stats?days=7', {
headers: { Authorization: 'Bearer tl_il_tuo_token' },
});
const data = await response.json();
$ch = curl_init('https://api.tinylink.fr/v1/pages/ma-page/stats?days=7');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer tl_il_tuo_token'],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
import requests
response = requests.get(
'https://api.tinylink.fr/v1/pages/ma-page/stats?days=7',
headers={'Authorization': 'Bearer tl_il_tuo_token'},
)
data = response.json()
Risposte possibili
{
"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": "Mon site",
"clicks": 19
},
{
"id": "L6ac4011ee9fab",
"title": "Contact",
"clicks": 4
}
]
} Token assente dalla richiesta
{
"error": {
"code": "missing_token",
"message": "Send your token in the header: Authorization: Bearer tl_…"
}
} Token sconosciuto o revocato
{
"error": {
"code": "invalid_token",
"message": "This token does not exist or has been revoked."
}
} Il piano del proprietario non include l'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."
}
} Il token non ha l'ambito Lettura
{
"error": {
"code": "insufficient_scope",
"message": "This token does not have the \"read\" scope.",
"details": {
"required_scope": "read"
}
}
} Nessuna pagina con questo identificativo o questo slug nello spazio di lavoro
{
"error": {
"code": "not_found",
"message": "Page not found in this environment."
}
} Periodo non previsto
{
"error": {
"code": "validation_failed",
"message": "The \"days\" parameter must be one of: 1, 7, 30, 90, 0 (all time).",
"details": {
"field": "days"
}
}
} Più di 120 richieste nel minuto
{
"error": {
"code": "rate_limited",
"message": "Too many requests: 120 per minute per token."
}
}