Skip to content

Search X posts

POST/v1/tools/x.search.posts/callsNeeds an API key

Returns the X posts that match a search, from the top, latest or media tab, with author and engagement counts. Use it to follow the conversation on a topic.

Tool x.search.posts on X (Twitter). Contract version 1, released 2026-10-27.

Over REST, send the input in the body. Over MCP, pass the same input to call_tool.

Both return the full response: the call's ID, status and cost, with this tool's result in output.

Input

querystringRequired

The search query. X matches more than a post's text, such as the post it quotes, a linked article or its media, so a post may not contain the query's words.

tabstring· default top

Which tab of X's search results to read: top (X's ranking), latest or media (posts with photos or videos).

top
latest
media
next_page_tokenstring

Fetches the next page. Take it from pagination.next_page_token of the previous page, and send the same query and tab.

Output

A successful call returns these blocks in its output. A field not marked required can be null.

posts

A list of rows. Always present, possibly empty.

idstringRequired

X's identifier of the post. The post is at https://x.com/i/status/ followed by it.

urlstring

Address of the post on x.com.

Format uri.

textstring

What the post says, links written as X's t.co short links.

published_atstring

When the post was published, in ISO 8601.

author_idstring

X's numeric identifier of the author, as a string.

author_usernamestring

The author's handle, without the @.

author_namestring

The author's display name.

author_image_urlstring

Address of the author's profile picture.

author_follower_countinteger
reply_countinteger
repost_countinteger
quote_countinteger
like_countinteger
bookmark_countinteger
view_countinteger

Number of times the post was seen.

conversation_idstring

Identifier of the post that opened the thread; the post's own id when it opened it.

in_reply_to_post_idstring

Identifier of the post this one replies to.

in_reply_to_usernamestring

Handle of the author this post replies to, without the @.

sensitiveboolean

Whether X marks the post as possibly sensitive.

quoted_post_idstring

Identifier of the post this one quotes.

quoted_post_textstring
quoted_post_author_usernamestring
hashtagsarray of string

Each hashtag in the text, without the

mentioned_usernamesarray of string

Handle of each account the text mentions, without the @.

link_urlsarray of string

Full address of each link in the text.

image_urlsarray of string

Address of each photo attached to the post.

videosarray of object

Each video attached to the post.

videos.preview_image_urlstringRequired

Address of the video's still image.

videos.duration_msinteger

Length of the video, in milliseconds.

videos.widthinteger

Width of the original video, in pixels.

videos.heightinteger

Height of the original video, in pixels.

pagination

One object. Can be null. How to fetch the next page. Null on the last page.

next_page_tokenstringRequired

Send as next_page_token to fetch the next page.