Source: https://datafa.st/docs/api/website/analytics/realtime
Markdown source: https://datafa.st/docs/api/website/analytics/realtime.md
Description: 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](/docs/mobile-app).

# 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](/docs/mobile-app).

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

> **Related:** [Realtime map](/changelog/real-time-map) · [Mobile app](/docs/mobile-app)

## Request

#### Query parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `websiteId` | string | Required with dft_ | Required with a `dft_` account token on Website API routes. Omit with a `df_` website key. Example: `?websiteId=665f0b3c4d2e1a0012345678`. |
| `fields` | string | No | 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

| Field | Type | Description |
| --- | --- | --- |
| `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](/docs/api/authentication) for token creation, permission lists, and scoped tokens.

### Errors

**400** — Invalid `fields` value (only `visitors` is supported).

See [API errors](/docs/api#errors) for the standard error envelope, auth failures, validation errors, permission errors, and rate limits.

## Code examples

### Example request

```bash
curl -X GET "https://datafa.st/api/v1/analytics/realtime" \
  -H "Authorization: Bearer df_xxx"
```

### Success response

```json
{
  "status": "success",
  "data": [{
    "visitors": 42
  }]
}
```
