# X (Twitter) search API for your agent

X (Twitter) search API for an agent: it sends a search query with optional operators to a catalog endpoint and reads post text, author and likes back. Several providers sell the call, so the agent tries the cheapest first. You pay per call, and a failed call costs nothing.

## What this does

X search finds what people are saying, with the operators power users know: from:, since:, until: and a minimum like count. Your agent sends the query and reads back the posts with their text, author and engagement. It is the base for brand monitoring, customer research and finding the posts worth replying to.

Three providers answer. One accepts the full advanced-search syntax inline and returns about 20 posts per page. One takes the filters as separate fields: exact phrase, any of these words, from these accounts, language, media type and a minimum of likes or replies. One takes a keyword and a search type.

You give: a search query with optional operators. Example: claude code min_faves:50.

## What differs between providers

- AnyAPI (anyapi-run-twitter-search): accepts the full X advanced-search syntax in the query, returns posts with text, author and engagement, and pages with a cursor.
- Any Site API (anysite-api-twitter-search-posts): takes separate filters for exact phrase, any of these words, accounts, language, media type and minimum likes or replies, and bills per result.
- TikHub (tikhub-api-twitter-web-fetch-search-timeline): takes a keyword and a search type and pages with a cursor.

## Before you start

- Write the query with operators. Bare terms match broadly, and from:, min_faves: and a date window cut a search to the posts that matter.
- Page with a cursor. A page holds about 20 posts on one provider, and a longer pull means several calls.
- Be careful with replies. A search that mixes posts and replies is noisy, so use the media and engagement filters.

## Prompt

Use looot to search X for claude code min_faves:50 over the last month, and return the text, author, likes and link of each post. 1. Set up https://looot.ai/skill.md. 2. Search the catalog for each step and check its price before you call. 3. Run the cheapest endpoint that fits. 4. Show the results as a table and the total cost.

## Steps and providers

- Search posts on X: anyapi, anysite, tikhub. 1 call per search.

## What comes back

- Post text
- Author
- Likes, replies and reposts
- Post date
- Post link

## The request and what comes back

Each run is one POST to /v1/runs with an endpoint id and an input. These are illustrative calls with generic values. The run's result holds the provider's own fields.

- AnyAPI: {"endpointId":"anyapi-run-twitter-search","input":{"query":"claude code min_faves:50","limit":20},"wait":30}
- Any Site API: {"endpointId":"anysite-api-twitter-search-posts","input":{"exact_phrase":"claude code","min_likes":50,"count":20},"wait":30}

## What can I do with the results?

Find the posts worth a reply, follow mentions of a brand and collect the questions people ask. Your agent keeps the post link as the source.

## How do I search X posts through an API?

Send a query to an X search endpoint. Your agent reads the posts as JSON with the text, the author and the engagement, and pages with a cursor.

## Can I use advanced search operators?

Yes, on one provider that accepts the full syntax inline, including from:, since:, until: and min_faves:. The others take the same filters as separate fields.

## Can I search a single account's posts?

Yes. Use the from: operator, or the from-these-accounts filter on the provider that has one. The catalog also has user-timeline endpoints for the full feed of an account.

## How many posts come back per call?

About 20 per page on one provider. Your agent follows the cursor to fetch more, and each page is billed as a call.

## How much does one search cost?

You pay per call, and the price depends on the provider your agent picks. This page reads the cheapest live price from the catalog and shows no number when the catalog is unreachable.

## Do I pay when a x (twitter) search call fails?

No. A call that fails at the provider costs nothing, and your agent can retry it or send it to another provider.

## Do I need an account with each x (twitter) search provider?

No. One looot key reaches every provider in the catalog. You top up once, and each call is billed at the price shown before it runs.

## How do I call x (twitter) search from code?

Send a POST to /v1/runs with the endpoint id, the input and a new idempotency key, and your looot token in the Authorization header. With wait set to 30, the answer comes back in the response when the run ends within 30 seconds. Otherwise poll GET /v1/runs/<runId>.

## Can I run x (twitter) search on a schedule?

That needs scheduled runs, not available yet. Run it by hand whenever you want fresh results.

## Do I pay while my agent is idle?

No. looot bills per call, and nothing runs while your agent is idle.

## Related pages

- /use-cases/reddit-search-api
- /use-cases/linkedin-post-search-api
- /use-cases/find-creators-by-keyword

## Last reviewed

2026-10-04. The cost per 1,000 search runs is read live from the catalog on the web page.
