Open documentation ↗Overview
Twitter API v2 available endpoints
Twitter API v2 is a social API from twitter.com. Requests are authenticated with HTTP Basic auth. It is served over HTTPS. Its OpenAPI description documents 80 endpoints.
At a glance
- Authentication
- HTTP Basic
- HTTPS
- Yes
- CORS
- Unknown
- Category
- Social
- Base URL
https://api.twitter.com- Version
- 2.61
- Endpoints
- 80
- OpenAPI
- Specification ↗
- Spec updated
- 2023-02-17
Make a first request
Replace the placeholders; the documentation says exactly where credentials go.
curl -X GET "https://api.twitter.com/2/compliance/jobs" \
-H "Accept: application/json" \
-H "Authorization: Basic BASE64_USER_PASSWORD"const response = await fetch("https://api.twitter.com/2/compliance/jobs", {
method: "GET",
headers: {
"Accept": "application/json",
"Authorization": "Basic BASE64_USER_PASSWORD",
},
});
const data = await response.json();
console.log(data);import requests
response = requests.request(
"GET",
"https://api.twitter.com/2/compliance/jobs",
headers={
"Accept": "application/json",
"Authorization": "Basic BASE64_USER_PASSWORD",
},
timeout=30,
)
print(response.json())Endpoints
| Method | Path | What it does |
|---|---|---|
| GET | /2/compliance/jobs | List Compliance Jobs |
| POST | /2/compliance/jobs | Create compliance job |
| GET | /2/compliance/jobs/{id} | Get Compliance Job |
| POST | /2/dm_conversations | Create a new DM Conversation |
| GET | /2/dm_conversations/with/{participant_id}/dm_events | Get DM Events for a DM Conversation |
| POST | /2/dm_conversations/with/{participant_id}/messages | Send a new message to a user |
| POST | /2/dm_conversations/{dm_conversation_id}/messages | Send a new message to a DM Conversation |
| GET | /2/dm_conversations/{id}/dm_events | Get DM Events for a DM Conversation |
| GET | /2/dm_events | Get recent DM Events |
| POST | /2/lists | Create List |
| GET | /2/lists/{id} | List lookup by List ID. |
| PUT | /2/lists/{id} | Update List. |
| DELETE | /2/lists/{id} | Delete List |
| GET | /2/lists/{id}/followers | Returns User objects that follow a List by the provided List ID |
| GET | /2/lists/{id}/members | Returns User objects that are members of a List by the provided List ID. |
| POST | /2/lists/{id}/members | Add a List member |
| DELETE | /2/lists/{id}/members/{user_id} | Remove a List member |
| GET | /2/lists/{id}/tweets | List Tweets timeline by List ID. |
| GET | /2/openapi.json | Returns the OpenAPI Specification document. |
| GET | /2/spaces | Space lookup up Space IDs |
| GET | /2/spaces/by/creator_ids | Space lookup by their creators |
| GET | /2/spaces/search | Search for Spaces |
| GET | /2/spaces/{id} | Space lookup by Space ID |
| GET | /2/spaces/{id}/buyers | Retrieve the list of Users who purchased a ticket to the given space |
| GET | /2/spaces/{id}/tweets | Retrieve Tweets from a Space. |
| GET | /2/tweets | Tweet lookup by Tweet IDs |
| POST | /2/tweets | Creation of a Tweet |
| GET | /2/tweets/compliance/stream | Tweets Compliance stream |
| GET | /2/tweets/counts/all | Full archive search counts |
| GET | /2/tweets/counts/recent | Recent search counts |
| GET | /2/tweets/firehose/stream | Firehose stream |
| GET | /2/tweets/label/stream | Tweets Label stream |
| GET | /2/tweets/sample/stream | Sample stream |
| GET | /2/tweets/sample10/stream | Sample 10% stream |
| GET | /2/tweets/search/all | Full-archive search |
| GET | /2/tweets/search/recent | Recent search |
| GET | /2/tweets/search/stream | Filtered stream |
| GET | /2/tweets/search/stream/rules | Rules lookup |
| POST | /2/tweets/search/stream/rules | Add/Delete rules |
| GET | /2/tweets/{id} | Tweet lookup by Tweet ID |
| DELETE | /2/tweets/{id} | Tweet delete by Tweet ID |
| GET | /2/tweets/{id}/liking_users | Returns User objects that have liked the provided Tweet ID |
| GET | /2/tweets/{id}/quote_tweets | Retrieve Tweets that quote a Tweet. |
| GET | /2/tweets/{id}/retweeted_by | Returns User objects that have retweeted the provided Tweet ID |
| PUT | /2/tweets/{tweet_id}/hidden | Hide replies |
| GET | /2/users | User lookup by IDs |
| GET | /2/users/by | User lookup by usernames |
| GET | /2/users/by/username/{username} | User lookup by username |
| GET | /2/users/compliance/stream | Users Compliance stream |
| GET | /2/users/me | User lookup me |
| GET | /2/users/{id} | User lookup by ID |
| GET | /2/users/{id}/blocking | Returns User objects that are blocked by provided User ID |
| POST | /2/users/{id}/blocking | Block User by User ID |
| GET | /2/users/{id}/bookmarks | Bookmarks by User |
| POST | /2/users/{id}/bookmarks | Add Tweet to Bookmarks |
| DELETE | /2/users/{id}/bookmarks/{tweet_id} | Remove a bookmarked Tweet |
| GET | /2/users/{id}/followed_lists | Get User's Followed Lists |
| POST | /2/users/{id}/followed_lists | Follow a List |
| DELETE | /2/users/{id}/followed_lists/{list_id} | Unfollow a List |
| GET | /2/users/{id}/followers | Followers by User ID |
| GET | /2/users/{id}/following | Following by User ID |
| POST | /2/users/{id}/following | Follow User |
| GET | /2/users/{id}/liked_tweets | Returns Tweet objects liked by the provided User ID |
| POST | /2/users/{id}/likes | Causes the User (in the path) to like the specified Tweet |
| DELETE | /2/users/{id}/likes/{tweet_id} | Causes the User (in the path) to unlike the specified Tweet |
| GET | /2/users/{id}/list_memberships | Get a User's List Memberships |
| GET | /2/users/{id}/mentions | User mention timeline by User ID |
| GET | /2/users/{id}/muting | Returns User objects that are muted by the provided User ID |
| POST | /2/users/{id}/muting | Mute User by User ID. |
| GET | /2/users/{id}/owned_lists | Get a User's Owned Lists. |
| GET | /2/users/{id}/pinned_lists | Get a User's Pinned Lists |
| POST | /2/users/{id}/pinned_lists | Pin a List |
| DELETE | /2/users/{id}/pinned_lists/{list_id} | Unpin a List |
| POST | /2/users/{id}/retweets | Causes the User (in the path) to retweet the specified Tweet. |
| DELETE | /2/users/{id}/retweets/{source_tweet_id} | Causes the User (in the path) to unretweet the specified Tweet |
| GET | /2/users/{id}/timelines/reverse_chronological | User home timeline by User ID |
| GET | /2/users/{id}/tweets | User Tweets timeline by User ID |
| DELETE | /2/users/{source_user_id}/blocking/{target_user_id} | Unblock User by User ID |
| DELETE | /2/users/{source_user_id}/following/{target_user_id} | Unfollow User |
| DELETE | /2/users/{source_user_id}/muting/{target_user_id} | Unmute User by User ID |
Questions
Does the Twitter API v2 API need an API key?
Yes. The Twitter API v2 API uses HTTP Basic authentication; the documentation explains how to get credentials.
Does the Twitter API v2 API support HTTPS?
Yes, the Twitter API v2 API is served over HTTPS.
How many endpoints does the Twitter API v2 API have?
Its OpenAPI description lists 80 endpoints in version 2.61. All of them are shown on this page.
What are alternatives to the Twitter API v2 API?
Other Social APIs include Blogger, Facebook, Twitter, Pinterest, TikTok.
Similar social APIs
Compare alternatives →Blogger
SocialThe Blogger APIs allows client applications to view and update Blogger content
Facebook Login, Share on FB, Social Plugins, Analytics and more
Read and write Twitter data
The world's catalog of ideas
TikTok
SocialFetches user info and user's video posts on TikTok platform
Twitter API
SocialUse the X API with an all-new Developer Console and consumption-based billing. No fixed monthly costs, no monthly caps.
Listed from APIs.guru (CC0).