Endpoints reference
Tip: Start by listing pages, then fetch stats by slug. Handle errors and rate limits gracefully.
GET /api/public/pages
Section titled “GET /api/public/pages”Lists pages available to your account.
URL
https://onlynk.me/api/public/pages
Response (example)
{ "personal": [ { "id": "page_123", "slug": "my_page", "title": "My Page", "published": true } ], "organizations": [ { "organization": { "id": "org_123", "name": "My Team" }, "pages": [ { "id": "page_456", "slug": "team_page", "title": "Team Page", "published": true } ] } ]}Example
curl -sS -H "Authorization: Bearer YOUR_API_KEY" \ "https://onlynk.me/api/public/pages"GET /api/public/stats/{slug}
Section titled “GET /api/public/stats/{slug}”Fetches analytics for a page by its slug.
URL
https://onlynk.me/api/public/stats/{slug}
Query parameters
startDate(optional):YYYY-MM-DDendDate(optional):YYYY-MM-DD
If you don’t pass dates, the API returns a default window.
Response (example)
{ "slug": "my_page", "range": { "startDate": "2026-03-01", "endDate": "2026-03-30" }, "views": 1234, "clicks": 256, "topCountries": [ { "country": "FR", "count": 420 }, { "country": "US", "count": 210 } ], "topReferrers": [ { "referrer": "instagram.com", "count": 300 }, { "referrer": "direct", "count": 180 } ]}Example
curl -sS -H "Authorization: Bearer YOUR_API_KEY" \ "https://onlynk.me/api/public/stats/your-slug"Example with a date range:
curl -sS -H "Authorization: Bearer YOUR_API_KEY" \ "https://onlynk.me/api/public/stats/your-slug?startDate=2026-03-01&endDate=2026-03-30"Errors (common)
Section titled “Errors (common)”401 Unauthorized (missing/invalid key)
{ "error": "API key is required" }404 Not found (slug doesn’t exist or you don’t have access)
{ "error": "Not found" }429 Too many requests (temporary throttling)
{ "error": "Rate limit exceeded" }