Source: https://datafa.st/docs/api/website/analytics/realtime-map
Markdown source: https://datafa.st/docs/api/website/analytics/realtime-map.md
Description: Return active visitors with location and device data, plus recent goal events and payments for the [realtime map](/changelog/real-time-map). Each visitor may include conversion prediction scores when enough revenue attribution data exists.

# Get realtime map

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

Return active visitors with location and device data, plus recent goal events and payments for the [realtime map](/changelog/real-time-map). Each visitor may include conversion prediction scores when enough revenue attribution data exists.

Active visitors are those with pageview activity in the last 10 minutes. Customers receive a prediction score of 100.

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

## 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`. |

## 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.count` | number | Number of currently active visitors in the realtime window. |
| `data.visitors` | object[] | Number of unique visitors represented by this row or time bucket. Use it to compare traffic volume across dates, pages, sources, countries, devices, or campaigns. Active visitor records used to draw the realtime map/list. |
| `data.visitors[].visitorId` | string | Alias for `datafast_visitor_id` on endpoints that accept both names. |
| `data.visitors[].location` | object | Location used to place the visitor on the map. |
| `data.visitors[].location.city` | string\|null | Visitor city. |
| `data.visitors[].location.region` | string\|null | Visitor region or state. |
| `data.visitors[].location.countryCode` | string\|null | Two-letter country code. |
| `data.visitors[].system` | object | Browser, OS, and device values for the active visitor. |
| `data.visitors[].system.browser` | string\|null | Browser name. |
| `data.visitors[].system.os` | string\|null | Operating system name. |
| `data.visitors[].system.device` | string\|null | Device type. |
| `data.visitors[].currentUrl` | string\|null | Latest page URL seen for the visitor. Use it to understand where the visitor was last active before you inspect the full visitor profile. |
| `data.visitors[].profileData` | object | Identify profile display data. |
| `data.visitors[].conversionLikelihood` | object\|null | Prediction score and raw values when available. |
| `data.conversionMetrics` | object | Baseline conversion metrics used for predictions. |
| `data.hasConversionPredictions` | boolean | Whether prediction fields are available. |
| `data.recentEvents` | object[] | Recent goal/custom events shown in realtime UI. |
| `data.recentPayments` | object[] | Recent payment events shown in realtime UI. |

## 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

**404** — Website not found.

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/map" \
  -H "Authorization: Bearer df_xxx"
```

### Success response

```json
{
  "status": "success",
  "data": {
    "count": 2,
    "visitors": [{
      "visitorId": "a3ab2331-989f-4cfa-91c6-2461c9e3c6bd",
      "location": {
        "city": "Paris",
        "countryCode": "FR"
      },
      "system": {
        "browser": "Chrome",
        "device": "desktop"
      },
      "currentUrl": "/pricing"
    }],
    "hasConversionPredictions": false,
    "recentEvents": [],
    "recentPayments": []
  }
}
```
