{"uid":"cap_KAS2pkmjGeKEhL0oTrd7r","slug":"agent402-x-twitter-recent-search-8b35e420","name":"Agent402 X (Twitter) Recent Search","description":"Search public tweets from the last 7 days on X (Twitter) by query, using X API v2 search operators (keywords, from:, #hashtag, lang:, -is:retweet). Returns up to 10 tweets per call with text, created time, language, engagement metrics (likes, retweets, replies, quotes, impressions) and the author's username flattened onto each row, plus a next_token for paging.","url":"https://agent402.tools/api/x-search-recent","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"query":{"type":"string","description":"X search query (max 512 chars). Supports X operators: from:user, #tag, lang:en, -is:retweet, has:links."},"next_token":{"type":"string","description":"Pagination token from a previous response."},"sort_order":{"type":"string","description":"recency (default) or relevancy."},"max_results":{"type":"number","description":"Tweets per page, up to 10 (default 10). The upstream bills per post returned, so the page size is capped."}}},"responseSchema":{"type":"json","example":{"count":1,"query":"x402 -is:retweet","source":"x-api-v2","tweets":[{"id":"20","url":"https://x.com/jack/status/20","lang":"en","text":"just setting up my twttr","author":{"name":"jack","username":"jack","verified":false},"metrics":{"likes":180000,"quotes":30000,"replies":10000,"retweets":120000,"bookmarks":5000,"impressions":0},"authorId":"12","createdAt":"2006-03-21T20:50:14.000Z","conversationId":"20","possiblySensitive":false}],"fetchedAt":"2026-08-20T14:10:00.000Z","nextToken":"b26v89c19zqg8o3fpzbl7xxxxx"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.08","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.08/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.08","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.08","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Bnsly63TGJxQoKAn8UKpK","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.08","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Search recent posts on X (Twitter) using full X query syntax and return tweets with engagement metrics, author info, and pagination support.","exampleAgentPrompt":"Search X for recent posts about 'bitcoin ETF' that aren't retweets, sorted by recency, and give me the top 10 results with their engagement stats.","exampleUseCases":[{"title":"Crypto sentiment monitoring","prompt":"Search X for recent posts mentioning $ETH or #ethereum that aren't retweets, sort by recency, and show me the engagement numbers so I can gauge community sentiment."},{"title":"Tracking a hashtag campaign","prompt":"Find the 10 most recent tweets using the hashtag #agent402 and show me who posted them, how many likes they got, and when they were published."},{"title":"Competitor brand mention research","prompt":"Search X for posts from the last day mentioning 'OpenAI GPT-5' but exclude retweets and filter to English only — I want to see what real users are saying, with impression counts."}],"resultDescription":"Returns a JSON object containing a count of results, the original query string, a source identifier ('x-api-v2'), and an array of tweet objects. Each tweet includes its ID, URL, text, language, author details (name, username, verified status), full engagement metrics (likes, retweets, replies, quotes, bookmarks, impressions), creation timestamp, conversation ID, and a sensitivity flag. Also includes a fetchedAt timestamp and an optional nextToken for pagination.","failureModes":["Query exceeds 512 characters — request rejected","Invalid X query operator syntax — upstream API error returned","max_results above 10 — capped or error","Invalid pagination token — empty or error response","Payment failure via x402/MPP — 402 response before results are returned","Upstream X API rate limit hit — error propagated to caller","No matching tweets found — count 0, empty tweets array"],"whenToPreferThis":"Choose this endpoint when an agent needs real-time or recent social data from X (Twitter) without managing API keys or OAuth credentials. It is ideal for crypto/finance agents monitoring social sentiment, agents tracking trending hashtags, or workflows that need structured tweet data with engagement metrics. Prefer it over direct X API access when the agent uses x402 or MPP micropayment rails and benefits from pay-per-call pricing at $0.08 USDC. Not suitable for historical tweet archives (beyond recent window) or full user timeline retrieval.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T22:41:22.031Z","isFirstParty":false}