X (Twitter) Search Posts API
X's Top results for a keyword, with views and likes. 1 credit per successful call; errors and not-found answers are free. Answers are cached for 15 minutes, and a cached repeat costs nothing. The response uses the same field names as every other platform.
Request
GET /v1/twitter/search/posts
curl "https://scrapeio.com/v1/twitter/search/posts?query=coffee" \
-H "x-api-key: YOUR_KEY"Python
import requests
r = requests.get(
"https://scrapeio.com/v1/twitter/search/posts",
params={"query": "coffee"},
headers={"x-api-key": "YOUR_KEY"},
)
print(r.json()["data"])JavaScript
const url = new URL("https://scrapeio.com/v1/twitter/search/posts");
url.searchParams.set("query", "coffee");
const res = await fetch(url, { headers: { "x-api-key": "YOUR_KEY" } });
const { data } = await res.json();
console.log(data);Parameters
| Name | Type | Description |
|---|---|---|
query (required) | string | Search text. |
cursor | string | Cursor from the previous page's data.cursor. |
Response
Every answer has the same envelope: success, cached, credits_used, credits_remaining and data. Lists put rows in data.items and page with data.cursor and data.has_more; send the cursor back to get the next page. Shared fields such as handle, followers, plays, likes and created_at are named the same on every platform. Full reference in the X (Twitter) docs.
| Status | Meaning | Charged |
|---|---|---|
200 | Success | Yes, unless cached |
400 | A parameter is missing or wrong | No |
401 | The key is missing or invalid | No |
402 | Not enough credits | No |
403 | The account or post is private | No |
404 | Not found on the platform | No |
429 | More than 300 requests a minute | No |
502 | Every source is down; retry shortly | No |
Use it from an AI agent
Connect the ScrapeIO MCP server to Claude Code, Cursor, Codex or any MCP client and ask in plain English. The agent calls the twitter_search_posts tool and pays the same credits.
Questions
How much does the X (Twitter) Search Posts API cost?
1 credit per successful call, so $0.99 to $1.88 per 1,000 calls depending on the pack. Credits never expire and there is no subscription. New accounts get 100 free credits.
Do I need an official X (Twitter) API key or app approval?
No. Sign in, copy your ScrapeIO key and call the endpoint. It returns public X (Twitter) data only.
Are failed or empty calls charged?
No. Errors, private accounts, not-found answers and cached repeats cost nothing.
Is there a rate limit?
300 requests a minute per key. Answers that come back with 429 are not charged.
Can an AI agent call it?
Yes. Through the ScrapeIO MCP server the tool is named twitter_search_posts. It works in Claude Code, Cursor, Codex and any MCP client.
100 free credits, no card. Credits never expire.
Get API keyMore X (Twitter) endpoints
- X (Twitter) Profile API: X profile: bio, avatar, followers, following, post count.
- X (Twitter) User Tweets API: A profile's posts, newest first, with views, likes, reposts, replies and bookmarks.
- X (Twitter) Tweet API: One post by URL or id.
- X (Twitter) Replies API: Latest replies to a post.
- X (Twitter) Search API: Search X posts. X search operators work.
- X (Twitter) Trends API: Trending topics for a country.
- X (Twitter) Community API: An X community: name, description, topic, member count and rules.
- X (Twitter) Community Tweets API: Latest posts in an X community, with views and likes.
- X (Twitter) Tweet Transcript API: Transcript