X

Search public X posts with composable filters

Searches public X (Twitter) posts by keyword, phrase, account, hashtag, language, date and engagement. Every filter narrows the result, and at least one of query, phrase, hashtags, fromUsers, toUsers, mentions, listId, or quotedPostId is required. Paginate with meta.nextCursor. Billed per post returned.

post/v1/x/search

Request

  • Base URL: https://api.weirapp.io
  • URL: https://api.weirapp.io/v1/x/search
  • Auth: HTTP bearer

Request body

querystring

Words that must all appear, in any order. X search operators pass through as typed, so filters without a field of their own work here: filter:media, url:example.com, conversation_id:123, -filter:replies.

phrasestring

An exact phrase that must appear.

anyWordsstring[]

At least one of these words must appear.

excludeWordsstring[]

None of these words may appear.

hashtagsstring[]

Any of these hashtags, with or without the #.

fromUsersstring[]

Posted by any of these usernames.

toUsersstring[]

Replying to any of these usernames.

mentionsstring[]

Mentioning any of these usernames.

languagestring

Language X detected, as a BCP-47 tag such as en.

minLikesinteger
minRepliesinteger
minRepostsinteger
onlyLinksboolean

Only posts containing a link.

onlyOriginalboolean

Exclude replies.

onlyRepliesboolean

Only replies.

onlyTextboolean

Exclude posts with links.

sincestring date-time

Posted at or after this instant (UTC).

untilstring date-time

Posted before this instant (UTC).

quotedPostIdstring

Only posts quoting this post. getXQuotes is the dedicated endpoint for this.

listIdstring

Only posts by members of this public List.

sinceIdstring

Only posts newer than this post id, exclusive. The way to resume a feed: pass the newest id already seen.

untilIdstring

Only posts older than this post id, exclusive.

sort'latest' | 'top'

latest is newest first; top is X's own engagement ranking.

limitinteger

Most posts to return. X serves about 20 per page at most.

cursorstring

Opaque cursor from the previous page's meta.nextCursor. Pass it back unchanged, with the same path and query parameters; a cursor from another request is rejected with 400.

Example request

{
  "query": "launch"
}

Response

X posts, in X's own field names.

Changes

No recorded changes to this operation across all 1 revision of this API.