API Reference

Complete reference for SiteTooling.space APIs, including tracking scripts, analytics display, and REST endpoints for programmatic access.

Quick Access

Authentication

API Authentication Methods

Tracking Token

Used for client-side tracking scripts. Public and safe to expose in frontend code.

data-token="st_live_1234567890abcdef"

API Key (Secret)

Used for server-side REST API calls. Keep secret and never expose in frontend code.

Authorization: Bearer st_secret_abcdef1234567890

Security Best Practices

Never expose your secret API key in client-side code. Use tracking tokens for frontend scripts and API keys only for server-side requests.

Rate Limits

All API endpoints are rate limited to ensure fair usage and system stability.

1000/min
Tracking requests per website
100/min
Analytics API calls
60/min
REST API endpoints
10/hour
Data export requests

Rate Limit Headers

All API responses include rate limit information in headers:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1640995200

Response Formats

Success Response

All successful API responses follow this format:

{
  "success": true,
  "data": {
    "page_views": 1250,
    "unique_visitors": 892
  },
  "meta": {
    "timestamp": "2024-01-15T10:30:00Z",
    "version": "1.0"
  }
}

Error Response

Error responses include detailed error information:

{
  "success": false,
  "error": {
    "code": "INVALID_TOKEN",
    "message": "The provided token is invalid",
    "details": "Token must start with 'st_'"
  },
  "meta": {
    "timestamp": "2024-01-15T10:30:00Z",
    "request_id": "req_123456789"
  }
}

SDKs & Libraries

Official SDKs Coming Soon

We're working on official SDKs to make integration even easier. Currently, all APIs are accessible via standard HTTP requests.

🟡
JavaScript
In Progress
🟡
Python
In Progress
⚪
Node.js
Planned
⚪
PHP
Planned

Endpoint Overview

Tracking Endpoints

POST/api/track
Record page view or custom event
GET/track.js
Tracking script (1.2KB gzipped)

Analytics Endpoints

GET/api/analytics
Get aggregated analytics data
GET/analytics.js
Analytics display script

Management Endpoints

POST/api/register
Register new website
GET/api/websites
List registered websites
GET/api/export
Export analytics data

Getting Started

Choose your integration method

Select the approach that best fits your needs:

📊 Display Analytics

🔧 Custom Integration

Need help with API integration? Contact our support team for technical assistance.