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

# Introduction to REST API

> Comprehensive overview of Scrapest REST API endpoints

The Scrapest REST API provides programmatic access to X, Discord, Telegram, Web, and RSS data, webhooks, tracking management, web scraping, and real-time streaming capabilities.

## API Overview

### Base URL

```
https://scrape.st
```

### Authentication

All API requests (except public endpoints) require authentication using an API key passed in the header:

```http theme={null}
x-api-key: YOUR_API_KEY
```

### Response Format

All responses follow a consistent JSON format:

**Success**

```json theme={null}
{
  "data": { ... },
  "message": "Operation description"
  [key: string]: unknown
}
```

**Validation Error (422)**

```json theme={null}
{
  "status": "fail",
  "error": "Validation failed",
  "issues": [...]
}
```

**General Error**

```json theme={null}
{
  "status": "error",
  "error": "Error description"
}
```

## Available API Categories

* **Webhooks** — Configure endpoints for real-time event delivery [View docs](./create-webhook)
* **Tracking** — Monitor X, Discord, Telegram, Web, and RSS sources [View docs](./create-tracking)
* **X Queries** — Query X user and tweet data [View docs](./user-information)
* **Telegram Queries** — Search Telegram messages, users, and channels [View docs](./telegram-global-search)
* **Web Queries** — Scrape, crawl, map, and search the web [View docs](./web-scrape)
* **API Keys** — Usage stats and key rotation [View docs](./api-key-stats)
* **Health & Metrics** — System health and latency percentiles [View docs](../health/health-endpoints)
* **Backfill** — Trigger and retrieve historical data [View docs](./backfill/trigger)
* **Streams** — WebSocket and SSE for real-time data [View docs](../streams/introduction)

## Source Guides

For per-source setup guides with examples, see:

* **[X](../sources/x)** — Track users, search tweets, token mentions
* **[Telegram](../sources/telegram)** — Monitor groups & channels, token mentions
* **[Discord](../sources/discord)** — Track servers, token mentions
* **[Web](../sources/web)** — Track websites, scrape web pages
* **[RSS](../sources/rss)** — Monitor RSS feeds for new content

## Getting Started

### 1. Get Your API Key

1. Sign up at [Scrapest Dashboard](https://admin.scrape.st)
2. Navigate to API Keys section
3. Generate a new API key
4. Copy and securely store your API key

### 2. Make Your First Request

```bash theme={null}
curl -X GET https://scrape.st/health \
  -H "x-api-key: YOUR_API_KEY"
```

### 3. Explore Endpoints

* **Webhooks**: [Create your first webhook](./create-webhook)
* **Tracking**: [Set up data tracking](./create-tracking)
* **X Queries**: [Query X data](./user-information)

## Common Patterns

### Pagination

List endpoints support pagination with `page` and `limit` query parameters:

```http theme={null}
GET /track/x?page=1&limit=20
```

Response includes metadata:

```json theme={null}
{
  "data": [...],
  "total": 150,
  "page": 1,
  "limit": 20,
  "message": "..."
}
```

### Filtering

Many endpoints support filtering:

```http theme={null}
GET /track/x?messageId=abc123
```

### Error Handling

Errors return appropriate HTTP status codes:

| Status | Description           |
| ------ | --------------------- |
| 200    | Success               |
| 400    | Bad Request           |
| 401    | Unauthorized          |
| 422    | Validation Error      |
| 500    | Internal Server Error |

***

*For streaming capabilities, see the [Streams](../streams/introduction) documentation.*
