Skip to main content

Analytics API

GET /api/v1/links/{shortCode}/analytics reads metrics for a link. Keys require analytics:read; JWT callers must be authorized for the selected project. Supported parameters include period, startDate, endDate, compareStartDate and compareEndDate.

curl "$SLNK_API_URL/api/v1/links/SHORT_CODE/analytics?period=30d" \
--header "Authorization: Bearer $SLNK_API_KEY"

Use the returned metrics rather than deriving totals from a limited top-items list. Reporting days follow the project's server reporting contract; do not assume UTC calendar days. The current reporting zone is Africa/Casablanca, whose UTC offset can change during the year.

Realtime summary​

GET /api/v1/analytics/realtime/summary returns the current project's summary. It requires analytics:read for keys, appropriate user access for JWT and the relevant feature entitlement. Add X-Project-Id for a JWT request, not to override a key's bound project.

Treat 403 as an access/feature error, not an empty result. A 503 analytics dependency error also differs from a valid response with no activity. Ingestion acknowledgement and visibility in derived analytics can happen at different times.