API reference

Build on Analify

Send events and users from your backend, push your own numbers, and customise the tracker. New to Analify? Start with the guide.
On this page

Overview

Base URL: https://analify.dev. Requests and responses are JSON. Every endpoint is also listed, with a “try it” form, in the interactive API explorer.

CredentialLooks likeUsed forWhere to get it
API keyak_live_…Server events, users syncSite → Settings → Server API keys
Data tokenan_data_…Pushing your own numbersSite → Data
Source tokenan_src_…Analify calling your user-count endpointSite → Settings → Connect your users

Keep keys on your server. Each key belongs to one website; revoke it any time from the same screen.

Browser tracker

The tracking code records pageviews automatically, including route changes in single-page apps. Options go on the script tag:

AttributeEffect
data-site="AN-XXXXXX"Your site’s tracking ID (required)
data-hashCount #hash changes as pageviews
data-respect-dntSkip visitors with Do Not Track on
data-user="123"The signed-in user’s ID, same as analify.identify()
javascript
analify.track("signup", { plan: "pro" }); // custom event, optional details
analify.identify("user_123");             // signed-in user; identify(null) clears
analify.brokenPage(404);                  // report this page as broken
analify.pageview();                       // record a pageview manually

The names pageview, engagement and identify are reserved.

Send events from your server

POST/api/v1/events

For things that happen on your backend, like purchases. Send one event, or {"events": [...]} with up to 100.

bash
curl -X POST https://analify.dev/api/v1/events \
  -H "X-API-Key: ak_live_..." -H "Content-Type: application/json" \
  -d '{"name": "purchase", "url": "/checkout/done", "props": {"amount": 49}, "user_id": "u_123"}'
FieldTypeNotes
namestringDefaults to pageview. Up to 120 characters.
urlstringA full URL on the site, or a path like /checkout
propsobjectUp to 30 custom properties. Personal data is stripped.
timestampISO 8601Defaults to now; up to 7 days in the past
ip + user_agentstringThe visitor’s, as your server received them. Joins this event to their browser visit, so it counts for campaigns and funnels. Not stored.
user_idstringYour user ID, scrambled before storage. Also joins visits.
referrerstringOptional
countrystringTwo-letter ISO code, if you know it
json
{"accepted": 1, "rejected": []}

Invalid events in a batch are reported by index in rejected; the rest are still stored.

Sync your users

POST/api/v1/users

Send everyone once (any dates, years back), then each new sign-up. One user, or {"users": [...]} with up to 1,000. Re-sending is safe.

bash
curl -X POST https://analify.dev/api/v1/users \
  -H "X-API-Key: ak_live_..." -H "Content-Type: application/json" \
  -d '{"id": "u_123", "signed_up_at": "2024-05-01T10:00:00Z"}'
DELETE/api/v1/users/{user_id}

A user deleted their account: Analify forgets them and unlinks their past visits.

bash
curl -X DELETE https://analify.dev/api/v1/users/u_123 -H "X-API-Key: ak_live_..."

Push your own numbers

POST/api/v1/data?feed=site

Send any JSON the moment your numbers change; every number becomes a card with a daily chart. feed names the card group (letters, numbers, - and _).

bash
curl -X POST "https://analify.dev/api/v1/data?feed=site" \
  -H "Authorization: Bearer an_data_..." -H "Content-Type: application/json" \
  -d '{"orders": {"today": 12, "pending": 3}, "tools": {"total": 15471}}'

Your user-count endpoint

Instead of pushing, you can host an endpoint that Analify reads every hour:

GEThttps://yoursite.com/analify/users?since=2026-09-01

Analify sends Authorization: Bearer an_src_…. Reply 401 unless the token matches, otherwise:

json
{"total_users": 1234,
 "signups": [{"date": "2026-10-10", "count": 7}, {"date": "2026-10-11", "count": 5}]}

signups is optional. The first request has no since (send your whole history); later ones ask for the last 35 days.

Errors and limits

Errors return a status code and a detail message that says what to fix.

StatusMeaning
400Every event in the request was rejected (see rejected)
401Missing, invalid or revoked key or token
402This month’s event allowance is used up; upgrade the plan
403The website is archived; restore it to send data
422The JSON doesn’t match the fields above
429Rate limited. Wait for Retry-After seconds, or batch events

Each API key can make 600 requests a minute. Batching up to 100 events per request goes a long way.