REST APIv1

API reference for analytics data access.

Query your website analytics programmatically, build internal dashboards, automate reporting, or feed traffic data into other tools without leaving the same privacy-first workflow.

Auth
Bearer token
Limit
5,000 req/hour
Access
Business plan
The docs below are structured as one reference surface, so you can move from auth to real requests without bouncing between cards.
Stable v1 namespace
Overview

Base URL

All REST endpoints are served from the same versioned namespace.

base
https://www.glancelytics.com/api/v1
Auth

Authentication

Pass your API key in the Authorization header as a bearer token.

http
Authorization: Bearer gl_live_xxxxxxxxxxxxxxxx
API access is available on the Business plan. Create and manage keys from your dashboard.
Limits

Rate limits

Requests are limited to 5,000 per hour. Response headers include the current window state so you can back off cleanly.

http
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
X-RateLimit-Reset: 1700829600
Routes

Endpoints

Start with traffic stats for a single website, then expand as more endpoints arrive.

GET
/stats/{websiteId}
Available now

Retrieve analytics data for a specific website across a selected time range.

websiteId
string, required
timeRange
Accepted values: 7d, 30d, or 90d. Defaults to 7d.
Request
bash
curl "https://www.glancelytics.com/api/v1/stats/clx123?timeRange=7d" \
  -H "Authorization: Bearer gl_live_xxx"
Response
json
{
  "success": true,
  "data": {
    "domain": "example.com",
    "totalViews": 15420,
    "uniqueToday": 142,
    "currentlyOnline": 8,
    "totalViewsChange": 12.5,
    "uniqueVisitorsChange": 8.3,
    "chartData": [
      { "date": "2024-11-17", "totalViews": 320, "uniqueVisitors": 180 }
    ],
    "topPages": [
      { "path": "/", "views": 1240 }
    ],
    "topReferrers": [
      { "referrer": "google.com", "views": 450 }
    ],
    "goalSummary": {
      "totalConversions": 86,
      "conversionRate": 5.6,
      "goals": [
        {
          "id": "goal_123",
          "name": "Signup Complete",
          "matchType": "exact",
          "path": "/signup/success",
          "isActive": true,
          "conversions": 48,
          "conversionRate": 3.1
        }
      ]
    }
  }
}
POST /websites
GET /websites
DELETE /websites/{id}
Errors

Errors

Error responses follow a consistent JSON shape.

json
{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or expired API key"
  }
}
401Invalid or missing API key
403Not on Business plan
404Website not found
429Rate limit exceeded
Examples

Examples

Start with a direct stats request in your language of choice.

JavaScript
javascript
const response = await fetch(
  'https://www.glancelytics.com/api/v1/stats/clx123?timeRange=7d',
  {
    headers: {
      'Authorization': `Bearer ${process.env.GLANCELYTICS_API_KEY}`
    }
  }
);

const { data } = await response.json();
console.log(data.totalViews);
Python
python
import requests

response = requests.get(
    'https://www.glancelytics.com/api/v1/stats/clx123',
    params={'timeRange': '7d'},
    headers={'Authorization': f'Bearer {api_key}'}
)

data = response.json()['data']
print(data['totalViews'])
Quick start

Quick start

The shortest path from dashboard access to a working request.

Step 01
Get an API key

Go to Dashboard → API Keys.

Step 02
Find your website ID

Use the ID shown in your dashboard URL, for example/dashboard/clx123....

Step 03
Make a request
bash
curl "https://www.glancelytics.com/api/v1/stats/YOUR_WEBSITE_ID" \
  -H "Authorization: Bearer YOUR_API_KEY"
Need help with the API, auth, or payload shapes? Contact support and we'll help you get the integration unstuck.