POST

Twitter Search

/v1/twitter/search

Search for tweets by keywords, hashtags, mentions, or advanced filters. Returns recent or top tweets matching your query.

At least one search field (keywords, hashtags, phrases, from_users, mentions, or cashtags) is required. Each filled group generates a separate query -- the limit applies per query.

Request Parameters

ParameterTypeRequiredDescription
keywordsstring[]No*Search keywords
hashtagsstring[]No*Hashtags (without #)
phrasesstring[]No*Exact phrases
from_usersstring[]NoTweets from specific users
to_usersstring[]NoTweets directed to users
mentionsstring[]NoTweets mentioning users
cashtagsstring[]NoCashtags ($SYMBOL)
search_typestringNo"top" or "recent" (default: top)
limitintNoMax results (1-100) (default: 20)
min_favesintNoMinimum likes filter
min_retweetsintNoMinimum retweets filter
min_repliesintNoMinimum replies filter
sincestringNoStart date (YYYY-MM-DD)
untilstringNoEnd date (YYYY-MM-DD)
langstringNoLanguage code (en, es, fr...)
exclude_repliesboolNoExclude reply tweets (default: false)

Example

curl -X POST https://query-data-api.notpeople.ai/v1/twitter/search \
  -H "X-API-Key: tw_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "keywords": ["AI agents"],
    "min_faves": 100,
    "search_type": "top",
    "limit": 5
  }'

Response Schema

All responses include success, data, and usage fields.

FieldTypeDescription
metadata.urlstringSearch URL used
metadata.querystringSearch query string
metadata.search_typestringSearch type used (top or recent)
metadata.posts_foundintNumber of posts returned
metadata.elapsed_msintRequest duration in milliseconds
metadata.type_breakdownobjectCount of posts by type (tweet, retweet, reply, quote)
metadata.with_mediaintNumber of posts with media attached
metadata.with_reply_to_postintNumber of posts with linked reply context
post_idstringUnique tweet ID
user_idstringAuthor user ID
usernamestringAuthor handle
namestringAuthor display name
textstringTweet text content
created_atstringHuman-readable timestamp
timestampintUnix timestamp
post_typestringtweet | retweet | reply | quote
likes_countintNumber of likes
retweets_countintNumber of retweets
replies_countintNumber of replies
views_countintNumber of views
is_blue_verifiedboolAuthor verification status
profile_image_urlstringAuthor profile picture URL
reply_to_post_idstring | nullID of the post being replied to
reply_to_userstring | nullUsername of the user being replied to
reply_to_postobject | nullFull post object being replied to
is_pinnedboolWhether the post is pinned
mediaarrayAttached media [{type, url}]
quoted_postobject | nullQuoted tweet data if post_type is quote

Example Response

{
  "success": true,
  "metadata": {
    "url": "https://x.com/search?q=AI%20agents%20min_faves%3A100",
    "query": "AI agents min_faves:100",
    "search_type": "top",
    "posts_found": 1,
    "elapsed_ms": 5096,
    "type_breakdown": { "tweet": 1 },
    "with_media": 1,
    "with_reply_to_post": 0
  },
  "data": [
    {
      "post_id": "2036997818569957866",
      "user_id": "1536693901230321666",
      "username": "RoundtableSpace",
      "name": "0xMarioNawfal",
      "text": "EVERYTHING CLAUDE CODE JUST OPEN SOURCED...",
      "created_at": "Thu Mar 26 02:45:00 +0000 2026",
      "timestamp": 1774493100,
      "post_type": "tweet",
      "likes_count": 151,
      "retweets_count": 24,
      "replies_count": 20,
      "is_blue_verified": true,
      "profile_image_url": "https://pbs.twimg.com/profile_images/.../photo.jpg",
      "views_count": 50217,
      "reply_to_post_id": null,
      "reply_to_user": null,
      "reply_to_post": null,
      "is_pinned": false,
      "media": [
        { "type": "photo", "url": "https://pbs.twimg.com/media/.../photo.jpg" }
      ],
      "quoted_post": null
    }
  ],
  "usage": {
    "unique_posts": 81,
    "limit": 6000,
    "remaining": 5919
  }
}

Try this endpoint live

Sign up for free to try endpoints directly from the docs. No credit card required.

Create Free Account