# get_site_realtime_visitors

Source: https://modulify.ai/docs/api/analytics/get-site-realtime-visitors

Reads how many people are on a published site at this moment, as a single visitor count.

- Title: Read visitors right now
- Scope: `analytics:read`
- Access: Read only
- Endpoint: `POST /v1/get_site_realtime_visitors`

It answers that count beside `published`, so it says nothing about which pages they are on. A site that has never been published comes back as zero. If the count cannot be read, the call fails with an error instead of answering zero.

Each call costs 1 of the 1,200 analytics lookups access tokens share per site per hour, as [Rate limits and result size](https://modulify.ai/docs/mcp/tokens-and-scopes#rate-limits-and-result-size) explains, and nothing when the answer is already cached or the site was never published. Over that limit it fails with `Access tokens, through MCP clients or the API, used their 1,200 analytics lookups for this site this hour. Wait and try again!` See [The live counter](https://modulify.ai/docs/grow/analytics#the-live-counter).

## Request

Call it with a `POST` to `https://api.modulify.ai/v1/get_site_realtime_visitors`, sending the inputs below as a JSON object. The token needs the `analytics:read` scope.

It only reads and changes nothing, so retrying it is safe.

```bash
curl -X POST https://api.modulify.ai/v1/get_site_realtime_visitors \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"projectId":"PROJECT_ID"}'
```

Over MCP, the same method is the [get_site_realtime_visitors tool](https://modulify.ai/docs/mcp/analytics/get-site-realtime-visitors).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `projectId` | string | Yes | The site id. |

## Response

Every call answers with the [JSON envelope](https://modulify.ai/docs/api/requests-and-responses#the-response) of `success`, `message`, `data`, `code` and `version`. `data` holds the result described above, and on a method that returns a total, `count` carries it. The [response headers](https://modulify.ai/docs/api/requests-and-responses#headers-on-every-method-call) carry the call's `X-Request-Id` and what is left of your per-minute budget in `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. [Errors](https://modulify.ai/docs/api/errors) explains every status code a call can answer with.