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

# Introduction

> drain.lat gives you clean JSON data from social platforms, games, crypto, and more with one request.

# drain.lat

drain.lat is a data API built for developers who need public profile data fast. Point it at a username, get back structured JSON. Works across social platforms, games, crypto markets, and more.

## Base URL

```
https://drain.lat
```

All endpoints live under `/api/v1/`.

## Getting an API Key

Sign in at [drain.lat/dashboard](https://drain.lat/dashboard) using Discord. A key is generated automatically on first login. You can view, copy, and regenerate it from the dashboard.

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

You can also use the `Authorization` header with Bearer token:

```http theme={null}
Authorization: Bearer YOUR_API_KEY
```

<Warning>
  Keep your key private. Don't paste it in public repos or client-side code.
</Warning>

## Errors

All errors come back as JSON with a single `error` field.

```json theme={null}
{
  "error": "message here"
}
```

| Code  | Meaning                                     |
| ----- | ------------------------------------------- |
| `200` | Success                                     |
| `400` | Bad request - missing or invalid parameters |
| `401` | Invalid or missing API key                  |
| `404` | User or resource not found                  |
| `429` | Rate limited - retry after 60 seconds       |
| `500` | Server error                                |

### Common Error Examples

```json theme={null}
// Missing parameter
{
  "error": "Query parameter required"
}

// Invalid API key
{
  "error": "Invalid API key"
}

// Resource not found
{
  "error": "Package not found"
}

// Rate limited
{
  "error": "Rate limited. Retry after 60s"
}
```

## Rate Limits

Global rate limit: **100 requests per 15 minutes** per API key. Individual endpoints may have additional caching (10-30 minutes) to improve performance and reduce load.

If you get a `429`, wait a few seconds and retry. Need higher limits? Join the [Discord](https://discord.gg/socialapi).

## Status

No auth needed for this one.

```
GET /api/v1/status
```

```json theme={null}
{
  "status": "ok",
  "uptime": 99.98,
  "memory": "312 MB",
  "platforms": ["roblox", "github", "twitter", "tiktok", "instagram", "snapchat", "twitch", "steam", "youtube", "valorant", "crypto", "screenshot"],
  "cacheEntries": 1482
}
```

## Platforms

<CardGroup cols={3}>
  <Card title="Roblox" icon="gamepad" href="/api-reference/roblox">
    Profile, games, friends
  </Card>

  <Card title="GitHub" icon="github" href="/api-reference/github">
    Profile, repos, followers, orgs
  </Card>

  <Card title="Twitter / X" icon="twitter" href="/api-reference/twitter">
    Profile, stats, search, bulk
  </Card>

  <Card title="TikTok" icon="tiktok" href="/api-reference/tiktok">
    Profile, videos
  </Card>

  <Card title="Instagram" icon="instagram" href="/api-reference/instagram">
    Profile, posts
  </Card>

  <Card title="Snapchat" icon="snapchat" href="/api-reference/snapchat">
    Public profile
  </Card>

  <Card title="Twitch" icon="twitch" href="/api-reference/twitch">
    Channel and live status
  </Card>

  <Card title="Steam" icon="steam" href="/api-reference/steam">
    Profile, game library
  </Card>

  <Card title="YouTube" icon="youtube" href="/api-reference/youtube">
    Channel, videos, search
  </Card>

  <Card title="Valorant" icon="crosshairs" href="/api-reference/valorant">
    Account, MMR, matches
  </Card>

  <Card title="Crypto" icon="bitcoin" href="/api-reference/crypto">
    Prices, markets, charts, trends
  </Card>

  <Card title="Screenshot" icon="camera" href="/api-reference/screenshot">
    Webpage screenshots
  </Card>

  <Card title="Image Search" icon="image" href="/api-reference/imagesearch">
    Google image search
  </Card>

  <Card title="Google Search" icon="magnifying-glass" href="/api-reference/googlesearch">
    Web search results
  </Card>

  <Card title="Sparked.lol" icon="sparkles" href="/api-reference/sparked">
    Profile, links, badges
  </Card>

  <Card title="OnlyFans" icon="user-lock" href="/api-reference/onlyfans">
    Profile information
  </Card>

  <Card title="NPM" icon="node-js" href="/api-reference/npm">
    Node.js packages
  </Card>

  <Card title="PyPI" icon="python" href="/api-reference/pypi">
    Python packages
  </Card>

  <Card title="Crates.io" icon="rust" href="/api-reference/crates">
    Rust crates
  </Card>

  <Card title="Packagist" icon="php" href="/api-reference/packagist">
    PHP packages
  </Card>

  <Card title="Genius" icon="music" href="/api-reference/genius">
    Song lyrics
  </Card>

  <Card title="Pornhub" icon="video" href="/api-reference/pornhub">
    Video information
  </Card>
</CardGroup>
