Analítica
BASE https://api.rii.link/v1AUTH: BEARER → AUTENTICACIÓN
Pide agregados cuando los necesites, o mantén abierto un flujo SSE y recibe cada clic en tus enlaces creados con la API en cuanto ocurre.
GET
/v1/links/{id}/statsEstadísticas del enlace
Una sola llamada de agregados, agrupada como pidas, sobre cualquier ventana from/to. El tráfico de bots queda excluido.
PARÁMETROS
from / totimestampBounds of the window. Default: last 30 days.
group_bystringcountry, device, referrer, or rule.
intervalstringhour or day — buckets the series for charting.
REQUEST
curl "https://api.rii.link/v1/links/lnk_8h2f0qZ3Tk1mR4vXw9aBcQ/stats?group_by=country" \
-H "Authorization: Bearer $RII_KEY"
RESPONSE · 200
{
"total": 1284,
"group_by": "country",
"buckets": [
{ "key": "DE", "clicks": 512 },
{ "key": "US", "clicks": 401 },
{ "key": "FR", "clicks": 371 }
],
"interval": null,
"series": [],
"from": "2026-07-13T00:00:00Z",
"to": "2026-08-12T00:00:00Z"
}
GET
/v1/events/streamEl flujo de clics (SSE)
Server-sent events sobre HTTP simple — la superficie en vivo que existe hoy, sin registrar ningún webhook. Mantenlo abierto con -N; cada clic que no viene de un bot en tus enlaces activos creados con la API llega como un frame.
UNA CONEXIÓN MANTENIDA ABIERTA, SIN FIRMA · LAS CLAVES DE PRUEBA NO RECIBEN CLICS · LOS WEBHOOKS SALIENTES ESTÁN PREVISTOS (Q1 2027)
REQUEST
curl -N https://api.rii.link/v1/events/stream \
-H "Authorization: Bearer $RII_KEY" \
-H "Accept: text/event-stream"
STREAM · TEXT/EVENT-STREAM
event: click
data: {"link_id":"lnk_8h2f0qZ3Tk1mR4vXw9aBcQ","country":"DE","device":"mobile","referrer":"instagram.com","utm_source":"instagram","utm_medium":null,"utm_campaign":"summer","is_qr":false,"rule_matched":"geo.country == \"DE\"","timestamp":"2026-08-12T09:17:02.418+00:00"}
event: click
data: {"link_id":"lnk_2xw11pGh6Rt0Yc3Mv9LsJg","country":"US","device":"desktop","referrer":null,"utm_source":null,"utm_medium":null,"utm_campaign":null,"is_qr":true,"rule_matched":null,"timestamp":"2026-08-12T09:17:05.031+00:00"}