POST/v1/data/twitter/search

Twitter Search

Search Twitter/X for tweets matching keywords, hashtags, or @mentions. Supports enrichment with full tweet data (metrics, media, author). Enrichment adds ~2-4s but provides complete data.

Target Latency

1.2s - 4.5s

Credits

2 cr/req

Parameters

NameTypeRequirementDescription
querystringREQUIREDSearch query: keywords, hashtags, @mentions, phrases. 1-500 characters.
limitnumberoptionalMaximum tweet results (1-50).
enrichbooleanoptionalFetch full tweet data (metrics, media, author). Adds ~2-4s latency.

cURL Example

curl -X POST "https://api.datablue.dev/v1/data/twitter/search" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "#webdev OR #python web scraping",
  "limit": 10,
  "enrich": true
}'

System Responses

200 OK

Request processed successfully.

401 UNAUTHORIZED

Missing or invalid API key.

429 RATE LIMIT

System capacity exceeded.

500 SYSTEM FAILURE

Internal core exception.

EXAMPLE RESPONSE
{
  "success": true,
  "time_taken": 4.12,
  "query": "#webdev OR #python web scraping",
  "count": 10,
  "enriched": true,
  "results": [
    {
      "id": "1907765432109876543",
      "text": "Just built a web scraper using Python and Playwright that handles JavaScript-heavy sites beautifully. #python #webdev",
      "created_at": "2026-04-03T10:00:00Z",
      "likes": 450,
      "retweets": 89,
      "replies": 23,
      "quotes": 12,
      "views": 34000,
      "lang": "en",
      "url": "https://x.com/dev_sarah/status/1907765432109876543",
      "author": {
        "username": "dev_sarah",
        "name": "Sarah Developer",
        "verified": false
      },
      "media": [],
      "hashtags": [
        "python",
        "webdev"
      ],
      "urls": []
    }
  ]
}