REST API Introduction

The DataSaaS REST API gives you programmatic access to your analytics data — visitors, pageviews, revenue, goals, funnels, and more. Use it to build custom dashboards, feed data into BI tools, or integrate analytics into your workflows.

Quick start

Get up and running in 3 steps:

  1. Go to Settings → API and create an API key
  2. Copy your key (you'll only see it once)
  3. Make your first request:
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://datasaas.co/api/v1/overview?site_id=ds_abc123&start=2026-03-01&end=2026-03-26"

Authentication

All API requests require a Bearer token in the Authorization header:

Authorization: Bearer ds_live_a1B2c3D4e5F6g7H8i9J0k1L2m3N4o5P6

API keys are created in your website's Settings → API tab. Each key is scoped to a single website and has either Read only or Read & Write permissions.

Warning

Treat your API key like a password. Never expose it in client-side code, public repositories, or shared environments.

Base URL

https://datasaas.co/api/v1

All endpoints are prefixed with /api/v1. The version number will only change for breaking changes.

Common parameters

Most analytics endpoints accept these query parameters:

ParameterTypeRequiredDescription
site_idstringYesYour website identifier (e.g., ds_abc123)
startstringNoISO 8601 start date. Defaults to 30 days ago
endstringNoISO 8601 end date. Defaults to now
timezonestringNoIANA timezone (e.g., America/New_York). Defaults to UTC
limitnumberNoNumber of results, 1-1000. Defaults to 100
offsetnumberNoPagination offset. Defaults to 0

Filtering

Filter results using bracket syntax on query parameters. Each filter specifies a dimension, an operator, and a value:

# Visitors from the US using Chrome
?country[is]=United States&browser[is]=Chrome

# Pages containing "/blog" but not from Safari
?pathname[contains]=/blog&browser[is_not]=Safari
OperatorDescription
isExact match
is_notExclude exact match
containsSubstring match (case-insensitive)
not_containsExclude substring match

Available dimensions: country, region, city, browser, os, device_type, referrer, pathname, hostname, utm_source, utm_medium, utm_campaign, utm_term, utm_content, channel

Rate limits

API requests are rate-limited per API key:

Endpoint typeLimit
Read endpoints (breakdowns, lists)3,000 requests / hour
Aggregation queries (overview, timeseries)300 requests / hour
Write endpoints (goals, payments)600 requests / hour

Every response includes rate limit headers:

X-RateLimit-Limit: 3000
X-RateLimit-Remaining: 2847
X-RateLimit-Reset: 1711461600

When rate limited, you'll receive a 429 response with a Retry-After header indicating how many seconds to wait.

Response format

All successful responses use this envelope:

{
  "results": [ ... ],
  "meta": {
    "date_range": {
      "start": "2026-03-01T00:00:00.000Z",
      "end": "2026-03-26T23:59:59.000Z"
    },
    "timezone": "UTC",
    "limit": 100,
    "offset": 0,
    "count": 25
  }
}

Errors

Errors follow the RFC 9457 Problem Details format:

{
  "type": "https://datasaas.co/docs/errors/unauthorized",
  "status": 401,
  "title": "Unauthorized",
  "detail": "Missing or malformed Authorization header",
  "instance": "/api/v1/overview"
}
StatusDescription
400Missing required parameters or invalid values
401Missing, invalid, expired, or revoked API key
403Insufficient permissions (wrong scope or plan)
404Website or resource not found
429Rate limit exceeded
500Internal server error

Endpoint reference

Full documentation for each endpoint group:

SectionEndpoints
Analyticsoverview, timeseries, pages, entry-pages, exit-pages, referrers, channels, campaigns, countries, regions, cities, browsers, os, devices
Visitorsvisitor list, visitor profile, visitor journey
Goals & Revenuegoals list, create goal, goal completions, revenue overview, revenue timeseries, create payment
Realtimevisitor count, active visitor details
Funnelsfunnel list, funnel conversion data