API Endpoints
Complete reference for all Jetrack API endpoints
This page documents all available Jetrack API endpoints with parameters, request examples, and response schemas.
Base URL
https://analytics.brandjet.ai/api/v1All endpoints require authentication via API key. See API Keys for details.
Account Endpoints
Manage your account information, subscription, and usage.
Get Account Info
Retrieve the authenticated account information.
GET /accountResponse:
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "user@example.com",
"firstName": "John",
"lastName": "Doe",
"picture": "https://example.com/avatar.jpg",
"emailVerifiedAt": "2025-01-15T10:30:00.000Z",
"createdAt": "2025-01-01T00:00:00.000Z"
},
"meta": {
"status": 200
}
}Example:
curl -X GET "https://analytics.brandjet.ai/api/v1/account" \
-H "X-API-Key: bj_live_your_api_key_here"Get Subscription Info
Retrieve the current subscription status, plan, and limits.
GET /account/subscriptionResponse:
{
"success": true,
"data": {
"plan": "pro",
"status": "active",
"currentPeriodStart": "2025-01-01T00:00:00.000Z",
"currentPeriodEnd": "2025-02-01T00:00:00.000Z",
"limits": {
"pageviewsPerMonth": 100000,
"websites": 10
}
},
"meta": {
"status": 200
}
}Example:
curl -X GET "https://analytics.brandjet.ai/api/v1/account/subscription" \
-H "X-API-Key: bj_live_your_api_key_here"Get Usage Info
Retrieve the current billing period usage statistics.
GET /account/usageResponse:
{
"success": true,
"data": {
"currentPeriod": {
"start": "2025-01-01T00:00:00.000Z",
"end": "2025-02-01T00:00:00.000Z"
},
"pageviews": {
"used": 45230,
"limit": 100000,
"percentage": 45.23
},
"websites": {
"used": 3,
"limit": 10
}
},
"meta": {
"status": 200
}
}Example:
curl -X GET "https://analytics.brandjet.ai/api/v1/account/usage" \
-H "X-API-Key: bj_live_your_api_key_here"Website Endpoints
Manage your tracked websites.
List All Websites
Retrieve all websites belonging to your account.
GET /websitesResponse:
{
"success": true,
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"userId": "660e8400-e29b-41d4-a716-446655440000",
"name": "My Website",
"domain": "example.com",
"timezone": "America/New_York",
"apiKey": "wk_a1b2c3d4e5f6",
"allowedDomains": ["example.com", "app.example.com"],
"excludedIps": [],
"excludedPaths": ["/admin/*"],
"emailWeeklySummary": false,
"emailTrafficSpike": false,
"totalVisitors24h": 59,
"visitorsTimeline": [
{ "timestamp": "2025-01-26T10:00:00.000Z", "visitors": 5 }
],
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-20T15:45:00.000Z"
}
],
"meta": {
"status": 200
}
}Response Fields:
| Field | Type | Description |
|---|---|---|
id | string | Website unique identifier (UUID) |
userId | string | Owner user ID |
name | string | Website display name |
domain | string | Primary domain |
timezone | string | Reporting timezone (IANA format) |
apiKey | string | Tracking script API key |
allowedDomains | string[] | Additional allowed domains |
excludedIps | string[] | IP addresses excluded from tracking |
excludedPaths | string[] | URL paths excluded from tracking |
emailWeeklySummary | boolean | Weekly summary email setting |
emailTrafficSpike | boolean | Traffic spike alert setting |
totalVisitors24h | number | Visitors in last 24 hours |
visitorsTimeline | array | Hourly visitor data (last 24h) |
Example:
curl -X GET "https://analytics.brandjet.ai/api/v1/websites" \
-H "X-API-Key: bj_live_your_api_key_here"Create Website
Create a new website for tracking.
POST /websitesRequest Body:
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name for the website (1-100 chars) |
domain | string | Yes | The domain to track (e.g., example.com) |
timezone | string | Yes | Reporting timezone in IANA format (e.g., America/New_York) |
favicon | string | No | Website favicon/logo URL |
allowedDomains | string[] | No | Additional domains for tracking (max 10, supports wildcards) |
Example Request:
curl -X POST "https://analytics.brandjet.ai/api/v1/websites" \
-H "X-API-Key: bj_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "My New Website",
"domain": "newsite.com",
"timezone": "America/New_York",
"allowedDomains": ["app.newsite.com", "*.newsite.com"]
}'Response:
Returns the full website object (see List All Websites for response structure).
Get Website
Retrieve a single website by ID.
GET /websites/:idPath Parameters:
| Parameter | Type | Description |
|---|---|---|
id | string (UUID) | Website unique identifier |
Example:
curl -X GET "https://analytics.brandjet.ai/api/v1/websites/550e8400-e29b-41d4-a716-446655440000" \
-H "X-API-Key: bj_live_your_api_key_here"Response:
Returns the full website object (see List All Websites for response structure).
Update Website
Update a website's settings. Only the website owner can update it.
PATCH /websites/:idPath Parameters:
| Parameter | Type | Description |
|---|---|---|
id | string (UUID) | Website unique identifier |
Request Body:
| Field | Type | Description |
|---|---|---|
name | string | Display name (1-100 chars) |
domain | string | Primary domain |
timezone | string | Reporting timezone (IANA format) |
allowedDomains | string[] | Additional tracking domains (max 10) |
chartTheme | string | Dashboard theme: default, ocean, forest, sunset, monochrome, vibrant, midnight, candy, cyber |
excludedIps | string[] | IPs to exclude from tracking |
excludedPaths | string[] | URL paths to exclude (supports * wildcard) |
excludedHostnames | string[] | Hostnames to exclude |
excludedCountries | string[] | Country codes to exclude (ISO 3166-1 alpha-2) |
emailWeeklySummary | boolean | Receive weekly summary emails |
emailTrafficSpike | boolean | Receive traffic spike alerts |
All fields are optional. Only include fields you want to update.
Example:
curl -X PATCH "https://analytics.brandjet.ai/api/v1/websites/550e8400-e29b-41d4-a716-446655440000" \
-H "X-API-Key: bj_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Website Name",
"excludedPaths": ["/admin/*", "/internal/*"],
"emailWeeklySummary": true
}'Response:
Returns the updated website object.
Delete Website
Delete a website. Only the website owner can delete it. This action is irreversible.
DELETE /websites/:idPath Parameters:
| Parameter | Type | Description |
|---|---|---|
id | string (UUID) | Website unique identifier |
Example:
curl -X DELETE "https://analytics.brandjet.ai/api/v1/websites/550e8400-e29b-41d4-a716-446655440000" \
-H "X-API-Key: bj_live_your_api_key_here"Response:
{
"success": true,
"data": null,
"meta": {
"status": 200,
"message": "Website deleted successfully"
}
}Regenerate Tracking Key
Generate a new tracking API key for the website. The old key will be invalidated immediately.
POST /websites/:id/regenerate-tracking-keyPath Parameters:
| Parameter | Type | Description |
|---|---|---|
id | string (UUID) | Website unique identifier |
Example:
curl -X POST "https://analytics.brandjet.ai/api/v1/websites/550e8400-e29b-41d4-a716-446655440000/regenerate-tracking-key" \
-H "X-API-Key: bj_live_your_api_key_here"Response:
Returns the updated website object with the new apiKey value. The old tracking key is immediately invalidated.
Get Embed Code
Get the tracking script embed code for the website.
GET /websites/:id/embed-codePath Parameters:
| Parameter | Type | Description |
|---|---|---|
id | string (UUID) | Website unique identifier |
Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
allowLocalhost | boolean | false | Enable tracking on localhost for debugging |
Example:
curl -X GET "https://analytics.brandjet.ai/api/v1/websites/550e8400-e29b-41d4-a716-446655440000/embed-code?allowLocalhost=true" \
-H "X-API-Key: bj_live_your_api_key_here"Response:
{
"success": true,
"data": {
"embedCode": "<script defer src=\"https://analytics.brandjet.ai/js/tracker.min.js\" data-website-id=\"wk_a1b2c3d4e5f6\"></script>"
},
"meta": {
"status": 200
}
}Statistics Endpoints
Access analytics data for your websites. All stats endpoints require from and to date parameters in ISO 8601 format.
Common Query Parameters
These parameters are available on all stats endpoints:
| Parameter | Type | Required | Description |
|---|---|---|---|
from | string | Yes | Start date (ISO 8601, e.g., 2025-01-01) |
to | string | Yes | End date (ISO 8601, e.g., 2025-01-31) |
Filter Parameters
These optional parameters can be used to filter analytics data:
| Parameter | Type | Description |
|---|---|---|
referrer | string | Filter by referrer source |
campaign | string | Filter by campaign name |
page | string | Filter by page path |
entryPage | string | Filter by entry page |
country | string | Filter by country code (e.g., US, GB) |
city | string | Filter by city name |
browser | string | Filter by browser (e.g., Chrome, Firefox) |
os | string | Filter by operating system |
language | string | Filter by browser language |
Get Main Analytics
Return core analytics metrics for a website and time range.
GET /websites/:id/stats/mainExample:
curl -X GET "https://analytics.brandjet.ai/api/v1/websites/550e8400-e29b-41d4-a716-446655440000/stats/main?from=2025-01-01&to=2025-01-31" \
-H "X-API-Key: bj_live_your_api_key_here"Response:
{
"success": true,
"data": {
"totalVisitors": 12450,
"returningVisitors": 4567,
"returningVisitorRate": 0.37,
"totalPageviews": 45230,
"viewsPerVisit": 3.63,
"bounceRate": 0.55,
"averageSessionDurationSeconds": 185.3,
"previousTotalVisitors": 10000,
"previousBounceRate": 0.6,
"previousAverageSessionDurationSeconds": 150.5,
"visitorsChange": 24.5,
"bounceRateChange": -8.33,
"sessionDurationChange": 23.15,
"previousTotalPageviews": 35000,
"pageviewsChange": 29.23
},
"meta": {
"status": 200
}
}Response Fields:
| Field | Type | Description |
|---|---|---|
totalVisitors | number | Total unique visitors for the time range |
returningVisitors | number | Visitors who had sessions before the time range |
returningVisitorRate | number | Ratio of returning to total visitors (0-1) |
totalPageviews | number | Total pageviews for the time range |
viewsPerVisit | number | Average pageviews per visitor |
bounceRate | number | Sessions with single pageview ratio (0-1) |
averageSessionDurationSeconds | number | Average session duration in seconds |
previousTotalVisitors | number | Total visitors in the comparison period |
previousBounceRate | number | Bounce rate in the comparison period |
previousAverageSessionDurationSeconds | number | Avg session duration in comparison period |
visitorsChange | number | Percentage change from previous period |
bounceRateChange | number | Percentage change in bounce rate |
sessionDurationChange | number | Percentage change in session duration |
previousTotalPageviews | number | Total pageviews in the comparison period |
pageviewsChange | number | Percentage change in pageviews |
Get Visitors Chart
Return bucketed unique visitors over time for building a visitors chart.
GET /websites/:id/stats/visitors-chartAdditional Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
granularity | string | hour | Bucket size: hour or day |
Example:
curl -X GET "https://analytics.brandjet.ai/api/v1/websites/550e8400-e29b-41d4-a716-446655440000/stats/visitors-chart?from=2025-01-01&to=2025-01-07&granularity=day" \
-H "X-API-Key: bj_live_your_api_key_here"Response:
{
"success": true,
"data": {
"data": [
{ "date": "2025-01-01", "visitors": 1523, "pageviews": 4521 },
{ "date": "2025-01-02", "visitors": 1687, "pageviews": 5102 },
{ "date": "2025-01-03", "visitors": 1456, "pageviews": 4234 },
{ "date": "2025-01-04", "visitors": 892, "pageviews": 2156 },
{ "date": "2025-01-05", "visitors": 756, "pageviews": 1823 },
{ "date": "2025-01-06", "visitors": 1789, "pageviews": 5456 },
{ "date": "2025-01-07", "visitors": 1834, "pageviews": 5678 }
]
},
"meta": {
"status": 200
}
}Get Country Breakdown
Return visitor counts grouped by country.
GET /websites/:id/stats/countriesAdditional Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | string | 10 | Max results. Use all for all results |
Example:
curl -X GET "https://analytics.brandjet.ai/api/v1/websites/550e8400-e29b-41d4-a716-446655440000/stats/countries?from=2025-01-01&to=2025-01-31&limit=5" \
-H "X-API-Key: bj_live_your_api_key_here"Response:
{
"success": true,
"data": {
"data": [
{ "country": "US", "countryName": "United States", "visitors": 4523, "percentage": 36.3 },
{ "country": "GB", "countryName": "United Kingdom", "visitors": 2134, "percentage": 17.1 },
{ "country": "DE", "countryName": "Germany", "visitors": 1567, "percentage": 12.6 },
{ "country": "FR", "countryName": "France", "visitors": 1234, "percentage": 9.9 },
{ "country": "CA", "countryName": "Canada", "visitors": 987, "percentage": 7.9 }
],
"total": 12450
},
"meta": {
"status": 200
}
}Get Page Breakdown
Return visitor counts grouped by page URL path.
GET /websites/:id/stats/pagesAdditional Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | string | 10 | Max results. Use all for all results |
Example:
curl -X GET "https://analytics.brandjet.ai/api/v1/websites/550e8400-e29b-41d4-a716-446655440000/stats/pages?from=2025-01-01&to=2025-01-31&limit=5" \
-H "X-API-Key: bj_live_your_api_key_here"Response:
{
"success": true,
"data": {
"data": [
{ "page": "/", "visitors": 8934, "pageviews": 12456, "percentage": 71.8 },
{ "page": "/pricing", "visitors": 3456, "pageviews": 4567, "percentage": 27.8 },
{ "page": "/features", "visitors": 2345, "pageviews": 3456, "percentage": 18.8 },
{ "page": "/blog", "visitors": 1234, "pageviews": 2345, "percentage": 9.9 },
{ "page": "/about", "visitors": 987, "pageviews": 1234, "percentage": 7.9 }
],
"total": 45230
},
"meta": {
"status": 200
}
}Get Referrer Breakdown
Return visitor counts grouped by referrer source.
GET /websites/:id/stats/referrersAdditional Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | string | 10 | Max results. Use all for all results |
Example:
curl -X GET "https://analytics.brandjet.ai/api/v1/websites/550e8400-e29b-41d4-a716-446655440000/stats/referrers?from=2025-01-01&to=2025-01-31" \
-H "X-API-Key: bj_live_your_api_key_here"Response:
{
"success": true,
"data": {
"data": [
{ "referrer": "Direct", "visitors": 5678, "percentage": 45.6 },
{ "referrer": "google.com", "visitors": 3456, "percentage": 27.8 },
{ "referrer": "twitter.com", "visitors": 1234, "percentage": 9.9 },
{ "referrer": "linkedin.com", "visitors": 987, "percentage": 7.9 },
{ "referrer": "producthunt.com", "visitors": 654, "percentage": 5.3 }
],
"total": 12450
},
"meta": {
"status": 200
}
}Get Browser Breakdown
Return visitor counts grouped by browser.
GET /websites/:id/stats/browsersAdditional Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | string | 10 | Max results. Use all for all results |
Example:
curl -X GET "https://analytics.brandjet.ai/api/v1/websites/550e8400-e29b-41d4-a716-446655440000/stats/browsers?from=2025-01-01&to=2025-01-31" \
-H "X-API-Key: bj_live_your_api_key_here"Response:
{
"success": true,
"data": {
"data": [
{ "browser": "Chrome", "visitors": 7456, "percentage": 59.9 },
{ "browser": "Safari", "visitors": 2345, "percentage": 18.8 },
{ "browser": "Firefox", "visitors": 1234, "percentage": 9.9 },
{ "browser": "Edge", "visitors": 876, "percentage": 7.0 },
{ "browser": "Opera", "visitors": 345, "percentage": 2.8 }
],
"total": 12450
},
"meta": {
"status": 200
}
}Get Device Breakdown
Return visitor counts grouped by device type.
GET /websites/:id/stats/devicesAdditional Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | string | 10 | Max results. Use all for all results |
Example:
curl -X GET "https://analytics.brandjet.ai/api/v1/websites/550e8400-e29b-41d4-a716-446655440000/stats/devices?from=2025-01-01&to=2025-01-31" \
-H "X-API-Key: bj_live_your_api_key_here"Response:
{
"success": true,
"data": {
"data": [
{ "device": "Desktop", "visitors": 7890, "percentage": 63.4 },
{ "device": "Mobile", "visitors": 3567, "percentage": 28.6 },
{ "device": "Tablet", "visitors": 993, "percentage": 8.0 }
],
"total": 12450
},
"meta": {
"status": 200
}
}Check Has Events
Returns true if the website has received any tracking events.
GET /websites/:id/stats/has-eventsExample:
curl -X GET "https://analytics.brandjet.ai/api/v1/websites/550e8400-e29b-41d4-a716-446655440000/stats/has-events" \
-H "X-API-Key: bj_live_your_api_key_here"Response:
{
"success": true,
"data": {
"hasEvents": true
},
"meta": {
"status": 200
}
}Get Channel Breakdown
Return visitor counts grouped by traffic channel (Direct, Organic Search, Social, etc.).
GET /websites/:id/stats/channelsExample:
curl -X GET "https://analytics.brandjet.ai/api/v1/websites/550e8400-e29b-41d4-a716-446655440000/stats/channels?from=2025-01-01&to=2025-01-31" \
-H "X-API-Key: bj_live_your_api_key_here"Response:
{
"success": true,
"data": {
"channels": [
{
"name": "Direct",
"visitors": 5678,
"percentage": 45.6,
"topSources": []
},
{
"name": "Organic Search",
"visitors": 3456,
"percentage": 27.8,
"topSources": [
{ "source": "google.com", "visitors": 2890, "percentage": 83.6 },
{ "source": "bing.com", "visitors": 456, "percentage": 13.2 }
]
},
{
"name": "Social",
"visitors": 1234,
"percentage": 9.9,
"topSources": [
{ "source": "x.com", "visitors": 678, "percentage": 55.0 },
{ "source": "linkedin.com", "visitors": 456, "percentage": 37.0 }
]
}
],
"totalVisitors": 12450
},
"meta": {
"status": 200
}
}Get Campaign Breakdown
Return visitor counts grouped by UTM campaign parameters.
GET /websites/:id/stats/campaignsAdditional Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | string | 10 | Max results. Use all for all results |
Example:
curl -X GET "https://analytics.brandjet.ai/api/v1/websites/550e8400-e29b-41d4-a716-446655440000/stats/campaigns?from=2025-01-01&to=2025-01-31&limit=5" \
-H "X-API-Key: bj_live_your_api_key_here"Response:
{
"success": true,
"data": {
"campaigns": [
{
"name": "?utm_source=newsletter&utm_medium=email&utm_campaign=summer_sale",
"campaign": "summer_sale",
"source": "newsletter",
"medium": "email",
"ref": null,
"visitors": 1234,
"percentage": 45.6
},
{
"name": "?utm_source=twitter&utm_campaign=product_launch",
"campaign": "product_launch",
"source": "twitter",
"medium": null,
"ref": null,
"visitors": 876,
"percentage": 32.4
}
],
"totalVisitors": 2705
},
"meta": {
"status": 200
}
}Get City Breakdown
Return visitor counts grouped by city.
GET /websites/:id/stats/citiesAdditional Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | string | 10 | Max results. Use all for all results |
Example:
curl -X GET "https://analytics.brandjet.ai/api/v1/websites/550e8400-e29b-41d4-a716-446655440000/stats/cities?from=2025-01-01&to=2025-01-31&limit=5" \
-H "X-API-Key: bj_live_your_api_key_here"Response:
{
"success": true,
"data": {
"cities": [
{ "name": "New York", "country": "US", "visitors": 2345, "percentage": 18.8 },
{ "name": "London", "country": "GB", "visitors": 1567, "percentage": 12.6 },
{ "name": "San Francisco", "country": "US", "visitors": 1234, "percentage": 9.9 },
{ "name": "Los Angeles", "country": "US", "visitors": 987, "percentage": 7.9 },
{ "name": "Berlin", "country": "DE", "visitors": 876, "percentage": 7.0 }
],
"totalVisitors": 12450
},
"meta": {
"status": 200
}
}Get Entry Page Breakdown
Return visitor counts grouped by entry page (first page of session).
GET /websites/:id/stats/entry-pagesAdditional Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | string | 10 | Max results. Use all for all results |
Example:
curl -X GET "https://analytics.brandjet.ai/api/v1/websites/550e8400-e29b-41d4-a716-446655440000/stats/entry-pages?from=2025-01-01&to=2025-01-31&limit=5" \
-H "X-API-Key: bj_live_your_api_key_here"Response:
{
"success": true,
"data": {
"entryPages": [
{ "name": "/", "visitors": 6789, "percentage": 54.5 },
{ "name": "/pricing", "visitors": 2345, "percentage": 18.8 },
{ "name": "/blog/getting-started", "visitors": 1234, "percentage": 9.9 },
{ "name": "/features", "visitors": 987, "percentage": 7.9 },
{ "name": "/about", "visitors": 654, "percentage": 5.3 }
],
"totalVisitors": 12450
},
"meta": {
"status": 200
}
}Get Exit Link Breakdown
Return click counts grouped by outbound link destination.
GET /websites/:id/stats/exit-linksAdditional Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | string | 10 | Max results. Use all for all results |
Example:
curl -X GET "https://analytics.brandjet.ai/api/v1/websites/550e8400-e29b-41d4-a716-446655440000/stats/exit-links?from=2025-01-01&to=2025-01-31&limit=5" \
-H "X-API-Key: bj_live_your_api_key_here"Response:
{
"success": true,
"data": {
"exitLinks": [
{ "hostname": "github.com", "url": "https://github.com/example/repo", "clicks": 234, "percentage": 35.2 },
{ "hostname": "twitter.com", "url": "https://twitter.com/example", "clicks": 156, "percentage": 23.5 },
{ "hostname": "docs.example.com", "url": "https://docs.example.com/api", "clicks": 123, "percentage": 18.5 },
{ "hostname": "youtube.com", "url": "https://youtube.com/watch?v=abc123", "clicks": 87, "percentage": 13.1 },
{ "hostname": "linkedin.com", "url": "https://linkedin.com/company/example", "clicks": 65, "percentage": 9.8 }
],
"totalClicks": 665
},
"meta": {
"status": 200
}
}Get Operating System Breakdown
Return visitor counts grouped by operating system.
GET /websites/:id/stats/osAdditional Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | string | 10 | Max results. Use all for all results |
Example:
curl -X GET "https://analytics.brandjet.ai/api/v1/websites/550e8400-e29b-41d4-a716-446655440000/stats/os?from=2025-01-01&to=2025-01-31" \
-H "X-API-Key: bj_live_your_api_key_here"Response:
{
"success": true,
"data": {
"operatingSystems": [
{ "name": "Windows", "code": "windows", "visitors": 4567, "percentage": 36.7 },
{ "name": "macOS", "code": "macos", "visitors": 3456, "percentage": 27.8 },
{ "name": "iOS", "code": "ios", "visitors": 2345, "percentage": 18.8 },
{ "name": "Android", "code": "android", "visitors": 1234, "percentage": 9.9 },
{ "name": "Linux", "code": "linux", "visitors": 654, "percentage": 5.3 }
],
"totalVisitors": 12450
},
"meta": {
"status": 200
}
}Get Language Breakdown
Return visitor counts grouped by browser language.
GET /websites/:id/stats/languagesAdditional Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | string | 10 | Max results. Use all for all results |
Example:
curl -X GET "https://analytics.brandjet.ai/api/v1/websites/550e8400-e29b-41d4-a716-446655440000/stats/languages?from=2025-01-01&to=2025-01-31" \
-H "X-API-Key: bj_live_your_api_key_here"Response:
{
"success": true,
"data": {
"languages": [
{ "code": "en-US", "name": "English (United States)", "visitors": 5678, "percentage": 45.6 },
{ "code": "en-GB", "name": "English (United Kingdom)", "visitors": 2345, "percentage": 18.8 },
{ "code": "de-DE", "name": "German (Germany)", "visitors": 1567, "percentage": 12.6 },
{ "code": "fr-FR", "name": "French (France)", "visitors": 1234, "percentage": 9.9 },
{ "code": "es-ES", "name": "Spanish (Spain)", "visitors": 987, "percentage": 7.9 }
],
"totalVisitors": 12450
},
"meta": {
"status": 200
}
}Error Responses
All endpoints return consistent error responses:
400 Bad Request
{
"success": false,
"data": null,
"meta": {
"status": 400,
"errors": ["Query parameters \"from\" and \"to\" are required"],
"timestamp": "2025-01-26T12:00:00.000Z"
}
}401 Unauthorized
{
"success": false,
"data": null,
"meta": {
"status": 401,
"errors": ["Invalid API key"],
"timestamp": "2025-01-26T12:00:00.000Z"
}
}403 Forbidden
{
"success": false,
"data": null,
"meta": {
"status": 403,
"errors": ["Access denied to this website"],
"timestamp": "2025-01-26T12:00:00.000Z"
}
}404 Not Found
{
"success": false,
"data": null,
"meta": {
"status": 404,
"errors": ["Website not found"],
"timestamp": "2025-01-26T12:00:00.000Z"
}
}Next Steps
- API Overview - Introduction and quick start guide
- API Keys - Generate and manage API keys