MENU navbar-image

Introduction

REST API for accessing analytics data, session recordings, and visitor insights.

Welcome to the NagrajTo API documentation. This API provides programmatic access to your analytics data, including:

- **Overview statistics** - sessions, visitors, pageviews, bounce rates
- **Page analytics** - top pages, time on page, scroll depth
- **Technology insights** - browsers, operating systems, devices
- **Geographic data** - countries, cities, languages
- **Marketing metrics** - UTM parameters, referrers
- **Performance data** - page load times, Core Web Vitals
- **User interactions** - clicks, scroll depth, heatmaps

<aside>
All API endpoints require authentication via Bearer token. You can generate your API token in the dashboard settings.
</aside>

**Rate Limiting:** 60 requests per minute per token.

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {YOUR_API_TOKEN}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

Generate your API token in the dashboard under Settings > API Access. Use as Bearer token: Authorization: Bearer {token}

Analytics

APIs for accessing analytics data including sessions, pageviews, technology, geography, marketing, and performance metrics.

All endpoints require authentication via Bearer token and accept common filter parameters.

List Domains

requires authentication

Get a list of all domains associated with the authenticated user's account.

Example request:
curl --request GET \
    --get "http://nagrajto.local/api/analytics/domains" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://nagrajto.local/api/analytics/domains"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://nagrajto.local/api/analytics/domains';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://nagrajto.local/api/analytics/domains'
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "success": true,
    "data": [
        {
            "id": 1,
            "name": "My Website",
            "domain": "example.com",
            "is_active": true,
            "created_at": "2024-01-15T10:30:00Z"
        }
    ]
}
 

Request      

GET api/analytics/domains

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Overview Statistics

requires authentication

Get high-level analytics overview including sessions, visitors, pageviews, bounce rate, and trends.

Example request:
curl --request GET \
    --get "http://nagrajto.local/api/analytics/overview?domain_id=1&period=30d&date_from=2024-01-01&date_to=2024-01-31&device_type=mobile&browser=Chrome&os=Windows&country=PL" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://nagrajto.local/api/analytics/overview"
);

const params = {
    "domain_id": "1",
    "period": "30d",
    "date_from": "2024-01-01",
    "date_to": "2024-01-31",
    "device_type": "mobile",
    "browser": "Chrome",
    "os": "Windows",
    "country": "PL",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://nagrajto.local/api/analytics/overview';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'domain_id' => '1',
            'period' => '30d',
            'date_from' => '2024-01-01',
            'date_to' => '2024-01-31',
            'device_type' => 'mobile',
            'browser' => 'Chrome',
            'os' => 'Windows',
            'country' => 'PL',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://nagrajto.local/api/analytics/overview'
params = {
  'domain_id': '1',
  'period': '30d',
  'date_from': '2024-01-01',
  'date_to': '2024-01-31',
  'device_type': 'mobile',
  'browser': 'Chrome',
  'os': 'Windows',
  'country': 'PL',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200, Success):


{
    "success": true,
    "data": {
        "sessions": 1234,
        "visitors": 567,
        "pageviews": 3456,
        "bounce_rate": 45.2,
        "avg_duration": 180,
        "pages_per_session": 2.8,
        "changes": {
            "sessions": 12.5,
            "visitors": 8.3
        },
        "daily_data": [],
        "top_pages": [],
        "top_referrers": [],
        "devices": {
            "desktop": 800,
            "mobile": 400
        }
    },
    "meta": {
        "domain": {
            "id": 1,
            "name": "My Site"
        },
        "period": {
            "start": "2024-01-01T00:00:00Z",
            "end": "2024-01-31T23:59:59Z"
        }
    }
}
 

Example response (404, Domain not found):


{
    "success": false,
    "error": "Domain not found or access denied"
}
 

Request      

GET api/analytics/overview

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

domain_id   integer  optional    

The domain ID. If not specified, returns data for the first domain. Example: 1

period   string  optional    

Time period preset: 24h, 7d, 30d, 90d, year. Default: 7d. Example: 30d

date_from   string  optional    

Custom start date (YYYY-MM-DD). Overrides period. Example: 2024-01-01

date_to   string  optional    

Custom end date (YYYY-MM-DD). Overrides period. Example: 2024-01-31

device_type   string  optional    

Filter by device: desktop, mobile, tablet. Example: mobile

browser   string  optional    

Filter by browser name. Example: Chrome

os   string  optional    

Filter by operating system. Example: Windows

country   string  optional    

Filter by country code (ISO 3166-1 alpha-2). Example: PL

Page Statistics

requires authentication

Get page-level analytics including views, unique views, time on page, and scroll depth.

Example request:
curl --request GET \
    --get "http://nagrajto.local/api/analytics/pages?domain_id=1&period=30d&limit=20" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://nagrajto.local/api/analytics/pages"
);

