Search Twitter Posts
Search for tweets by keyword. Returns tweet content, author username, URL, publication date, engagement metrics (likes, retweets, replies, quotes, bookmarks, views), author info (follower count, verification), language, hashtags, and user mentions. Supports sorting by most recent or relevance, and filtering by time window (posted_ago) or date range (start_date, end_date). Fetch multiple pages in a single request.
Price: $0.006 per page. Free tier: 50 requests/month.
Request
- Base URL: https://apidirect.io
- URL: https://apidirect.io/v1/twitter/posts
- Auth: API key in header X-API-Key
Query parameters
Search query (max 500 characters). Supports X's search operators (https://help.x.com/en/using-x/x-advanced-search).
Number of pages to fetch and merge into one response (1-20, billed per page). Fetching stops early when there are no more results.
Sort order for results
Only return posts from this period: 1h (past hour), 24h (past day), 7d (past week), 30d (past month), or 12m (past year). Works with both sort orders. Omit for all time. Can't be combined with start_date or end_date. Any other value returns 400.
Only return posts from this date onward (YYYY-MM-DD, UTC). Can't be combined with posted_ago.
Only return posts up to and including this date (YYYY-MM-DD, UTC). Must not be earlier than start_date. Can't be combined with posted_ago.
Set to true to add AI emotion analysis to each post. Adds a sentiment object containing emotions (joy, trust, fear, surprise, sadness, disgust, anger and anticipation, each scored 0-100), dominant_emotion, emotional_intensity (0-10), and polarity (positive, negative or neutral). Any post that cannot be scored returns sentiment: null.
Response
Successful response
Changes
No recorded changes to this operation across all 1 revision of this API.