Zernio
APIFor you
Zernio
APIFor you
API Reference

Twitter Engagement

Search recent tweetsGETLook up a tweetGETBookmark a tweetPOSTFollow a userPOSTRemove bookmarkDELETERetweet a postPOSTUndo retweetDELETEUnfollow a userDELETE
Dashboard
OverviewPlatformsAPI ReferenceResources
Twitter Engagement

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, ...). 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.


GET
/v1/twitter/search

Authorization

bearerAuth
AuthorizationBearer <token>

API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.

In: header

Query Parameters

accountId*string

The account ID

query*string

X search query, max 512 characters. Operators are passed through unchanged; X rejects malformed queries with a 400.

Length1 <= length <= 512
limit?integer

Results per page. X requires a minimum of 10; values below 10 are rejected.

Range10 <= value <= 100
Default10
sinceId?string

Only return tweets with an ID greater than (more recent than) this numeric tweet ID. Non-numeric values are rejected with 400.

Match^[0-9]{1,19}$
untilId?string

Only return tweets with an ID less than (older than) this numeric tweet ID. Non-numeric values are rejected with 400.

Match^[0-9]{1,19}$
startTime?string

Oldest UTC timestamp (ISO 8601, inclusive), within the last 7 days

Formatdate-time
endTime?string

Newest UTC timestamp (ISO 8601, exclusive), within the last 7 days

Formatdate-time
cursor?string

Pagination cursor from a previous response

sortOrder?string
Default"recency"

Value in

  • "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": "string",  "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": "string"    }  ],  "pagination": {    "hasMore": true,    "cursor": "string"  },  "meta": {    "resultCount": 0,    "newestId": "string",    "oldestId": "string",    "platform": "string"  }}
Was this page helpful?

Get the comments of a Reddit post

Temporarily unavailable: Reddit has blocked third-party apps from its API, so this endpoint returns 503 `PLATFORM_DISABLED` until Reddit restores access. Reddit Ads is not affected. Reads the comments of any Reddit post the connected account can see, for example one found through `/v1/reddit/feed` or `/v1/reddit/search`, straight from Reddit on every call. The tree comes flattened in thread order (a reply follows its parent); rebuild it from `parentId`, which is `t3_…` for a reply to the post and `t1_…` for a reply to a comment. Deleted and removed comments are passed through as Reddit sends them (`[deleted]` / `[removed]`). Where Reddit truncates a thread, the ids it left out are listed in `more`; `commentId` fetches one such comment with its replies. A post Reddit no longer serves answers 404 and a private subreddit 403, both with `platform_api_error`. For comments on posts published through Zernio, `/v1/inbox/comments/{postId}` adds caching, moderation and replies.

Look up a tweet

Resolve a single tweet by ID or URL into its text, author and public metrics. Use this to render a post you are referencing, e.g. the tweet quoted by a quote-style post. Unlike `/v1/twitter/search` this is not limited to the last 7 days and works for any tweet visible to the connected account. Billed as an X posts read ($0.005). Repeat lookups of the same tweet within the same UTC day are charged once.