Jetrack

Jetrack

API Reference

API Reference

Programmatic access to your Jetrack analytics data

The Jetrack API gives you programmatic access to your analytics data. Build custom dashboards, automate reports, integrate with your internal tools, or sync data with other platforms.

Base URL

All API requests should be made to:

https://analytics.brandjet.ai/api/v1

The API follows RESTful conventions and returns JSON responses.

Authentication

The API uses API keys for authentication. You can generate an API key from your account settings.

There are two ways to authenticate:

curl -H "X-API-Key: bj_live_your_api_key_here" \
  https://analytics.brandjet.ai/api/v1/account

Authorization Bearer Header

curl -H "Authorization: Bearer bj_live_your_api_key_here" \
  https://analytics.brandjet.ai/api/v1/account

For detailed authentication setup, see the API Keys guide.

Response Format

All API responses follow a consistent JSON structure:

Success Response

{
  "success": true,
  "data": {
    // Response data here
  },
  "meta": {
    "status": 200,
    "message": "Success"
  }
}

Error Response

{
  "success": false,
  "data": null,
  "meta": {
    "status": 400,
    "errors": ["Error message here"],
    "timestamp": "2025-01-26T12:00:00.000Z"
  }
}

Error Codes

CodeDescription
400Bad Request - Invalid parameters or missing required fields
401Unauthorized - Invalid or missing API key
403Forbidden - You don't have permission to access this resource
404Not Found - The requested resource doesn't exist
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Something went wrong on our end

Quick Start

Get up and running with the API in three steps:

1. Generate an API Key

Go to your Settings page and generate a new API key. Copy it immediately - you won't be able to see it again.

2. Make Your First Request

Test your API key by fetching your account info:

curl -H "X-API-Key: bj_live_your_api_key_here" \
  https://analytics.brandjet.ai/api/v1/account

3. Fetch Your Analytics

List your websites and get analytics data:

# List your websites
curl -H "X-API-Key: bj_live_your_api_key_here" \
  https://analytics.brandjet.ai/api/v1/websites

# Get analytics for a specific website
curl -H "X-API-Key: bj_live_your_api_key_here" \
  "https://analytics.brandjet.ai/api/v1/websites/{website_id}/stats/main?from=2025-01-01&to=2025-01-31"

Available Endpoints

The API provides access to three main resource groups:

Account

Manage your account information, subscription, and usage.

EndpointDescription
GET /accountGet account info
GET /account/subscriptionGet subscription details
GET /account/usageGet current period usage

Websites

Manage your tracked websites and get embed codes.

EndpointDescription
GET /websitesList all websites
POST /websitesCreate a new website
GET /websites/:idGet a specific website
PATCH /websites/:idUpdate a website
DELETE /websites/:idDelete a website
POST /websites/:id/regenerate-tracking-keyRegenerate tracking key
GET /websites/:id/embed-codeGet tracking embed code

Statistics

Access analytics data for your websites.

EndpointDescription
GET /websites/:id/stats/mainCore analytics metrics
GET /websites/:id/stats/visitors-chartVisitor timeseries data
GET /websites/:id/stats/countriesCountry breakdown
GET /websites/:id/stats/pagesPage breakdown
GET /websites/:id/stats/referrersReferrer breakdown
GET /websites/:id/stats/browsersBrowser breakdown
GET /websites/:id/stats/devicesDevice breakdown

For complete endpoint documentation including parameters and response schemas, see the Endpoints Reference.

Next Steps

On this page