SDK reference for twitter operations
Overview
Twitter (X) posting and social media management
- Category:
social - Auth Required: Yes
- Supported Modes: standard, delegated
Operations
postTweet
Post a tweet
Arguments:
text(string, required): Tweet text (max 280 characters)
Returns:
AdapterOperationResult - Returns { tweetId: string, text: string } in result.data
Response Fields:
| Field | Type | Description |
|---|---|---|
tweetId | string | ID of the posted tweet |
text | string | Text content of the posted tweet |
Example:
getUserTweets
Retrieve tweets from a Twitter user. Must provide either userId OR userName (not both). NOTE: This operation ONLY accepts the 4 parameters listed below. There is NO maxResults, limit, count, or similar parameters - the API returns ~20 tweets per page, use cursor for pagination.
Arguments:
userId(string, optional): Twitter user ID (recommended for stability and speed). Provide userId OR userName, not both.userName(string, optional): Twitter username/handle without @ symbol (e.g., "elonmusk"). Provide userName OR userId, not both.cursor(string, optional): Pagination cursor from previous response's nextCursor field. Do not fabricate cursor values.includeReplies(boolean, optional): Whether to include replies in results. Defaults to false (only original tweets).
Returns:
AdapterOperationResult - Returns normalized flat structure: { tweets: NormalizedTweet[], hasNextPage, nextCursor, totalRetrieved }. Each tweet has FLAT fields (no nested author object): id, text, url, createdAt, lang, likeCount, retweetCount, replyCount, quoteCount, viewCount, bookmarkCount, isReply, isRetweet, source, authorId, authorName, authorUserName, authorFollowers, authorFollowing, authorIsVerified, authorVerifiedType, authorCreatedAt.
Response Fields:
| Field | Type | Description |
|---|---|---|
tweets | TwitterNormalizedTweet[] | List of normalized tweets |
tweets item fields (TwitterNormalizedTweet)
| Field | Type | Description |
|---|---|---|
id | string | Tweet ID |
text | string | Tweet text content |
url | string | Direct URL to the tweet |
createdAt | string | Tweet creation time (ISO 8601) |
lang | string | Tweet language code (optional) |
likeCount | number | Number of likes |
retweetCount | number | Number of retweets |
replyCount | number | Number of replies |
quoteCount | number | Number of quote tweets |
viewCount | number | Number of views |
bookmarkCount | number | Number of bookmarks |
isReply | boolean | Whether this is a reply to another tweet |
isRetweet | boolean | Whether this is a retweet |
source | string | Source application of the tweet (optional) |
authorId | string | Author user ID |
authorName | string | Author display name |
authorUserName | string | Author username/handle |
authorFollowers | number | Author follower count |
authorFollowing | number | Author following count |
authorIsVerified | boolean | Whether the author is verified |
authorVerifiedType | string | Type of verification (blue, business, government) (optional) |
authorCreatedAt | string | Author account creation date (optional) |
| hasNextPage | boolean | Whether more tweets are available |
| nextCursor | string | Cursor for fetching the next page |
| totalRetrieved | number | Number of tweets retrieved in this response |
Example:
advancedSearch
Search tweets using advanced Twitter search syntax. Supports operators like from:username, since:date, until:date, lang:en, and boolean operators (AND, OR). NOTE: This operation ONLY accepts the 3 parameters listed below (query, queryType, cursor). There is NO minFollowers, maxResults, limit, or other filtering parameters - filter results client-side after fetching.
Arguments:
query(string, required): Search query with advanced syntax. Examples: "from:elonmusk", "bitcoin since:2024-01-01", "AI OR "machine learning"". Supported operators: from:user, to:user, since:YYYY-MM-DD, until:YYYY-MM-DD, lang:xx, filter:media, filter:links, -filter:retweets, AND, OR, -keyword, "exact phrase".queryType(string, optional): Type of search results: "Latest" (most recent) or "Top" (most relevant). Defaults to "Latest". Only these two values are valid.cursor(string, optional): Pagination cursor from previous response's nextCursor field. Do not fabricate cursor values.
Returns:
AdapterOperationResult - Returns normalized flat structure: { query, queryType, tweets: NormalizedTweet[], hasNextPage, nextCursor, totalRetrieved }. Each tweet has FLAT fields (no nested author object): id, text, url, createdAt, lang, likeCount, retweetCount, replyCount, quoteCount, viewCount, bookmarkCount, isReply, isRetweet, source, authorId, authorName, authorUserName, authorFollowers, authorFollowing, authorIsVerified, authorVerifiedType, authorCreatedAt. To filter by follower count, check tweet.authorFollowers >= threshold.
Response Fields:
| Field | Type | Description |
|---|---|---|
query | string | Search query used |
queryType | string | Type of search: Latest or Top |
tweets | TwitterNormalizedTweet[] | List of matching tweets |
tweets item fields (TwitterNormalizedTweet)
| Field | Type | Description |
|---|---|---|
id | string | Tweet ID |
text | string | Tweet text content |
url | string | Direct URL to the tweet |
createdAt | string | Tweet creation time (ISO 8601) |
lang | string | Tweet language code (optional) |
likeCount | number | Number of likes |
retweetCount | number | Number of retweets |
replyCount | number | Number of replies |
quoteCount | number | Number of quote tweets |
viewCount | number | Number of views |
bookmarkCount | number | Number of bookmarks |
isReply | boolean | Whether this is a reply to another tweet |
isRetweet | boolean | Whether this is a retweet |
source | string | Source application of the tweet (optional) |
authorId | string | Author user ID |
authorName | string | Author display name |
authorUserName | string | Author username/handle |
authorFollowers | number | Author follower count |
authorFollowing | number | Author following count |
authorIsVerified | boolean | Whether the author is verified |
authorVerifiedType | string | Type of verification (blue, business, government) (optional) |
authorCreatedAt | string | Author account creation date (optional) |
| hasNextPage | boolean | Whether more results are available |
| nextCursor | string | Cursor for fetching the next page |
| totalRetrieved | number | Number of tweets retrieved in this response |
Example: