/search-tweets endpoint allows you to programmatically access the global conversation on X, using the same powerful engine that drives the native X search bar.
💡 Use Cases
- Brand Monitoring: Track keywords related to your product to react to feedback.
- Competitor Intelligence: Monitor what users are saying about competitors.
- Market Trends: Identify emerging topics in Crypto, AI, or Finance.
- Lead Generation: Find high-intent users asking for recommendations in your niche.
📝 Note on Mentions: > While you can find mentions using general search, we have a dedicated endpoint for that. See our guide: How to Search Mentions of Account.
📥 Request Parameters
The endpoint uses thePOST method. This is designed for handling complex queries securely and efficiently.
| Parameter | Type | Description |
|---|---|---|
query | string | Required. Your keywords, hashtags, or complex search strings. |
order | string | Optional. Sorting logic. Defaults to latest. • latest: Newest tweets first. • popular: Top first. |
next_cursor | string | Optional. The cursor for the next page of results. Omit for the first request. |
🚀 Advanced Search Power Sorsa API supports all native X search operators (e.g.,min_faves:100,lang:en,since:2024-01-01). Mastering Search Operators →
🛠 Implementation Example
cURL
BashPython
Python📤 Response Structure
The response provides a complete data set, including full tweet metrics and detailed user profiles. JSON🔄 Pagination Logic
- Initial Request: Send your
query. Leavenext_cursorempty. - Continue: The API returns a
next_cursorstring. Pass this string into your next request’snext_cursorfield. - Finish: When
next_cursorin the response isnullor an empty string, you have collected all available results.
🚩 Pro-Tips for Better Search
- Filter Noise: Use advanced operators like
-filter:linksormin_retweets:5to clean your data. Read more in our Operators Guide. - Language Specifics: Add
lang:esorlang:endirectly into thequerystring to target specific regions. - Engagement Gating: Use
order: "popular"to identify the most viral content for your research.
⏭ Next Steps
- Mastering Search Operators — Boolean logic and engagement filters.
- Search Mentions Guide — Specific tracking for account mentions.
- Pagination Details — Deep dive into cursor mechanics.