const params = {
    "domain_id": "1",
    "period": "30d",
    "limit": "20",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://nagrajto.local/api/analytics/pages';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'domain_id' => '1',
            'period' => '30d',
            'limit' => '20',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://nagrajto.local/api/analytics/pages'
params = {
  'domain_id': '1',
  'period': '30d',
  'limit': '20',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
    "success": true,
    "data": [
        {
            "path": "/",
            "views": 500,
            "unique_views": 350,
            "avg_time_on_page": 45000,
            "avg_scroll_depth": 75,
            "total_clicks": 120
        }
    ]
}
 

Request      

GET api/analytics/pages

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

domain_id   integer  optional    

The domain ID. Example: 1

period   string  optional    

Time period preset. Default: 7d. Example: 30d

limit   integer  optional    

Maximum number of pages to return (1-100). Default: 50. Example: 20

Technology Statistics

requires authentication

Get visitor technology breakdown: browsers, operating systems, device types, and screen resolutions.

Example request:
curl --request GET \
    --get "http://nagrajto.local/api/analytics/technology?domain_id=1&period=30d" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://nagrajto.local/api/analytics/technology"
);

const params = {
    "domain_id": "1",
    "period": "30d",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://nagrajto.local/api/analytics/technology';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'domain_id' => '1',
            'period' => '30d',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://nagrajto.local/api/analytics/technology'
params = {
  'domain_id': '1',
  'period': '30d',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
    "success": true,
    "data": {
        "browsers": [
            {
                "browser": "Chrome",
                "count": 500
            }
        ],
        "os": [
            {
                "os": "Windows",
                "count": 400
            }
        ],
        "devices": [
            {
                "device_type": "desktop",
                "count": 600
            }
        ],
        "resolutions": [
            {
                "resolution": "1920x1080",
                "count": 300
            }
        ]
    }
}
 

Request      

GET api/analytics/technology

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

domain_id   integer  optional    

The domain ID. Example: 1

period   string  optional    

Time period preset. Default: 7d. Example: 30d

Geography Statistics

requires authentication

Get visitor geographic distribution: countries, cities, languages, and timezones.

Example request:
curl --request GET \
    --get "http://nagrajto.local/api/analytics/geography?domain_id=1&period=30d" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://nagrajto.local/api/analytics/geography"
);

const params = {
    "domain_id": "1",
    "period": "30d",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://nagrajto.local/api/analytics/geography';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'domain_id' => '1',
            'period' => '30d',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://nagrajto.local/api/analytics/geography'
params = {
  'domain_id': '1',
  'period': '30d',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
    "success": true,
    "data": {
        "countries": [
            {
                "country_code": "PL",
                "count": 500
            }
        ],
        "cities": [
            {
                "city": "Warsaw",
                "country_code": "PL",
                "count": 200
            }
        ],
        "languages": [
            {
                "language": "pl-PL",
                "count": 400
            }
        ],
        "timezones": [
            {
                "timezone": "Europe/Warsaw",
                "count": 450
            }
        ]
    }
}
 

Request      

GET api/analytics/geography

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

domain_id   integer  optional    

The domain ID. Example: 1

period   string  optional    

Time period preset. Default: 7d. Example: 30d

Marketing Statistics

requires authentication

Get marketing and traffic source data including referrers, UTM campaigns, sources, mediums, and content tags.

Example request:
curl --request GET \
    --get "http://nagrajto.local/api/analytics/marketing?domain_id=1&period=30d&date_from=2024-01-01&date_to=2024-01-31" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://nagrajto.local/api/analytics/marketing"
);

