Social media platform for posting and reading tweets
https://api.x.com/2/users/me
| Param | Type | Required | Description |
|---|---|---|---|
| user.fields | string | optional | Comma-separated user fields to include (e.g. 'public_metrics,created_at') |
/users/by/username/{username}
| Param | Type | Required | Description |
|---|---|---|---|
| username | string | required | X handle without the @ symbol |
| user.fields | string | optional | Comma-separated user fields to include |
/tweets
| Param | Type | Required | Description |
|---|---|---|---|
| text | string | required | Post text (max 280 characters) |
| reply | object | optional | Reply settings, e.g. { in_reply_to_tweet_id: '123' } |
| media | object | optional | Media attachment IDs, e.g. { media_ids: ['123'] } |
/tweets/{id}
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | required | Post (tweet) ID |
| tweet.fields | string | optional | Comma-separated tweet fields to include |
/tweets/{id}
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | required | Post (tweet) ID to delete |
/tweets/search/recent
| Param | Type | Required | Description |
|---|---|---|---|
| query | string | required | Search query (supports X search operators) |
| max_results | integer | optional | Results per page (10-100) |
| start_time | string | optional | Oldest post time to search from (RFC3339) |
| end_time | string | optional | Newest post time to search to (RFC3339) |
/users/{id}/tweets
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | required | User ID (not username) |
| max_results | integer | optional | Results per page (5-100) |
| exclude | string | optional | Comma-separated types to exclude (retweets, replies) |
/users/{id}/likes
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | required | Authenticated user's ID |
| tweet_id | string | required | Post (tweet) ID to like |