Search Twitter/X posts by keyword. Returns tweet content, engagement metrics (likes, retweets, replies, views, bookmarks), author metadata, and publication date. Supports fetching multiple pages of results in a single API call, and filtering by time window or date range.
curl "https://apidirect.io/v1/twitter/posts?query=AI&pages=2&sort_by=most_recent" \
-H "X-API-Key: YOUR_API_KEY"
{
"posts": [
{
"title": "@username on X",
"url": "https://twitter.com/username/status/...",
"date": "2024-01-15 14:30:00",
"author": "username",
"source": "Twitter (X)",
"domain": "x.com",
"snippet": "Tweet content here...",
"likes": 142,
"retweets": 38,
"replies": 12,
"quotes": 5,
"bookmarks": 23,
"views": 18420,
"author_followers": 5243,
"author_verified": false,
"lang": "en",
"is_reply": false,
"is_quote": false,
"hashtags": ["AI", "MachineLearning"],
"user_mentions": ["OpenAI"],
"ai_label": {"has_ai_generated_media": false, "detection_source": null},
"sentiment": {
"emotions": {
"joy": 40,
"trust": 55,
"fear": 0,
"surprise": 10,
"sadness": 0,
"disgust": 0,
"anger": 0,
"anticipation": 30
},
"dominant_emotion": "trust",
"emotional_intensity": 5,
"polarity": "positive"
}
}
],
"pages": 2,
"count": 40
}
The posts are sourced in real-time from Twitter's public search engine, so you can access tweets from the last few years up to the last few seconds.
Yes. Use posted_ago for a recent window (1h, 24h, 7d, 30d or 12m), or start_date and end_date (YYYY-MM-DD) for a date range. Both work with either sort order, so sort_by=relevance&posted_ago=24h returns the top posts from the past day.
Yes, the API includes posts, comments and replies. You can use the is_reply field to filter replies from original posts.
Each tweet includes likes, retweets, replies, quotes, bookmarks, and views. You also get author metadata like follower count and verification status. Views may be null for older tweets where this data is unavailable.
You only pay for successful requests. The Twitter Posts API costs $0.006 per page. There are no monthly fees or commitments. You get 50 free requests per endpoint every month.
No. You can sign up and use the free tier (50 requests/endpoint/month) without adding a payment method. You only need to add a card when you want to exceed the free tier.
Yes, there's a concurrency limit of 10 simultaneous requests per endpoint per user. If you need more, just get in touch.
Get your API key and start making requests in minutes. 50 requests/month free every month.
Get API Key