Call it
curl https://api.peume.com/v1/call/x-twitter-search-2 \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"query": "your query",
"queryType": "Latest"
}
}'const res = await fetch("https://api.peume.com/v1/call/x-twitter-search-2", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"query": "your query",
"queryType": "Latest"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/x-twitter-search-2",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"query": "your query",
"queryType": "Latest"
}
},
)
print(res.json()["output"])Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: x-twitter-search-2.
Parameters
cursorstringOpaque pagination cursor from a previous response's nextCursor. Omit for the first page; pass it to fetch the next page of search results. Pages can overlap: a page may repeat items an earlier page returned and is billed like any other, so de-duplicate by item id and stop when a page adds no new id. Neither an empty `items` nor a `nextCursor` is proof on its own: one source has returned an empty page for a query another answered with posts, and a source can return a `nextCursor` next to an empty page. An empty page is billed like any other, so stop paging at the first one; before reading an em
routestringUpstream source to run on; omit for "lynx". giraffe ($0.00046 per call, 96.6% uptime); bison ($0.00047 per call, 90.2% uptime); lynx ($0.00048 per call, 97.2% uptime); jackal ($0.00055 per call, 93% uptime); capybara ($0.0006 per call, 75.1% uptime); badger ($0.0021 per call, 76.1% uptime). A route can refuse an input it cannot apply with a 400 source_unknown (not charged): retry on another route, or omit that input. Route `badger` can fill a page with posts that hold only some of the query's words (a 6-word query returned 2 of 20 with all six, where `lynx` returned 9 of 9) and, with `Top`, po
giraffe · bison · lynx · jackal · capybara · badger
queryRequiredstringSearch query using advanced-search syntax. IMPORTANT: bare terms are ANDed - a tweet must contain EVERY word, so a list of loosely related keywords matches nothing; use one short phrase or OR between alternatives (e.g. ' OR getanyapi'). When an operator follows an OR list, put the list in parentheses, e.g. '( OR getanyapi) -filter:replies': without them X applies the operator to the last alternative only, so such a query still runs as X reads it and the response's hint carries the corrected query. You can embed X advanced-search operators directly in the query to filter
queryTypestringWhich posts to return: 'Latest' (newest first, the default), 'Top' (most popular), 'Photos' (newest posts with images), or 'Videos' (newest posts with video). Photos and Videos search your query as written with filter:images or filter:videos added after it, so they cost the same as a Latest search.
Latest · Top · Photos · Videos
Example: Latest
