> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apitraffic.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> REST API documentation for ApiTraffic platform

## 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:

```bash theme={null}
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:

```json theme={null}
{
  "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:

```json theme={null}
{
  "success": false,
  "error": {
    "code": "INVALID_TOKEN",
    "message": "The provided API token is invalid",
    "details": {}
  }
}
```

### Common Error Codes

| Code                  | Description                      |
| --------------------- | -------------------------------- |
| `INVALID_TOKEN`       | API token is missing or invalid  |
| `RATE_LIMIT_EXCEEDED` | Too many requests                |
| `RESOURCE_NOT_FOUND`  | Requested resource doesn't exist |
| `VALIDATION_ERROR`    | Request validation failed        |
| `INTERNAL_ERROR`      | Server error occurred            |

## Pagination

List endpoints support pagination using `page` and `limit` parameters:

```bash theme={null}
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:

```bash theme={null}
# 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](https://app.apitraffic.io/settings/api)
2. Make your first API call
3. Explore the available endpoints
4. Integrate with your applications
