Access NowMetrix realtime analytics from your own systems.
The public API exposes live snapshots, traffic sources, overview metrics, and pacing data.
Base URL
https://api.nowmetrix.com
Authentication
Send your API key as a Bearer token in the Authorization header.
API keys can be generated by account admins in the NowMetrix dashboard under
Settings -> API.
Authorization: Bearer nm_YOUR_KEY
HTTPS is required for all API requests.
Endpoints
| Method | Path | Description | Example |
|---|---|---|---|
| GET | /v1/realtime |
Current live snapshot: active users, pageviews, top pages, devices, countries, and sources. | |
| GET | /v1/sources |
Traffic sources from the current live window with classification and UTM campaign data. | |
| GET | /v1/overview |
Daily pageviews and visits for the last N completed days. | |
| GET | /v1/charts |
Historical chart data, summary metrics, and top pages for presets or a custom date range. | |
| GET | /v1/pace |
Today pacing, yesterday comparison, and 15-minute intraday curves. | |
| GET | /api/me |
Session-based user context: current tracker and all trackers the user can access. |
The /v1/* endpoints use API-key Bearer authentication on api.nowmetrix.com.
/api/me is session-based and shows the current user which trackers their account can access.
Parameters
| Name | Type | Status | Description |
|---|---|---|---|
site |
string |
required | Tracker ID. The API key must have access to this tracker. |
days |
integer |
optional | Only for /v1/overview. Allowed range: 1-30. Default: 30. |
preset |
string |
optional | Only for /v1/charts. One of today, yesterday, last7, last14, last30, last90, this_month, last_month, custom. Default: last30. |
start / end |
date |
optional | Only for /v1/charts with preset=custom. Format: YYYY-MM-DD. Ranges are limited by the tracker's available history. |
limit |
integer |
optional | Only for /v1/charts. Maximum number of top pages to return. Allowed range: 1-100. Default: 100. |
q |
string |
optional | Only for /v1/charts. Filters top pages by URL, title, or author. Alias: search. |
Examples
cURL
curl -H "Authorization: Bearer nm_YOUR_KEY" \
"https://api.nowmetrix.com/v1/realtime?site=TRACKER_ID"
JavaScript
const res = await fetch(
"https://api.nowmetrix.com/v1/realtime?site=TRACKER_ID",
{ headers: { Authorization: "Bearer nm_YOUR_KEY" } }
);
const data = await res.json();
console.log(data.total_realtime, "users live");
Python
import requests
r = requests.get(
"https://api.nowmetrix.com/v1/realtime",
params={"site": "TRACKER_ID"},
headers={"Authorization": "Bearer nm_YOUR_KEY"},
)
data = r.json()
print(data["total_realtime"], "users live")
PHP
<?php
$ch = curl_init("https://api.nowmetrix.com/v1/realtime?site=TRACKER_ID");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer nm_YOUR_KEY"],
]);
$data = json_decode(curl_exec($ch), true);
echo $data["total_realtime"] . " users live\n";
Rate limits and caching
The API allows 10 requests per minute per tracker. Multiple users or keys querying the same tracker share the same counter.
X-RateLimit-Limit: 10
X-RateLimit-Remaining: 7
X-RateLimit-Reset: 1745236800
Retry-After: 12
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 backend is temporarily unavailable. |
{
"error": {
"code": "invalid_token",
"message": "Bearer token is invalid or revoked."
}
}