Call it
curl https://api.peume.com/v1/call/x-search-recent-tweets \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"accountId": "your accountId",
"query": "your query",
"limit": 10,
"sortOrder": "recency"
}
}'const res = await fetch("https://api.peume.com/v1/call/x-search-recent-tweets", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"accountId": "your accountId",
"query": "your query",
"limit": 10,
"sortOrder": "recency"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/x-search-recent-tweets",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"accountId": "your accountId",
"query": "your query",
"limit": 10,
"sortOrder": "recency"
}
},
)
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-search-recent-tweets.
Parameters
accountIdRequiredstringThe account ID
queryRequiredstringX search query, max 512 characters. Operators are passed through unchanged; X rejects malformed queries with a 400.
limitintegerResults per page. X requires a minimum of 10; values below 10 are rejected.
Example: 10
sinceIdstringOnly return tweets with an ID greater than (more recent than) this numeric tweet ID. Non-numeric values are rejected with 400.
untilIdstringOnly return tweets with an ID less than (older than) this numeric tweet ID. Non-numeric values are rejected with 400.
startTimestringOldest UTC timestamp (ISO 8601, inclusive), within the last 7 days
endTimestringNewest UTC timestamp (ISO 8601, exclusive), within the last 7 days
cursorstringPagination cursor from a previous response
sortOrderstringrecency · relevancy
Example: recency
