API Direct
Endpoints
Twitter Posts

Twitter Posts

GET /v1/twitter/posts
Documentation

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.

Cost
$0.006 per page
Free tier
50 requests/month

Parameters

query *
Search keyword (max 500 characters)
pages
Number of pages to fetch, 1-10 (default: 1)
sort_by
Sort order: most_recent or relevance (default: most_recent)
get_sentiment
Set to true to add AI emotion analysis (+$0.001/page)

Example Request

curl "https://apidirect.io/v1/twitter/posts?query=AI&pages=2&sort_by=most_recent" \
  -H "X-API-Key: YOUR_API_KEY"

Example Response

{
  "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"],
      "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
}

Your Usage

Free tier this month
Loading...
Recent Activity