Pro Plan10 minutesintermediate

API Overview

Introduction to the Zenovay API - capabilities, authentication, and getting started with programmatic access.

apideveloperintegrationrest
Last updated: January 15, 2025
Pro Plan

The Zenovay API provides programmatic access to your analytics data. Build custom integrations, automate workflows, and extend Zenovay's capabilities.

What You Can Do

External API (API Key Authentication)

CapabilityEndpoint
Analytics overviewGET /api/external/v1/analytics/:websiteId
Visitor dataGET /api/external/v1/analytics/:websiteId/visitors
Page analyticsGET /api/external/v1/analytics/:websiteId/pages
Country dataGET /api/external/v1/analytics/:websiteId/countries
Technology breakdownGET /api/external/v1/analytics/:websiteId/technology
List websitesGET /api/external/v1/websites
Website detailsGET /api/external/v1/websites/:websiteId
API usageGET /api/external/v1/usage
Heatmap pagesGET /api/external/v1/heatmaps/:websiteId/pages
Session replaysGET /api/external/v1/replays/:websiteId/sessions
Error groupsGET /api/external/v1/errors/:websiteId/groups

Tracking (Public)

CapabilityEndpoint
Track pageview/eventPOST /e/:trackingCode
Live visitor countGET /live/:trackingCode
HeartbeatPOST /heartbeat

API Access by Plan

PlanAPI AccessRequests/MinuteMonthly Limit
FreeLimited101,000
ProFull3010,000
ScaleFull60100,000
EnterpriseFull1201,000,000

Base URL

The External API base URL is:

https://api.zenovay.com/api/external/v1

Authentication

API Keys

Authenticate with API keys using the X-API-Key header or Authorization: Bearer header:

curl https://api.zenovay.com/api/external/v1/websites \
  -H "X-API-Key: zv_YOUR_API_KEY"

Or using Bearer authentication:

curl https://api.zenovay.com/api/external/v1/websites \
  -H "Authorization: Bearer zv_YOUR_API_KEY"

API keys always start with the zv_ prefix.

Getting Your API Key

  1. Go to API Keys in the sidebar
  2. Click "Create API Key"
  3. Name your key
  4. Set permissions
  5. Copy the key (shown once)

See Authentication for details.

Quick Start

List Your Websites

curl https://api.zenovay.com/api/external/v1/websites \
  -H "X-API-Key: zv_YOUR_API_KEY"

Get Analytics Summary

curl "https://api.zenovay.com/api/external/v1/analytics/YOUR_TRACKING_CODE?timeRange=30d" \
  -H "X-API-Key: zv_YOUR_API_KEY"

Check API Usage

curl https://api.zenovay.com/api/external/v1/usage \
  -H "X-API-Key: zv_YOUR_API_KEY"

Request Format

Headers

Required headers:

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Optional headers:

X-Request-ID: your-unique-id (for debugging)
Accept-Language: en-US

Query Parameters

Common parameters:

ParameterDescriptionExample
pagePage number?page=2
per_pageItems per page (max 100)?per_page=50
start_dateFilter start?start_date=2025-01-01
end_dateFilter end?end_date=2025-01-31
website_idFilter by website?website_id=web_xyz

Request Body

For POST/PUT requests:

{
  "field": "value",
  "nested": {
    "field": "value"
  }
}

Response Format

Success Response

{
  "data": { ... },
  "meta": {
    "total": 100,
    "page": 1,
    "per_page": 50
  }
}

Error Response

{
  "error": {
    "code": "invalid_parameter",
    "message": "The 'start_date' parameter is invalid",
    "details": {
      "parameter": "start_date",
      "expected": "ISO 8601 date"
    }
  }
}

HTTP Status Codes

CodeMeaning
200Success
201Created
400Bad request
401Unauthorized
403Forbidden
404Not found
429Rate limited
500Server error

Client Libraries

Zenovay does not have official SDK packages. Instead, use the CDN tracking script for browser-side tracking and standard HTTP requests (fetch, requests, curl, etc.) for server-side API access.

JavaScript (Browser)

Add the tracking script to your HTML:

<script defer data-tracking-code="YOUR_TRACKING_CODE" src="https://api.zenovay.com/z.js"></script>

Then use the global zenovay function:

// Track events
zenovay('track', 'signup', { plan: 'pro' });

JavaScript (Server-Side)

Use fetch to call the External API directly:

const response = await fetch('https://api.zenovay.com/api/external/v1/analytics/WEBSITE_ID', {
  headers: {
    'X-API-Key': 'zv_YOUR_API_KEY',
  },
});
const data = await response.json();

Python (using requests)

import requests

response = requests.get(
    'https://api.zenovay.com/api/external/v1/analytics/WEBSITE_ID',
    headers={'X-API-Key': 'zv_YOUR_API_KEY'}
)
data = response.json()

Common Use Cases

Custom Dashboards

Build internal dashboards:

  • Fetch aggregated metrics
  • Create custom visualizations
  • Combine with other data

Data Warehouse Sync

Export to your warehouse:

  • Schedule regular exports
  • Incremental syncs
  • Full historical export

Automated Reporting

Generate custom reports:

  • Weekly stakeholder reports
  • Real-time alerts
  • Threshold monitoring

CRM Integration

Connect to your CRM:

  • Push visitor data
  • Update contact records
  • Trigger workflows

Rate Limits

External API rate limits are per API key, per minute:

PlanRequests/MinuteMonthly Limit
Free101,000
Pro3010,000
Scale60100,000
Enterprise1201,000,000

Rate Limit Headers

Every response includes usage headers:

X-RateLimit-Limit: 30
X-RateLimit-Remaining: 27
X-Usage-Monthly: 4521
X-Usage-Limit: 10000
X-Usage-Reset: 2025-02-01T00:00:00Z

See Rate Limits for best practices.

Best Practices

Efficient Requests

  • Request only needed fields
  • Use date filters
  • Paginate large results
  • Cache when possible

Error Handling

  • Implement retries
  • Handle rate limits
  • Log errors
  • Monitor success rates

Security

  • Keep keys secret
  • Use minimal permissions
  • Rotate keys regularly
  • Audit key usage

Testing

Use a test API key with production endpoints:

  1. Go to API Keys in the sidebar
  2. Create a key with "Test" prefix for easy identification
  3. Use the standard API URL: https://api.zenovay.com/api/external/v1/
  4. Delete test keys when done

Support

Getting Help

Changelog

Track API changes:

  • docs.zenovay.com/api/changelog
  • Subscribe to updates

Next Steps

Was this article helpful?