{"uid":"cap_F5rSmYRKPQrSXEO7lFEGs","slug":"api-direct-twitter-x-post-search-9e6a4b20","name":"API Direct – Twitter/X Post Search","description":"Search for tweets by keyword.","url":"https://x402.apidirect.io/v1/twitter/posts?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","required":["query"],"properties":{"pages":{"type":"integer","default":1,"maximum":20,"minimum":1,"description":"Number of pages to fetch and merge into one response (1-20, billed per page). Fetching stops early when there are no more results."},"query":{"type":"string","maxLength":500,"minLength":1,"description":"Search query (max 500 characters). Supports X's search operators (https://help.x.com/en/using-x/x-advanced-search)."},"sort_by":{"enum":["most_recent","relevance"],"type":"string","default":"most_recent","description":"Sort order for results"},"end_date":{"type":"string","format":"date","description":"Only return posts up to and including this date (YYYY-MM-DD, UTC). Must not be earlier than start_date. Can't be combined with posted_ago."},"posted_ago":{"enum":["1h","24h","7d","30d","12m"],"type":"string","description":"Only return posts from this period: 1h (past hour), 24h (past day), 7d (past week), 30d (past month), or 12m (past year). Works with both sort orders. Omit for all time. Can't be combined with start_date or end_date. Any other value returns 400."},"start_date":{"type":"string","format":"date","description":"Only return posts from this date onward (YYYY-MM-DD, UTC). Can't be combined with posted_ago."},"get_sentiment":{"type":"boolean","default":false,"description":"Set to true to add AI emotion analysis to each post. Adds a `sentiment` object containing `emotions` (joy, trust, fear, surprise, sadness, disgust, anger and anticipation, each scored 0-100), `dominant_emotion`, `emotional_intensity` (0-10), and `polarity` (positive, negative or neutral). Any post t"}}}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.007","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.007/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.007","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.007","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_sRMq_dSpihV5w88Ei32aJ","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.007","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Search for tweets (X posts) by keyword or advanced search operators, with optional pagination, date filtering, and AI sentiment analysis.","exampleAgentPrompt":"Search X for tweets about 'AI regulation' from the past 7 days, sorted by most recent, and include sentiment analysis on each post.","exampleUseCases":[{"title":"Brand reputation monitoring","prompt":"Search Twitter for any posts mentioning 'Acme Corp' from the past 24 hours, sorted by most recent, and tell me the overall sentiment — are people happy or upset about us?"},{"title":"Trending topic research","prompt":"Find the most relevant tweets about 'climate summit 2025' posted between January 1 and March 31 2025, fetch 3 pages of results, and include AI sentiment analysis so I can see how people feel about it."},{"title":"Competitive intelligence feed","prompt":"Pull the latest tweets mentioning 'OpenAI' or 'Anthropic' from the past week, sort by most recent, and give me a summary of what's being said."}],"resultDescription":"Returns a merged list of X (Twitter) posts matching the search query, including post text, metadata (author, timestamp, engagement), and optionally a sentiment object per post containing emotion scores (joy, trust, fear, surprise, sadness, disgust, anger, anticipation each 0-100), dominant emotion, emotional intensity (0-10), and polarity (positive/negative/neutral). Pagination merges up to 20 pages into one response.","failureModes":["Invalid posted_ago value (not in enum) returns HTTP 400","Combining posted_ago with start_date or end_date returns HTTP 400","start_date later than end_date returns HTTP 400","Empty or too-long query (>500 chars) returns validation error","Rate limiting or authentication failure returns HTTP 402 or 429","No results found returns empty post list without error"],"whenToPreferThis":"Use this endpoint when you need to search public X/Twitter posts by keyword or advanced search operators, especially when time-filtering (past hour, day, week, month, or year, or a specific date range), sorting by recency or relevance, or enriching results with per-post AI emotion analysis. Prefer it over scraping or Twitter's own API when you need a simple pay-per-call REST interface without OAuth setup.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T19:08:06.245Z","isFirstParty":false,"canonicalSlug":"api-direct-twitter-x-post-search-9e6a4b20"}