const params = {
    "domain_id": "1",
    "period": "30d",
    "date_from": "2024-01-01",
    "date_to": "2024-01-31",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://nagrajto.local/api/analytics/marketing';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'domain_id' => '1',
            'period' => '30d',
            'date_from' => '2024-01-01',
            'date_to' => '2024-01-31',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://nagrajto.local/api/analytics/marketing'
params = {
  'domain_id': '1',
  'period': '30d',
  'date_from': '2024-01-01',
  'date_to': '2024-01-31',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
    "success": true,
    "data": {
        "referrers": [
            {
                "referrer": "google.com",
                "count": 500
            }
        ],
        "utm_sources": [
            {
                "utm_source": "newsletter",
                "count": 200
            }
        ],
        "utm_mediums": [
            {
                "utm_medium": "email",
                "count": 150
            }
        ],
        "utm_campaigns": [
            {
                "utm_campaign": "spring_sale",
                "count": 100
            }
        ],
        "utm_contents": [
            {
                "utm_content": "header_cta",
                "count": 50
            }
        ]
    }
}
 

Request      

GET api/analytics/marketing

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

domain_id   integer  optional    

The domain ID. Example: 1

period   string  optional    

Time period preset: 24h, 7d, 30d, 90d, year. Default: 7d. Example: 30d

date_from   string  optional    

Custom start date (YYYY-MM-DD). Example: 2024-01-01

date_to   string  optional    

Custom end date (YYYY-MM-DD). Example: 2024-01-31

Performance Statistics

requires authentication

Get page performance metrics including load times, Core Web Vitals (LCP, FID, CLS), and time to interactive.

Example request:
curl --request GET \
    --get "http://nagrajto.local/api/analytics/performance?domain_id=1&period=30d&date_from=2024-01-01&date_to=2024-01-31" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://nagrajto.local/api/analytics/performance"
);

const params = {
    "domain_id": "1",
    "period": "30d",
    "date_from": "2024-01-01",
    "date_to": "2024-01-31",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://nagrajto.local/api/analytics/performance';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'domain_id' => '1',
            'period' => '30d',
            'date_from' => '2024-01-01',
            'date_to' => '2024-01-31',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://nagrajto.local/api/analytics/performance'
params = {
  'domain_id': '1',
  'period': '30d',
  'date_from': '2024-01-01',
  'date_to': '2024-01-31',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
    "success": true,
    "data": {
        "avg_page_load": 1250,
        "avg_dom_ready": 800,
        "avg_first_paint": 450,
        "avg_first_contentful_paint": 650,
        "avg_lcp": 1100,
        "avg_fid": 25,
        "avg_cls": 0.05,
        "by_page": [
            {
                "path": "/",
                "avg_load": 1000,
                "count": 500
            }
        ]
    }
}
 

Request      

GET api/analytics/performance

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

domain_id   integer  optional    

The domain ID. Example: 1

period   string  optional    

Time period preset: 24h, 7d, 30d, 90d, year. Default: 7d. Example: 30d

date_from   string  optional    

Custom start date (YYYY-MM-DD). Example: 2024-01-01

date_to   string  optional    

Custom end date (YYYY-MM-DD). Example: 2024-01-31

Interactions Statistics

requires authentication

Get user interaction data including total clicks, rage clicks (frustration indicator), scroll depth, and click patterns.

Example request:
curl --request GET \
    --get "http://nagrajto.local/api/analytics/interactions?domain_id=1&period=30d&date_from=2024-01-01&date_to=2024-01-31" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://nagrajto.local/api/analytics/interactions"
);

const params = {
    "domain_id": "1",
    "period": "30d",
    "date_from": "2024-01-01",
    "date_to": "2024-01-31",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://nagrajto.local/api/analytics/interactions';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'domain_id' => '1',
            'period' => '30d',
            'date_from' => '2024-01-01',
            'date_to' => '2024-01-31',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://nagrajto.local/api/analytics/interactions'
params = {
  'domain_id': '1',
  'period': '30d',
  'date_from': '2024-01-01',
  'date_to': '2024-01-31',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
    "success": true,
    "data": {
        "total_clicks": 15000,
        "rage_clicks": 120,
        "avg_scroll_depth": 68.5,
        "clicks_by_element": [
            {
                "selector": "button.cta",
                "count": 500
            }
        ],
        "top_clicked_pages": [
            {
                "path": "/pricing",
                "clicks": 2000
            }
        ]
    }
}
 

Request      

GET api/analytics/interactions

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

domain_id   integer  optional    

The domain ID. Example: 1

period   string  optional    

Time period preset: 24h, 7d, 30d, 90d, year. Default: 7d. Example: 30d

date_from   string  optional    

Custom start date (YYYY-MM-DD). Example: 2024-01-01

date_to   string  optional    

Custom end date (YYYY-MM-DD). Example: 2024-01-31

Heatmap Data

requires authentication

Get click heatmap data for a specific page, including click coordinates and element selectors.

Example request:
curl --request GET \
    --get "http://nagrajto.local/api/analytics/heatmap?domain_id=1&page=%2Fcontact&period=30d" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://nagrajto.local/api/analytics/heatmap"
);

