Keyword
Search Tweets by Keyword
Search X/Twitter for tweets matching keywords or hashtags
GET
Search X/Twitter for tweets matching keywords, hashtags, and advanced search operators. Returns normalized tweet data including user info, engagement metrics, and entities. This endpoint requires Bring Your Own Keys (BYOK) for X/Twitter.Documentation Index
Fetch the complete documentation index at: https://www.ayrshare.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Header Parameters
Query Parameters
Keyword search query. Supports X/Twitter search operators (see table below).Examples:
ayrshare, #socialmedia, ayrshare OR #socialmedia, from:ayrshare.Must be
twitter.Maximum number of tweets to return. Must be between 10 and 100.
Returns tweets with an ID greater than (newer than) this value. Useful for fetching only new tweets since a previous request.
Returns tweets with an ID less than (older than) this value. Useful for paginating backwards through results.
Pagination token from a previous response’s
meta.pagination.next. Use this to fetch the next page of results.Search Operators
Thequery parameter supports the following X/Twitter search operators:
| Operator | Description | Example |
|---|---|---|
AND | Both terms must appear (default behavior) | social AND media |
OR | Either term must appear | ayrshare OR socialmedia |
from: | Tweets from a specific user | from:ayrshare |
to: | Tweets directed at a specific user | to:ayrshare |
# | Match a hashtag | #socialmedia |
@ | Match a mention | @ayrshare |
- | Exclude a term | social -spam |
lang: | Filter by language | ayrshare lang:en |
filter: | Filter by content type | ayrshare filter:links |
url: | Match a URL | url:ayrshare.com |
