"Best analytics tool I've used in 14 years"

Get realtime visitors

GET https://datafa.st/api/v1/analytics/realtime

Return the count of currently active visitors — anyone with pageview activity in the last 10 minutes. Use this for live counters, status widgets, or the mobile app.

This endpoint ignores date ranges and filters. It always reflects the current realtime window.

Request

Query parameters

websiteId
string
Required with a dft_ account token on Website API routes. Omit with a df_ website key. Example: ?websiteId=665f0b3c4d2e1a0012345678.
fields
string
Controls which properties are included in the response. Use it to request only the metrics or metadata your integration needs. Only supported value: visitors. Returns all fields when omitted.

Response

Returns a JSON object with status: "success" and endpoint-specific fields in data (and pagination when the endpoint is paginated).

Response fields

data[].visitors
number
Number of visitors active in the realtime window. Use it for live counters or status widgets.

Authentication

  • df_ website API key: The website is inferred from the key. You do not need a websiteId query parameter.
  • dft_ account token: Requires analytics:read permission and ?websiteId= on every request. The token must be allowed to access that website.
Read authentication and scopes for token creation, permission lists, and scoped tokens.

Errors

400 — Invalid fields value (only visitors is supported).
See API errors for the standard error envelope, auth failures, validation errors, permission errors, and rate limits.

✍️ Something missing? Suggest features.

🤖 AI agent or LLM? Read this page as markdown

Example request
curl -X GET "https://datafa.st/api/v1/analytics/realtime" \
  -H "Authorization: Bearer df_xxx"
Success response
{
  "status": "success",
  "data": [{
    "visitors": 42
  }]
}