Welcome to ApiTraffic API

The ApiTraffic API provides programmatic access to your API monitoring data, configuration, and analytics. Our REST API is designed to be simple, predictable, and easy to integrate with your existing workflows.

Base URL

https://api.apitraffic.io/v1

Authentication

All API requests require authentication using your API token. Include your token in the Authorization header:
curl -H "Authorization: Bearer your-api-token" \
  https://api.apitraffic.io/v1/buckets

Rate Limiting

API requests are rate limited to ensure fair usage:
  • Standard Plan: 1,000 requests per hour
  • Pro Plan: 10,000 requests per hour
  • Enterprise Plan: Custom limits
Rate limit headers are included in all responses:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1640995200

Response Format

All API responses are returned in JSON format:
{
  "success": true,
  "data": {
    // Response data
  },
  "meta": {
    "page": 1,
    "limit": 50,
    "total": 100
  }
}

Error Handling

Errors are returned with appropriate HTTP status codes and descriptive messages:
{
  "success": false,
  "error": {
    "code": "INVALID_TOKEN",
    "message": "The provided API token is invalid",
    "details": {}
  }
}

Common Error Codes

CodeDescription
INVALID_TOKENAPI token is missing or invalid
RATE_LIMIT_EXCEEDEDToo many requests
RESOURCE_NOT_FOUNDRequested resource doesn’t exist
VALIDATION_ERRORRequest validation failed
INTERNAL_ERRORServer error occurred

Pagination

List endpoints support pagination using page and limit parameters:
curl "https://api.apitraffic.io/v1/requests?page=2&limit=25" \
  -H "Authorization: Bearer your-api-token"

Filtering and Sorting

Many endpoints support filtering and sorting:
# Filter by date range
curl "https://api.apitraffic.io/v1/requests?start_date=2023-01-01&end_date=2023-01-31" \
  -H "Authorization: Bearer your-api-token"

# Sort by timestamp
curl "https://api.apitraffic.io/v1/requests?sort=timestamp&order=desc" \
  -H "Authorization: Bearer your-api-token"

SDKs and Libraries

Official SDKs are available for popular languages:
  • Node.js: @apitraffic/node-sdk
  • Python: apitraffic-python
  • PHP: apitraffic/php-sdk
  • Go: github.com/apitraffic/go-sdk

Getting Started

  1. Get your API token
  2. Make your first API call
  3. Explore the available endpoints
  4. Integrate with your applications