Search recent tweets
Search public tweets from the last 7 days matching an X search query, e.g. to discover tweets to reply to.
The query string is passed through to X unchanged and supports X's search operators
(from:user, -is:retweet, is:reply, lang:en, "exact phrase", conversation_id:123, boolean OR, ...).
Note that standalone operators like is: / has: / lang: must be combined with a keyword or from: clause.
To reply to a found tweet, pass its id as the twitter platform entry's platformSpecificData.replyToTweetId when creating a post.
Rate limit: 300 requests per 15-min window per connected account.
API key authentication - use your Zernio API key as a Bearer token
In: header
Query Parameters
The social account ID
X search query, max 512 characters. Operators are passed through unchanged; X rejects malformed queries with a 400.
1 <= length <= 512Results per page. X requires a minimum of 10; values below 10 are rejected.
1010 <= value <= 100Only return tweets with an ID greater than (more recent than) this numeric tweet ID. Non-numeric values are rejected with 400.
^[0-9]{1,19}$Only return tweets with an ID less than (older than) this numeric tweet ID. Non-numeric values are rejected with 400.
^[0-9]{1,19}$Oldest UTC timestamp (ISO 8601, inclusive), within the last 7 days
date-timeNewest UTC timestamp (ISO 8601, exclusive), within the last 7 days
date-timePagination cursor from a previous response
"recency""recency" | "relevancy"Response Body
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.twitterengagement.searchTweets({ query: { accountId: 'account_abc123', query: 'string', },});console.log(data);{
"status": "success",
"tweets": [
{
"id": "string",
"text": "string",
"created": "2019-08-24T14:15:22Z",
"conversationId": "string",
"inReplyToTweetId": "string",
"lang": "string",
"author": {
"id": "string",
"username": "string",
"displayName": "string",
"avatar": "string",
"verifiedType": "string"
},
"likeCount": 0,
"replyCount": 0,
"retweetCount": 0,
"quoteCount": 0,
"platform": "twitter"
}
],
"pagination": {
"hasMore": true,
"cursor": "string"
},
"meta": {
"resultCount": 0,
"newestId": "string",
"oldestId": "string",
"platform": "twitter"
}
}{
"error": "Unauthorized"
}