TweetAPI Documentation
Access comprehensive X/Twitter data through our developer-friendly REST API.
Base URL
All API requests should be made to:
https://api.tweetapi.com/tw-v2/
Authentication
Include your API key in the X-API-Key header:
headers: {
'X-API-Key': 'YOUR_API_KEY'
}
Key Features
- Rich Data Access: Comprehensive user profiles, tweets, followers, and engagement metrics
- Interaction Capabilities: Post tweets, manage likes, retweets, bookmarks, and direct messages
- Advanced Search: Search tweets, users, and media with powerful filtering options
- Real-time Data: Get up-to-date metrics and engagement counts
- Efficient Pagination: Cursor-based pagination for seamless data retrieval
- Media Support: Full support for images, videos, and GIFs
Available Endpoints
User Endpoints
- Get user by username
- Get user by ID
- Get multiple users by IDs
- Followers and following lists
- User tweets and replies
- Subscription information
Tweet Endpoints
- Tweet details and conversation threads
- Quote tweets and retweets
- Tweet translation
- Engagement metrics
Interaction Endpoints
- Create, reply, and delete posts
- Like and bookmark tweets
- Retweet and quote tweet
- List management
List & Community Endpoints
- List details and members
- Community information
- Timeline tweets
Search Endpoints
- Search tweets, users, and media
- Advanced search operators
- Filtering and sorting options
Rate Limits
The v2 API has the following rate limits:
- Pro: 60 requests per minute
- Ultra: 120 requests per minute
- Mega: 180 requests per minute
Error Handling
TweetAPI uses standard HTTP status codes to indicate success or failure.
Common Error Codes
400s Errors
400
BAD_REQUESTBad Request - Invalid parameters401
UNAUTHORIZEDUnauthorized - Invalid API key404
NOT_FOUNDNot Found - Resource doesn't exist429
RATE_LIMITToo Many Requests - Rate limit exceeded500s Errors
500
INTERNAL_ERRORInternal Server ErrorError Response Format
All errors follow a consistent format:
{
"statusCode": 400,
"message": "Invalid username parameter"
}
Best Practices
- Always check the response status code
- Log error responses for debugging
- Implement exponential backoff for retries
- Handle rate limits gracefully
Security Best Practices
- Never share your API key publicly or commit it to version control
- Rotate your keys regularly for enhanced security
- Use environment variables to store API keys in your applications
- Monitor usage through your dashboard to detect any unusual activity
Support
If you need help or have questions:
- Email us at support@tweetapi.com
- Contact support at @tweetapi on Telegram
- Visit our status page for API availability