REST API endpoint

GET /v1/realtime

Current live snapshot: active users, pageviews, top pages, devices, countries, cities, and sources.

Request

GET https://api.nowmetrix.com/v1/realtime?site=TRACKER_ID

Use this endpoint for dashboards, newsroom displays, alerting, or lightweight integrations that need the current live state for one tracker.

Authentication

Requires an API key in the Authorization header: Authorization: Bearer nm_YOUR_KEY.

Query parameters

Name Type Required Description
site string required Tracker ID. The API key must have access to this tracker.

cURL example

curl -H "Authorization: Bearer nm_YOUR_KEY" \
  "https://api.nowmetrix.com/v1/realtime?site=TRACKER_ID"

Example response

{
  "site": "TRACKER_ID",
  "updated_at": "2026-06-26T12:24:30+00:00",
  "total_realtime": 128,
  "total_pageviews_today": 48215,
  "total_unique_visitors_today": 31890,
  "devices": {
    "mobile": 91,
    "desktop": 37
  },
  "top_pages": [
    {
      "url": "/news/global-market-update",
      "host": "example-media.test",
      "title": "Global market update: what changed today",
      "og_image": "https://thumbs.nowmetrix.com/thumbnails/example.jpg",
      "realtime_users": 34,
      "pageviews_today": 6240,
      "sources": [
        {
          "medium": "social",
          "source": "social.example",
          "count": 18,
          "percent": 53,
          "children": []
        },
        {
          "medium": "search",
          "source": "Google Search",
          "count": 9,
          "percent": 26,
          "children": [
            {
              "label": "google.com",
              "count": 9
            }
          ]
        }
      ]
    }
  ],
  "countries": [
    {
      "code": "CH",
      "name": "Switzerland",
      "count": 52
    },
    {
      "code": "DE",
      "name": "Germany",
      "count": 31
    }
  ],
  "cities": [
    {
      "name": "Zurich",
      "count": 21
    },
    {
      "name": "Berlin",
      "count": 13
    }
  ],
  "sources_top5": [
    {
      "medium": "(none)",
      "source": "(direct)",
      "count": 44,
      "percent": 34,
      "children": []
    }
  ]
}

Response fields

Field Type Description
site string Tracker ID used for the request.
updated_at string UTC timestamp for when the payload was generated.
total_realtime integer Number of active users in the current live window.
total_pageviews_today integer Total pageviews counted today for the tracker.
total_unique_visitors_today integer Approximate unique visitors counted today.
devices.mobile integer Active users classified as mobile.
devices.desktop integer Active users classified as desktop.
top_pages[] array<object> Up to 50 live pages sorted by realtime users.
top_pages[].url string Page path.
top_pages[].host string Hostname reported for the page.
top_pages[].title string Page title, falling back to the path if no title is available.
top_pages[].og_image string Thumbnail URL for the page.
top_pages[].realtime_users integer Active users currently on this page.
top_pages[].pageviews_today integer Today's pageviews for this page.
top_pages[].sources[] array<object> Traffic source breakdown for this page using the same row format as /v1/sources.
countries[] array<object> Top countries with code, English name, and count.
cities[] array<object> Top cities with name and count.
sources_top5[] array<object> Top five global traffic sources for the live window.

Freshness and caching

Responses are microcached per tracker for 8 seconds. The response also includes X-NowMetrix-Microcache with HIT or MISS.

Errors

HTTP Code Description
400 site_required The site query parameter is missing.
401 missing_token The Authorization header is missing.
401 invalid_token The token is invalid or revoked.
403 site_not_authorized The API key has no access to this tracker.
429 rate_limit_exceeded The rate limit has been exceeded.
503 redis_unavailable The realtime backend is temporarily unavailable.
{
  "error": {
    "code": "invalid_token",
    "message": "Bearer token is invalid or revoked."
  }
}