const params = {
    "domain_id": "1",
    "page": "/contact",
    "period": "30d",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://nagrajto.local/api/analytics/heatmap';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'domain_id' => '1',
            'page' => '/contact',
            'period' => '30d',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://nagrajto.local/api/analytics/heatmap'
params = {
  'domain_id': '1',
  'page': '/contact',
  'period': '30d',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
    "success": true,
    "data": {
        "clicks": [
            {
                "x": 150,
                "y": 300,
                "selector": "button#submit",
                "count": 45
            }
        ],
        "total_clicks": 500,
        "page_snapshot_url": "/snapshots/abc123.html"
    }
}
 

Example response (400, Missing page):


{
    "success": false,
    "error": "Page parameter is required"
}
 

Request      

GET api/analytics/heatmap

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

domain_id   integer  optional    

The domain ID. Example: 1

page   string     

The page path to get heatmap for. Example: /contact

period   string  optional    

Time period preset: 24h, 7d, 30d, 90d, year. Default: 7d. Example: 30d

Dead Clicks Analysis

requires authentication

Get analysis of dead clicks - clicks on non-interactive elements that may indicate UX issues or user confusion.

Example request:
curl --request GET \
    --get "http://nagrajto.local/api/analytics/dead-clicks?domain_id=1&period=30d&limit=20" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://nagrajto.local/api/analytics/dead-clicks"
);

const params = {
    "domain_id": "1",
    "period": "30d",
    "limit": "20",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://nagrajto.local/api/analytics/dead-clicks';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'domain_id' => '1',
            'period' => '30d',
            'limit' => '20',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://nagrajto.local/api/analytics/dead-clicks'
params = {
  'domain_id': '1',
  'period': '30d',
  'limit': '20',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
    "success": true,
    "data": [
        {
            "selector": "div.pricing-card",
            "page": "/pricing",
            "count": 85,
            "is_interactive": false,
            "suggestion": "Consider making this element clickable or adding a CTA"
        }
    ]
}
 

Request      

GET api/analytics/dead-clicks

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Query Parameters

domain_id   integer  optional    

The domain ID. Example: 1

period   string  optional    

Time period preset: 24h, 7d, 30d, 90d, year. Default: 7d. Example: 30d

limit   integer  optional    

Maximum results to return (1-100). Default: 50. Example: 20

Endpoints

POST api/broadcasting/auth

requires authentication

Example request:
curl --request POST \
    "http://nagrajto.local/api/broadcasting/auth" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://nagrajto.local/api/broadcasting/auth"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://nagrajto.local/api/broadcasting/auth';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://nagrajto.local/api/broadcasting/auth'
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers)
response.json()

Request      

POST api/broadcasting/auth

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Store rrweb events via HTTP (for large payloads like FullSnapshot).

requires authentication

This bypasses WebSocket message size limits.

Example request:
curl --request POST \
    "http://nagrajto.local/api/rrweb-events" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://nagrajto.local/api/rrweb-events"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://nagrajto.local/api/rrweb-events';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://nagrajto.local/api/rrweb-events'
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers)
response.json()

Request      

POST api/rrweb-events

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

List sessions for a domain.

requires authentication

Example request:
curl --request GET \
    --get "http://nagrajto.local/api/sessions" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://nagrajto.local/api/sessions"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://nagrajto.local/api/sessions';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://nagrajto.local/api/sessions'
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/sessions

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Get session details with events for playback.

requires authentication

Example request:
curl --request GET \
    --get "http://nagrajto.local/api/sessions/architecto" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://nagrajto.local/api/sessions/architecto"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://nagrajto.local/api/sessions/architecto';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://nagrajto.local/api/sessions/architecto'
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/sessions/{session}

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

session   string     

The session. Example: architecto