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/v1The 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:
X-API-Key Header (Recommended)
curl -H "X-API-Key: bj_live_your_api_key_here" \
https://analytics.brandjet.ai/api/v1/accountAuthorization Bearer Header
curl -H "Authorization: Bearer bj_live_your_api_key_here" \
https://analytics.brandjet.ai/api/v1/accountFor 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
| Code | Description |
|---|---|
400 | Bad Request - Invalid parameters or missing required fields |
401 | Unauthorized - Invalid or missing API key |
403 | Forbidden - You don't have permission to access this resource |
404 | Not Found - The requested resource doesn't exist |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal 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/account3. 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.
| Endpoint | Description |
|---|---|
GET /account | Get account info |
GET /account/subscription | Get subscription details |
GET /account/usage | Get current period usage |
Websites
Manage your tracked websites and get embed codes.
| Endpoint | Description |
|---|---|
GET /websites | List all websites |
POST /websites | Create a new website |
GET /websites/:id | Get a specific website |
PATCH /websites/:id | Update a website |
DELETE /websites/:id | Delete a website |
POST /websites/:id/regenerate-tracking-key | Regenerate tracking key |
GET /websites/:id/embed-code | Get tracking embed code |
Statistics
Access analytics data for your websites.
| Endpoint | Description |
|---|---|
GET /websites/:id/stats/main | Core analytics metrics |
GET /websites/:id/stats/visitors-chart | Visitor timeseries data |
GET /websites/:id/stats/countries | Country breakdown |
GET /websites/:id/stats/pages | Page breakdown |
GET /websites/:id/stats/referrers | Referrer breakdown |
GET /websites/:id/stats/browsers | Browser breakdown |
GET /websites/:id/stats/devices | Device breakdown |
For complete endpoint documentation including parameters and response schemas, see the Endpoints Reference.
Next Steps
- API Keys - Learn how to generate and manage API keys
- Endpoints Reference - Complete endpoint documentation with examples