Jetrack

Jetrack

API Reference

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/v1

All 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 /account

Response:

{
  "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/subscription

Response:

{
  "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/usage

Response:

{
  "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 /websites

Response:

{
  "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:

FieldTypeDescription
idstringWebsite unique identifier (UUID)
userIdstringOwner user ID
namestringWebsite display name
domainstringPrimary domain
timezonestringReporting timezone (IANA format)
apiKeystringTracking script API key
allowedDomainsstring[]Additional allowed domains
excludedIpsstring[]IP addresses excluded from tracking
excludedPathsstring[]URL paths excluded from tracking
emailWeeklySummarybooleanWeekly summary email setting
emailTrafficSpikebooleanTraffic spike alert setting
totalVisitors24hnumberVisitors in last 24 hours
visitorsTimelinearrayHourly 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 /websites

Request Body:

FieldTypeRequiredDescription
namestringYesDisplay name for the website (1-100 chars)
domainstringYesThe domain to track (e.g., example.com)
timezonestringYesReporting timezone in IANA format (e.g., America/New_York)
faviconstringNoWebsite favicon/logo URL
allowedDomainsstring[]NoAdditional 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/:id

Path Parameters:

ParameterTypeDescription
idstring (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/:id

Path Parameters:

ParameterTypeDescription
idstring (UUID)Website unique identifier

Request Body:

FieldTypeDescription
namestringDisplay name (1-100 chars)
domainstringPrimary domain
timezonestringReporting timezone (IANA format)
allowedDomainsstring[]Additional tracking domains (max 10)
chartThemestringDashboard theme: default, ocean, forest, sunset, monochrome, vibrant, midnight, candy, cyber
excludedIpsstring[]IPs to exclude from tracking
excludedPathsstring[]URL paths to exclude (supports * wildcard)
excludedHostnamesstring[]Hostnames to exclude
excludedCountriesstring[]Country codes to exclude (ISO 3166-1 alpha-2)
emailWeeklySummarybooleanReceive weekly summary emails
emailTrafficSpikebooleanReceive 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/:id

Path Parameters:

ParameterTypeDescription
idstring (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-key

Path Parameters:

ParameterTypeDescription
idstring (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-code

Path Parameters:

ParameterTypeDescription
idstring (UUID)Website unique identifier

Query Parameters:

ParameterTypeDefaultDescription
allowLocalhostbooleanfalseEnable 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:

ParameterTypeRequiredDescription
fromstringYesStart date (ISO 8601, e.g., 2025-01-01)
tostringYesEnd date (ISO 8601, e.g., 2025-01-31)

Filter Parameters

These optional parameters can be used to filter analytics data:

ParameterTypeDescription
referrerstringFilter by referrer source
campaignstringFilter by campaign name
pagestringFilter by page path
entryPagestringFilter by entry page
countrystringFilter by country code (e.g., US, GB)
citystringFilter by city name
browserstringFilter by browser (e.g., Chrome, Firefox)
osstringFilter by operating system
languagestringFilter by browser language

Get Main Analytics

Return core analytics metrics for a website and time range.

GET /websites/:id/stats/main

Example:

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:

FieldTypeDescription
totalVisitorsnumberTotal unique visitors for the time range
returningVisitorsnumberVisitors who had sessions before the time range
returningVisitorRatenumberRatio of returning to total visitors (0-1)
totalPageviewsnumberTotal pageviews for the time range
viewsPerVisitnumberAverage pageviews per visitor
bounceRatenumberSessions with single pageview ratio (0-1)
averageSessionDurationSecondsnumberAverage session duration in seconds
previousTotalVisitorsnumberTotal visitors in the comparison period
previousBounceRatenumberBounce rate in the comparison period
previousAverageSessionDurationSecondsnumberAvg session duration in comparison period
visitorsChangenumberPercentage change from previous period
bounceRateChangenumberPercentage change in bounce rate
sessionDurationChangenumberPercentage change in session duration
previousTotalPageviewsnumberTotal pageviews in the comparison period
pageviewsChangenumberPercentage change in pageviews

Get Visitors Chart

Return bucketed unique visitors over time for building a visitors chart.

GET /websites/:id/stats/visitors-chart

Additional Query Parameters:

ParameterTypeDefaultDescription
granularitystringhourBucket 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/countries

Additional Query Parameters:

ParameterTypeDefaultDescription
limitstring10Max 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/pages

Additional Query Parameters:

ParameterTypeDefaultDescription
limitstring10Max 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/referrers

Additional Query Parameters:

ParameterTypeDefaultDescription
limitstring10Max 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/browsers

Additional Query Parameters:

ParameterTypeDefaultDescription
limitstring10Max 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/devices

Additional Query Parameters:

ParameterTypeDefaultDescription
limitstring10Max 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-events

Example:

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/channels

Example:

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/campaigns

Additional Query Parameters:

ParameterTypeDefaultDescription
limitstring10Max 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/cities

Additional Query Parameters:

ParameterTypeDefaultDescription
limitstring10Max 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-pages

Additional Query Parameters:

ParameterTypeDefaultDescription
limitstring10Max 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
  }
}

Return click counts grouped by outbound link destination.

GET /websites/:id/stats/exit-links

Additional Query Parameters:

ParameterTypeDefaultDescription
limitstring10Max 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/os

Additional Query Parameters:

ParameterTypeDefaultDescription
limitstring10Max 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/languages

Additional Query Parameters:

ParameterTypeDefaultDescription
limitstring10Max 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

On this page