# X (/integrations/x)





{/* MANUAL-CONTENT-START:intro */}

Use [X](https://x.com/) through an OAuth connection to manage posts and bookmarks, search content, inspect user relationships, and retrieve trends and account usage. The actions below document the available posting and account controls.

{/* MANUAL-CONTENT-END */}

## OAuth scopes [#oauth-scopes]

Sim requests these scopes when someone connects a X account. For a self-hosted deployment, register your own app with the provider using the settings below. See [Integrations and OAuth](/platform/self-hosting/integrations-oauth) for setup.

| Setting | Value |
| - | - |
| Redirect URI | `<NEXT_PUBLIC_APP_URL>/api/auth/oauth2/callback/x` |
| Environment variables | `X_CLIENT_ID`, `X_CLIENT_SECRET` |

| Scope | Description |
| - | - |
| `tweet.read` | Read tweets and timeline |
| `tweet.write` | Post, repost, and delete tweets |
| `tweet.moderate.write` | Hide and unhide replies to tweets |
| `users.read` | Read user profiles and account information |
| `follows.read` | View followers and following lists |
| `follows.write` | Follow and unfollow users |
| `bookmark.read` | View bookmarked tweets |
| `bookmark.write` | Add and remove bookmarks |
| `like.read` | View liked tweets and liking users |
| `like.write` | Like and unlike tweets |
| `block.read` | View blocked users |
| `block.write` | Block and unblock users |
| `mute.read` | View muted users |
| `mute.write` | Mute and unmute users |
| `offline.access` | Access account when not using the application |

## Use the block [#usage-instructions]

Search tweets, manage bookmarks, follow/block/mute users, like and retweet, view trends, and more.

## Actions [#actions]

### X Create Tweet [#x-create-tweet]

Create a new tweet, reply, or quote tweet on X

<ReferenceDetails>
  #### Input [#input]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `text` | string | Yes | The text content of the tweet (max 280 characters) |
  | `replyToTweetId` | string | No | Tweet ID to reply to |
  | `quoteTweetId` | string | No | Tweet ID to quote |
  | `mediaIds` | string | No | Comma-separated media IDs to attach (up to 4) |
  | `replySettings` | string | No | Who can reply: "mentionedUsers", "following", "subscribers", or "verified" |

  #### Output [#output]

  | Parameter | Type | Description |
  | - | - | - |
  | `id` | string | The ID of the created tweet |
  | `text` | string | The text of the created tweet |
</ReferenceDetails>

### X Delete Tweet [#x-delete-tweet]

Delete a tweet authored by the authenticated user

<ReferenceDetails>
  #### Input [#input-1]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `tweetId` | string | Yes | The ID of the tweet to delete |

  #### Output [#output-1]

  | Parameter | Type | Description |
  | - | - | - |
  | `deleted` | boolean | Whether the tweet was successfully deleted |
</ReferenceDetails>

### X Search Tweets [#x-search-tweets]

Search for recent tweets using keywords, hashtags, or advanced query operators

<ReferenceDetails>
  #### Input [#input-2]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `query` | string | Yes | Search query (supports operators like "from:", "to:", "#hashtag", "has:images", "is:retweet", "lang:") |
  | `maxResults` | number | No | Maximum number of results (10-100, default 10) |
  | `startTime` | string | No | Oldest UTC timestamp in ISO 8601 format (e.g., 2024-01-01T00:00:00Z) |
  | `endTime` | string | No | Newest UTC timestamp in ISO 8601 format |
  | `sinceId` | string | No | Returns tweets with ID greater than this |
  | `untilId` | string | No | Returns tweets with ID less than this |
  | `sortOrder` | string | No | Sort order: "recency" or "relevancy" |
  | `nextToken` | string | No | Pagination token for next page of results |

  #### Output [#output-2]

  | Parameter | Type | Description |
  | - | - | - |
  | `tweets` | array | Array of tweets matching the search query |
  | ↳ `id` | string | Tweet ID |
  | ↳ `text` | string | Tweet text content |
  | ↳ `createdAt` | string | Tweet creation timestamp |
  | ↳ `authorId` | string | Author user ID |
  | ↳ `conversationId` | string | Conversation thread ID |
  | ↳ `inReplyToUserId` | string | User ID being replied to |
  | ↳ `publicMetrics` | object | Engagement metrics |
  | ↳ `retweetCount` | number | Number of retweets |
  | ↳ `replyCount` | number | Number of replies |
  | ↳ `likeCount` | number | Number of likes |
  | ↳ `quoteCount` | number | Number of quotes |
  | `includes` | object | Additional data including user profiles |
  | ↳ `users` | array | Array of user objects referenced in tweets |
  | ↳ `id` | string | User ID |
  | ↳ `username` | string | Username without @ symbol |
  | ↳ `name` | string | Display name |
  | ↳ `description` | string | User bio |
  | ↳ `profileImageUrl` | string | Profile image URL |
  | ↳ `verified` | boolean | Whether the user is verified |
  | ↳ `metrics` | object | User statistics |
  | ↳ `followersCount` | number | Number of followers |
  | ↳ `followingCount` | number | Number of users following |
  | ↳ `tweetCount` | number | Total number of tweets |
  | `meta` | object | Search metadata including result count and pagination tokens |
  | ↳ `resultCount` | number | Number of results returned |
  | ↳ `newestId` | string | ID of the newest tweet |
  | ↳ `oldestId` | string | ID of the oldest tweet |
  | ↳ `nextToken` | string | Pagination token for next page |
</ReferenceDetails>

### X Get Tweets By IDs [#x-get-tweets-by-ids]

Look up multiple tweets by their IDs (up to 100)

<ReferenceDetails>
  #### Input [#input-3]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `ids` | string | Yes | Comma-separated tweet IDs (up to 100) |

  #### Output [#output-3]

  | Parameter | Type | Description |
  | - | - | - |
  | `tweets` | array | Array of tweets matching the provided IDs |
  | ↳ `id` | string | Tweet ID |
  | ↳ `text` | string | Tweet text content |
  | ↳ `createdAt` | string | Tweet creation timestamp |
  | ↳ `authorId` | string | Author user ID |
  | ↳ `conversationId` | string | Conversation thread ID |
  | ↳ `inReplyToUserId` | string | User ID being replied to |
  | ↳ `publicMetrics` | object | Engagement metrics |
  | ↳ `retweetCount` | number | Number of retweets |
  | ↳ `replyCount` | number | Number of replies |
  | ↳ `likeCount` | number | Number of likes |
  | ↳ `quoteCount` | number | Number of quotes |
  | `includes` | object | Additional data including user profiles |
  | ↳ `users` | array | Array of user objects referenced in tweets |
  | ↳ `id` | string | User ID |
  | ↳ `username` | string | Username without @ symbol |
  | ↳ `name` | string | Display name |
  | ↳ `description` | string | User bio |
  | ↳ `profileImageUrl` | string | Profile image URL |
  | ↳ `verified` | boolean | Whether the user is verified |
  | ↳ `metrics` | object | User statistics |
  | ↳ `followersCount` | number | Number of followers |
  | ↳ `followingCount` | number | Number of users following |
  | ↳ `tweetCount` | number | Total number of tweets |
</ReferenceDetails>

### X Get Quote Tweets [#x-get-quote-tweets]

Get tweets that quote a specific tweet

<ReferenceDetails>
  #### Input [#input-4]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `tweetId` | string | Yes | The tweet ID to get quote tweets for |
  | `maxResults` | number | No | Maximum number of results (10-100, default 10) |
  | `paginationToken` | string | No | Pagination token for next page |

  #### Output [#output-4]

  | Parameter | Type | Description |
  | - | - | - |
  | `tweets` | array | Array of quote tweets |
  | ↳ `id` | string | Tweet ID |
  | ↳ `text` | string | Tweet text content |
  | ↳ `createdAt` | string | Tweet creation timestamp |
  | ↳ `authorId` | string | Author user ID |
  | ↳ `conversationId` | string | Conversation thread ID |
  | ↳ `inReplyToUserId` | string | User ID being replied to |
  | ↳ `publicMetrics` | object | Engagement metrics |
  | ↳ `retweetCount` | number | Number of retweets |
  | ↳ `replyCount` | number | Number of replies |
  | ↳ `likeCount` | number | Number of likes |
  | ↳ `quoteCount` | number | Number of quotes |
  | `meta` | object | Pagination metadata |
  | ↳ `resultCount` | number | Number of results returned |
  | ↳ `nextToken` | string | Token for next page |
</ReferenceDetails>

### X Hide Reply [#x-hide-reply]

Hide or unhide a reply to a tweet authored by the authenticated user

<ReferenceDetails>
  #### Input [#input-5]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `tweetId` | string | Yes | The reply tweet ID to hide or unhide |
  | `hidden` | boolean | Yes | Set to true to hide the reply, false to unhide |

  #### Output [#output-5]

  | Parameter | Type | Description |
  | - | - | - |
  | `hidden` | boolean | Whether the reply is now hidden |
</ReferenceDetails>

### X Get User Tweets [#x-get-user-tweets]

Get tweets authored by a specific user

<ReferenceDetails>
  #### Input [#input-6]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `userId` | string | Yes | The user ID whose tweets to retrieve |
  | `maxResults` | number | No | Maximum number of results (5-100, default 10) |
  | `paginationToken` | string | No | Pagination token for next page of results |
  | `startTime` | string | No | Oldest UTC timestamp in ISO 8601 format |
  | `endTime` | string | No | Newest UTC timestamp in ISO 8601 format |
  | `sinceId` | string | No | Returns tweets with ID greater than this |
  | `untilId` | string | No | Returns tweets with ID less than this |
  | `exclude` | string | No | Comma-separated types to exclude: "retweets", "replies" |

  #### Output [#output-6]

  | Parameter | Type | Description |
  | - | - | - |
  | `tweets` | array | Array of tweets by the user |
  | ↳ `id` | string | Tweet ID |
  | ↳ `text` | string | Tweet text content |
  | ↳ `createdAt` | string | Tweet creation timestamp |
  | ↳ `authorId` | string | Author user ID |
  | ↳ `conversationId` | string | Conversation thread ID |
  | ↳ `inReplyToUserId` | string | User ID being replied to |
  | ↳ `publicMetrics` | object | Engagement metrics |
  | ↳ `retweetCount` | number | Number of retweets |
  | ↳ `replyCount` | number | Number of replies |
  | ↳ `likeCount` | number | Number of likes |
  | ↳ `quoteCount` | number | Number of quotes |
  | `includes` | object | Additional data including user profiles |
  | ↳ `users` | array | Array of user objects referenced in tweets |
  | ↳ `id` | string | User ID |
  | ↳ `username` | string | Username without @ symbol |
  | ↳ `name` | string | Display name |
  | ↳ `description` | string | User bio |
  | ↳ `profileImageUrl` | string | Profile image URL |
  | ↳ `verified` | boolean | Whether the user is verified |
  | ↳ `metrics` | object | User statistics |
  | ↳ `followersCount` | number | Number of followers |
  | ↳ `followingCount` | number | Number of users following |
  | ↳ `tweetCount` | number | Total number of tweets |
  | `meta` | object | Pagination metadata |
  | ↳ `resultCount` | number | Number of results returned |
  | ↳ `newestId` | string | ID of the newest tweet |
  | ↳ `oldestId` | string | ID of the oldest tweet |
  | ↳ `nextToken` | string | Token for next page |
  | ↳ `previousToken` | string | Token for previous page |
</ReferenceDetails>

### X Get User Mentions [#x-get-user-mentions]

Get tweets that mention a specific user

<ReferenceDetails>
  #### Input [#input-7]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `userId` | string | Yes | The user ID whose mentions to retrieve |
  | `maxResults` | number | No | Maximum number of results (5-100, default 10) |
  | `paginationToken` | string | No | Pagination token for next page of results |
  | `startTime` | string | No | Oldest UTC timestamp in ISO 8601 format |
  | `endTime` | string | No | Newest UTC timestamp in ISO 8601 format |
  | `sinceId` | string | No | Returns tweets with ID greater than this |
  | `untilId` | string | No | Returns tweets with ID less than this |

  #### Output [#output-7]

  | Parameter | Type | Description |
  | - | - | - |
  | `tweets` | array | Array of tweets mentioning the user |
  | ↳ `id` | string | Tweet ID |
  | ↳ `text` | string | Tweet text content |
  | ↳ `createdAt` | string | Tweet creation timestamp |
  | ↳ `authorId` | string | Author user ID |
  | ↳ `conversationId` | string | Conversation thread ID |
  | ↳ `inReplyToUserId` | string | User ID being replied to |
  | ↳ `publicMetrics` | object | Engagement metrics |
  | ↳ `retweetCount` | number | Number of retweets |
  | ↳ `replyCount` | number | Number of replies |
  | ↳ `likeCount` | number | Number of likes |
  | ↳ `quoteCount` | number | Number of quotes |
  | `includes` | object | Additional data including user profiles |
  | ↳ `users` | array | Array of user objects referenced in tweets |
  | ↳ `id` | string | User ID |
  | ↳ `username` | string | Username without @ symbol |
  | ↳ `name` | string | Display name |
  | ↳ `description` | string | User bio |
  | ↳ `profileImageUrl` | string | Profile image URL |
  | ↳ `verified` | boolean | Whether the user is verified |
  | ↳ `metrics` | object | User statistics |
  | ↳ `followersCount` | number | Number of followers |
  | ↳ `followingCount` | number | Number of users following |
  | ↳ `tweetCount` | number | Total number of tweets |
  | `meta` | object | Pagination metadata |
  | ↳ `resultCount` | number | Number of results returned |
  | ↳ `newestId` | string | ID of the newest tweet |
  | ↳ `oldestId` | string | ID of the oldest tweet |
  | ↳ `nextToken` | string | Token for next page |
  | ↳ `previousToken` | string | Token for previous page |
</ReferenceDetails>

### X Get User Timeline [#x-get-user-timeline]

Get the reverse chronological home timeline for the authenticated user

<ReferenceDetails>
  #### Input [#input-8]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `userId` | string | Yes | The authenticated user ID |
  | `maxResults` | number | No | Maximum number of results (1-100, default 10) |
  | `paginationToken` | string | No | Pagination token for next page of results |
  | `startTime` | string | No | Oldest UTC timestamp in ISO 8601 format |
  | `endTime` | string | No | Newest UTC timestamp in ISO 8601 format |
  | `sinceId` | string | No | Returns tweets with ID greater than this |
  | `untilId` | string | No | Returns tweets with ID less than this |
  | `exclude` | string | No | Comma-separated types to exclude: "retweets", "replies" |

  #### Output [#output-8]

  | Parameter | Type | Description |
  | - | - | - |
  | `tweets` | array | Array of timeline tweets |
  | ↳ `id` | string | Tweet ID |
  | ↳ `text` | string | Tweet text content |
  | ↳ `createdAt` | string | Tweet creation timestamp |
  | ↳ `authorId` | string | Author user ID |
  | ↳ `conversationId` | string | Conversation thread ID |
  | ↳ `inReplyToUserId` | string | User ID being replied to |
  | ↳ `publicMetrics` | object | Engagement metrics |
  | ↳ `retweetCount` | number | Number of retweets |
  | ↳ `replyCount` | number | Number of replies |
  | ↳ `likeCount` | number | Number of likes |
  | ↳ `quoteCount` | number | Number of quotes |
  | `includes` | object | Additional data including user profiles |
  | ↳ `users` | array | Array of user objects referenced in tweets |
  | ↳ `id` | string | User ID |
  | ↳ `username` | string | Username without @ symbol |
  | ↳ `name` | string | Display name |
  | ↳ `description` | string | User bio |
  | ↳ `profileImageUrl` | string | Profile image URL |
  | ↳ `verified` | boolean | Whether the user is verified |
  | ↳ `metrics` | object | User statistics |
  | ↳ `followersCount` | number | Number of followers |
  | ↳ `followingCount` | number | Number of users following |
  | ↳ `tweetCount` | number | Total number of tweets |
  | `meta` | object | Pagination metadata |
  | ↳ `resultCount` | number | Number of results returned |
  | ↳ `newestId` | string | ID of the newest tweet |
  | ↳ `oldestId` | string | ID of the oldest tweet |
  | ↳ `nextToken` | string | Token for next page |
  | ↳ `previousToken` | string | Token for previous page |
</ReferenceDetails>

### X Manage Like [#x-manage-like]

Like or unlike a tweet on X

<ReferenceDetails>
  #### Input [#input-9]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `userId` | string | Yes | The authenticated user ID |
  | `tweetId` | string | Yes | The tweet ID to like or unlike |
  | `action` | string | Yes | Action to perform: "like" or "unlike" |

  #### Output [#output-9]

  | Parameter | Type | Description |
  | - | - | - |
  | `liked` | boolean | Whether the tweet is now liked |
</ReferenceDetails>

### X Manage Retweet [#x-manage-retweet]

Retweet or unretweet a tweet on X

<ReferenceDetails>
  #### Input [#input-10]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `userId` | string | Yes | The authenticated user ID |
  | `tweetId` | string | Yes | The tweet ID to retweet or unretweet |
  | `action` | string | Yes | Action to perform: "retweet" or "unretweet" |

  #### Output [#output-10]

  | Parameter | Type | Description |
  | - | - | - |
  | `retweeted` | boolean | Whether the tweet is now retweeted |
</ReferenceDetails>

### X Get Liked Tweets [#x-get-liked-tweets]

Get tweets liked by a specific user

<ReferenceDetails>
  #### Input [#input-11]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `userId` | string | Yes | The user ID whose liked tweets to retrieve |
  | `maxResults` | number | No | Maximum number of results (5-100) |
  | `paginationToken` | string | No | Pagination token for next page |

  #### Output [#output-11]

  | Parameter | Type | Description |
  | - | - | - |
  | `tweets` | array | Array of liked tweets |
  | ↳ `id` | string | Tweet ID |
  | ↳ `text` | string | Tweet content |
  | ↳ `createdAt` | string | Creation timestamp |
  | ↳ `authorId` | string | Author user ID |
  | `meta` | object | Pagination metadata |
  | ↳ `resultCount` | number | Number of results returned |
  | ↳ `nextToken` | string | Token for next page |
</ReferenceDetails>

### X Get Liking Users [#x-get-liking-users]

Get the list of users who liked a specific tweet

<ReferenceDetails>
  #### Input [#input-12]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `tweetId` | string | Yes | The tweet ID to get liking users for |
  | `maxResults` | number | No | Maximum number of results (1-100, default 100) |
  | `paginationToken` | string | No | Pagination token for next page |

  #### Output [#output-12]

  | Parameter | Type | Description |
  | - | - | - |
  | `users` | array | Array of users who liked the tweet |
  | ↳ `id` | string | User ID |
  | ↳ `username` | string | Username without @ symbol |
  | ↳ `name` | string | Display name |
  | ↳ `description` | string | User bio |
  | ↳ `profileImageUrl` | string | Profile image URL |
  | ↳ `verified` | boolean | Whether the user is verified |
  | ↳ `metrics` | object | User statistics |
  | ↳ `followersCount` | number | Number of followers |
  | ↳ `followingCount` | number | Number of users following |
  | ↳ `tweetCount` | number | Total number of tweets |
  | `meta` | object | Pagination metadata |
  | ↳ `resultCount` | number | Number of results returned |
  | ↳ `nextToken` | string | Token for next page |
</ReferenceDetails>

### X Get Retweeted By [#x-get-retweeted-by]

Get the list of users who retweeted a specific tweet

<ReferenceDetails>
  #### Input [#input-13]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `tweetId` | string | Yes | The tweet ID to get retweeters for |
  | `maxResults` | number | No | Maximum number of results (1-100, default 100) |
  | `paginationToken` | string | No | Pagination token for next page |

  #### Output [#output-13]

  | Parameter | Type | Description |
  | - | - | - |
  | `users` | array | Array of users who retweeted the tweet |
  | ↳ `id` | string | User ID |
  | ↳ `username` | string | Username without @ symbol |
  | ↳ `name` | string | Display name |
  | ↳ `description` | string | User bio |
  | ↳ `profileImageUrl` | string | Profile image URL |
  | ↳ `verified` | boolean | Whether the user is verified |
  | ↳ `metrics` | object | User statistics |
  | ↳ `followersCount` | number | Number of followers |
  | ↳ `followingCount` | number | Number of users following |
  | ↳ `tweetCount` | number | Total number of tweets |
  | `meta` | object | Metadata |
  | ↳ `resultCount` | number | Number of results returned |
  | ↳ `nextToken` | string | Token for next page |
</ReferenceDetails>

### X Get Bookmarks [#x-get-bookmarks]

Get bookmarked tweets for the authenticated user

<ReferenceDetails>
  #### Input [#input-14]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `userId` | string | Yes | The authenticated user ID |
  | `maxResults` | number | No | Maximum number of results (1-100) |
  | `paginationToken` | string | No | Pagination token for next page of results |

  #### Output [#output-14]

  | Parameter | Type | Description |
  | - | - | - |
  | `tweets` | array | Array of bookmarked tweets |
  | ↳ `id` | string | Tweet ID |
  | ↳ `text` | string | Tweet text content |
  | ↳ `createdAt` | string | Tweet creation timestamp |
  | ↳ `authorId` | string | Author user ID |
  | ↳ `conversationId` | string | Conversation thread ID |
  | ↳ `inReplyToUserId` | string | User ID being replied to |
  | ↳ `publicMetrics` | object | Engagement metrics |
  | ↳ `retweetCount` | number | Number of retweets |
  | ↳ `replyCount` | number | Number of replies |
  | ↳ `likeCount` | number | Number of likes |
  | ↳ `quoteCount` | number | Number of quotes |
  | `includes` | object | Additional data including user profiles |
  | ↳ `users` | array | Array of user objects referenced in tweets |
  | ↳ `id` | string | User ID |
  | ↳ `username` | string | Username without @ symbol |
  | ↳ `name` | string | Display name |
  | ↳ `description` | string | User bio |
  | ↳ `profileImageUrl` | string | Profile image URL |
  | ↳ `verified` | boolean | Whether the user is verified |
  | ↳ `metrics` | object | User statistics |
  | ↳ `followersCount` | number | Number of followers |
  | ↳ `followingCount` | number | Number of users following |
  | ↳ `tweetCount` | number | Total number of tweets |
  | `meta` | object | Pagination metadata |
  | ↳ `resultCount` | number | Number of results returned |
  | ↳ `newestId` | string | ID of the newest tweet |
  | ↳ `oldestId` | string | ID of the oldest tweet |
  | ↳ `nextToken` | string | Token for next page |
  | ↳ `previousToken` | string | Token for previous page |
</ReferenceDetails>

### X Create Bookmark [#x-create-bookmark]

Bookmark a tweet for the authenticated user

<ReferenceDetails>
  #### Input [#input-15]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `userId` | string | Yes | The authenticated user ID |
  | `tweetId` | string | Yes | The tweet ID to bookmark |

  #### Output [#output-15]

  | Parameter | Type | Description |
  | - | - | - |
  | `bookmarked` | boolean | Whether the tweet was successfully bookmarked |
</ReferenceDetails>

### X Delete Bookmark [#x-delete-bookmark]

Remove a tweet from the authenticated user's bookmarks

<ReferenceDetails>
  #### Input [#input-16]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `userId` | string | Yes | The authenticated user ID |
  | `tweetId` | string | Yes | The tweet ID to remove from bookmarks |

  #### Output [#output-16]

  | Parameter | Type | Description |
  | - | - | - |
  | `bookmarked` | boolean | Whether the tweet is still bookmarked (should be false after deletion) |
</ReferenceDetails>

### X Get Me [#x-get-me]

Get the authenticated user's profile information

<ReferenceDetails>
  #### Input [#input-17]

  | Parameter | Type | Required | Description |
  | - | - | - | - |

  #### Output [#output-17]

  | Parameter | Type | Description |
  | - | - | - |
  | `user` | object | Authenticated user profile |
  | ↳ `id` | string | User ID |
  | ↳ `username` | string | Username without @ symbol |
  | ↳ `name` | string | Display name |
  | ↳ `description` | string | User bio |
  | ↳ `profileImageUrl` | string | Profile image URL |
  | ↳ `verified` | boolean | Whether the user is verified |
  | ↳ `metrics` | object | User statistics |
  | ↳ `followersCount` | number | Number of followers |
  | ↳ `followingCount` | number | Number of users following |
  | ↳ `tweetCount` | number | Total number of tweets |
</ReferenceDetails>

### X Search Users [#x-search-users]

Search for X users by name, username, or bio

<ReferenceDetails>
  #### Input [#input-18]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `query` | string | Yes | Search keyword (1-50 chars, matches name, username, or bio) |
  | `maxResults` | number | No | Maximum number of results (1-1000, default 100) |
  | `nextToken` | string | No | Pagination token for next page |

  #### Output [#output-18]

  | Parameter | Type | Description |
  | - | - | - |
  | `users` | array | Array of users matching the search query |
  | ↳ `id` | string | User ID |
  | ↳ `username` | string | Username without @ symbol |
  | ↳ `name` | string | Display name |
  | ↳ `description` | string | User bio |
  | ↳ `profileImageUrl` | string | Profile image URL |
  | ↳ `verified` | boolean | Whether the user is verified |
  | ↳ `metrics` | object | User statistics |
  | ↳ `followersCount` | number | Number of followers |
  | ↳ `followingCount` | number | Number of users following |
  | ↳ `tweetCount` | number | Total number of tweets |
  | `meta` | object | Search metadata |
  | ↳ `resultCount` | number | Number of results returned |
  | ↳ `nextToken` | string | Pagination token for next page |
</ReferenceDetails>

### X Get Followers [#x-get-followers]

Get the list of followers for a user

<ReferenceDetails>
  #### Input [#input-19]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `userId` | string | Yes | The user ID whose followers to retrieve |
  | `maxResults` | number | No | Maximum number of results (1-1000, default 100) |
  | `paginationToken` | string | No | Pagination token for next page |

  #### Output [#output-19]

  | Parameter | Type | Description |
  | - | - | - |
  | `users` | array | Array of follower user profiles |
  | ↳ `id` | string | User ID |
  | ↳ `username` | string | Username without @ symbol |
  | ↳ `name` | string | Display name |
  | ↳ `description` | string | User bio |
  | ↳ `profileImageUrl` | string | Profile image URL |
  | ↳ `verified` | boolean | Whether the user is verified |
  | ↳ `metrics` | object | User statistics |
  | ↳ `followersCount` | number | Number of followers |
  | ↳ `followingCount` | number | Number of users following |
  | ↳ `tweetCount` | number | Total number of tweets |
  | `meta` | object | Pagination metadata |
  | ↳ `resultCount` | number | Number of results returned |
  | ↳ `nextToken` | string | Token for next page |
</ReferenceDetails>

### X Get Following [#x-get-following]

Get the list of users that a user is following

<ReferenceDetails>
  #### Input [#input-20]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `userId` | string | Yes | The user ID whose following list to retrieve |
  | `maxResults` | number | No | Maximum number of results (1-1000, default 100) |
  | `paginationToken` | string | No | Pagination token for next page |

  #### Output [#output-20]

  | Parameter | Type | Description |
  | - | - | - |
  | `users` | array | Array of users being followed |
  | ↳ `id` | string | User ID |
  | ↳ `username` | string | Username without @ symbol |
  | ↳ `name` | string | Display name |
  | ↳ `description` | string | User bio |
  | ↳ `profileImageUrl` | string | Profile image URL |
  | ↳ `verified` | boolean | Whether the user is verified |
  | ↳ `metrics` | object | User statistics |
  | ↳ `followersCount` | number | Number of followers |
  | ↳ `followingCount` | number | Number of users following |
  | ↳ `tweetCount` | number | Total number of tweets |
  | `meta` | object | Pagination metadata |
  | ↳ `resultCount` | number | Number of results returned |
  | ↳ `nextToken` | string | Token for next page |
</ReferenceDetails>

### X Manage Follow [#x-manage-follow]

Follow or unfollow a user on X

<ReferenceDetails>
  #### Input [#input-21]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `userId` | string | Yes | The authenticated user ID |
  | `targetUserId` | string | Yes | The user ID to follow or unfollow |
  | `action` | string | Yes | Action to perform: "follow" or "unfollow" |

  #### Output [#output-21]

  | Parameter | Type | Description |
  | - | - | - |
  | `following` | boolean | Whether you are now following the user |
  | `pendingFollow` | boolean | Whether the follow request is pending (for protected accounts) |
</ReferenceDetails>

### X Manage Block [#x-manage-block]

Block or unblock a user on X

<ReferenceDetails>
  #### Input [#input-22]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `userId` | string | Yes | The authenticated user ID |
  | `targetUserId` | string | Yes | The user ID to block or unblock |
  | `action` | string | Yes | Action to perform: "block" or "unblock" |

  #### Output [#output-22]

  | Parameter | Type | Description |
  | - | - | - |
  | `blocking` | boolean | Whether you are now blocking the user |
</ReferenceDetails>

### X Get Blocking [#x-get-blocking]

Get the list of users blocked by the authenticated user

<ReferenceDetails>
  #### Input [#input-23]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `userId` | string | Yes | The authenticated user ID |
  | `maxResults` | number | No | Maximum number of results (1-1000) |
  | `paginationToken` | string | No | Pagination token for next page |

  #### Output [#output-23]

  | Parameter | Type | Description |
  | - | - | - |
  | `users` | array | Array of blocked user profiles |
  | ↳ `id` | string | User ID |
  | ↳ `username` | string | Username without @ symbol |
  | ↳ `name` | string | Display name |
  | ↳ `description` | string | User bio |
  | ↳ `profileImageUrl` | string | Profile image URL |
  | ↳ `verified` | boolean | Whether the user is verified |
  | ↳ `metrics` | object | User statistics |
  | ↳ `followersCount` | number | Number of followers |
  | ↳ `followingCount` | number | Number of users following |
  | ↳ `tweetCount` | number | Total number of tweets |
  | `meta` | object | Pagination metadata |
  | ↳ `resultCount` | number | Number of results returned |
  | ↳ `nextToken` | string | Token for next page |
</ReferenceDetails>

### X Manage Mute [#x-manage-mute]

Mute or unmute a user on X

<ReferenceDetails>
  #### Input [#input-24]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `userId` | string | Yes | The authenticated user ID |
  | `targetUserId` | string | Yes | The user ID to mute or unmute |
  | `action` | string | Yes | Action to perform: "mute" or "unmute" |

  #### Output [#output-24]

  | Parameter | Type | Description |
  | - | - | - |
  | `muting` | boolean | Whether you are now muting the user |
</ReferenceDetails>

### X Get Trends By WOEID [#x-get-trends-by-woeid]

Get trending topics for a specific location by WOEID (e.g., 1 for worldwide, 23424977 for US)

<ReferenceDetails>
  #### Input [#input-25]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `woeid` | string | Yes | Yahoo Where On Earth ID (e.g., "1" for worldwide, "23424977" for US, "23424975" for UK) |
  | `maxTrends` | number | No | Maximum number of trends to return (1-50, default 20) |

  #### Output [#output-25]

  | Parameter | Type | Description |
  | - | - | - |
  | `trends` | array | Array of trending topics |
  | ↳ `trendName` | string | Name of the trending topic |
  | ↳ `tweetCount` | number | Number of tweets for this trend |
</ReferenceDetails>

### X Get Personalized Trends [#x-get-personalized-trends]

Get personalized trending topics for the authenticated user

<ReferenceDetails>
  #### Input [#input-26]

  | Parameter | Type | Required | Description |
  | - | - | - | - |

  #### Output [#output-26]

  | Parameter | Type | Description |
  | - | - | - |
  | `trends` | array | Array of personalized trending topics |
  | ↳ `trendName` | string | Name of the trending topic |
  | ↳ `postCount` | number | Number of posts for this trend |
  | ↳ `category` | string | Category of the trend |
  | ↳ `trendingSince` | string | ISO 8601 timestamp of when the topic started trending |
</ReferenceDetails>

### X Get Usage [#x-get-usage]

Get the API usage data for your X project

<ReferenceDetails>
  #### Input [#input-27]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `days` | number | No | Number of days of usage data to return (1-90, default 7) |

  #### Output [#output-27]

  | Parameter | Type | Description |
  | - | - | - |
  | `capResetDay` | number | Day of month when usage cap resets |
  | `projectId` | string | The project ID |
  | `projectCap` | number | The project tweet consumption cap |
  | `projectUsage` | number | Total tweets consumed in current period |
  | `dailyProjectUsage` | array | Daily project usage breakdown |
  | ↳ `date` | string | Usage date in ISO 8601 format |
  | ↳ `usage` | number | Number of tweets consumed |
  | `dailyClientAppUsage` | array | Daily per-app usage breakdown |
  | ↳ `clientAppId` | string | Client application ID |
  | ↳ `usage` | array | Daily usage entries for this app |
  | ↳ `date` | string | Usage date in ISO 8601 format |
  | ↳ `usage` | number | Number of tweets consumed |
</ReferenceDetails>
