Skip to main content

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.

Twitter / X

Base URL: https://drain.lat/api/v1/twitter All endpoints require the x-api-key header.
Twitter endpoints use Puppeteer to scrape data. First requests may be slower than usual.

GET /profile/:username

Fetch a Twitter/X public profile. Endpoint
GET /api/v1/twitter/profile/:username
curl "https://drain.lat/api/v1/twitter/profile/elonmusk" \
  -H "x-api-key: YOUR_API_KEY"
Response
{
  "name": "Elon Musk",
  "username": "elonmusk",
  "bio": "Mars & Cars, Chips & Doge",
  "followers": "219.4M",
  "following": "1,012",
  "posts": "47.2K",
  "verified": true,
  "profileImage": "https://pbs.twimg.com/profile_images/...",
  "bannerImage": "https://pbs.twimg.com/profile_banners/...",
  "location": "",
  "website": "",
  "joinedDate": "Joined June 2009",
  "scrapedAt": "2026-05-05T12:00:00.000Z"
}

GET /profile/:username/stats

Get just the key stats for a Twitter user - faster than the full profile. Endpoint
GET /api/v1/twitter/profile/:username/stats
curl "https://drain.lat/api/v1/twitter/profile/elonmusk/stats" \
  -H "x-api-key: YOUR_API_KEY"
Response
{
  "username": "elonmusk",
  "followers": "219.4M",
  "following": "1,012",
  "posts": "47.2K",
  "verified": true,
  "joinedDate": "Joined June 2009",
  "scrapedAt": "2026-05-05T12:00:00.000Z"
}

GET /search

Search for Twitter users by keyword. Endpoint
GET /api/v1/twitter/search?q=query
ParameterTypeRequiredDescription
qstringYesSearch query
curl "https://drain.lat/api/v1/twitter/search?q=nasa" \
  -H "x-api-key: YOUR_API_KEY"
Response
[
  {
    "name": "NASA",
    "username": "NASA",
    "bio": "Explore the universe and discover our home planet.",
    "verified": true,
    "profileImage": "https://pbs.twimg.com/profile_images/..."
  }
]
Returns up to 10 results per search query.

POST /bulk/profiles

Fetch multiple Twitter profiles in a single request. Endpoint
POST /api/v1/twitter/bulk/profiles
Request Body
{
  "usernames": ["elonmusk", "nasa"]
}
curl -X POST "https://drain.lat/api/v1/twitter/bulk/profiles" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"usernames": ["elonmusk", "nasa"]}'
Response
[
  {
    "username": "elonmusk",
    "success": true,
    "data": {
      "name": "Elon Musk",
      "username": "elonmusk",
      "followers": "219.4M",
      "verified": true
    }
  },
  {
    "username": "nasa",
    "success": true,
    "data": {
      "name": "NASA",
      "username": "NASA",
      "followers": "98.2M",
      "verified": true
    }
  }
]
Maximum 5 usernames per request. Profiles are fetched sequentially, so larger batches will take longer to respond.