Twitter API

Twitter API Reference

Access Twitter data through our unified API. 40 endpoints covering tweets, users, lists, communities, trends, and geographic data.

40
Endpoints
6
Categories
REST
Protocol
JSON
Format

Base URL

https://api.scrapebadger.com/v1/twitter

All Twitter API endpoints are prefixed with this base URL. Authentication is required for all requests.

Common Patterns

Pagination

Most list endpoints support cursor-based pagination. The response includes a next_cursor field that you can pass to the cursor parameter to fetch the next page.

// First request
GET /users/elonmusk/followers

// Response includes next_cursor
{ "data": [...], "next_cursor": "abc123" }

// Next page request
GET /users/elonmusk/followers?cursor=abc123

Error Handling

All errors return a JSON object with a detail field describing the error.

// Error response format
{
  "detail": "User not found"
}

Rate Limits

Rate limits vary by endpoint type. Most endpoints allow 180 requests per 15 minutes, while follower/following endpoints allow 15 requests per 15 minutes. If you exceed the limit, the API will return a 504 Gateway Timeout.