X (Twitter)

Twitter API

Twitter API endpoints from X (Twitter)

Social#openapi#social

Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.

Overview

Twitter API endpoints from X (Twitter)

Endpoints 83

  • GETaccount.settings.get/account/settings.json?trend_location_woeid=string&sleep_time_enabled=string&start_sleep_time=string&end_sleep_time=string&time_zone=string&lang=stringReturns settings (including current trend, geo and sleep time information) for the authenticating user.
  • POSTaccount.settings.post/account/settings.json?trend_location_woeid=string&sleep_time_enabled=string&start_sleep_time=string&end_sleep_time=string&time_zone=string&lang=stringUpdates the authenticating user's settings.
  • POSTaccount.update_delivery_device/account/update_delivery_device.json?device=string&include_entities=stringSets which device Twitter delivers updates to for the authenticating user. Sending none as the device parameter will disable SMS updates.
  • POSTaccount.update_profile/account/update_profile.json?name=string&url=string&location=string&description=string&include_entities=string&skip_status=stringSets values that users are able to set under the Account tab of their settings page. Only the parameters specified will be updated.
  • POSTaccounts.update_profile_background_image/account/update_profile_background_image.json?tile=string&use=string&include_entities=string&skip_status=stringUpdates the authenticating user's profile background image. This method can also be used to enable or disable the profile background image. Although each…
  • POSTaccounts.update_profile_colors/account/update_profile_colors.json?profile_background_color=string&profile_link_color=string&profile_sidebar_border_color=string&profile_sidebar_fill_color=string&profile_text_color=string&include_entities=string&skip_status=stringSets one or more hex values that control the color scheme of the authenticating user's profile page on twitter.com. Each parameter's value must be a valid…
  • POSTaccounts.update_profile_image/account/update_profile_image.json?skip_status=stringUpdates the authenticating user's profile image. Note that this method expects raw multipart data, not a URL to an image. This method asynchronously processes…
  • GETapplication.rate_limit_status/application/rate_limit_status.json?resources=stringReturns the current rate limits for methods belonging to the specified resource families. Each 1.1 API resource belongs to a "resource family" which is…
  • POSTblocks.create/blocks/create.json?include_entities=string&skip_status=stringBlocks the specified user from following the authenticating user. In addition the blocked user will not show in the authenticating users mentions or timeline…
  • POSTblocks.destroy/blocks/destroy.json?include_entities=string&skip_status=stringUn-blocks the user specified in the ID parameter for the authenticating user. Returns the un-blocked user in the requested format when successful. If…
  • GETblocks.ids/blocks/ids.json?stringify_ids=string&cursor=stringReturns an array of numeric user ids the authenticating user is blocking.
  • GETblocks.list/blocks/list.json?include_entities=string&skip_status=string&cursor=stringAllows one to enable or disable retweets and device notifications from the specified user.
  • GETdirect_messages/direct_messages.json?count=string&since_id=string&max_id=string&include_entities=string&page=string&skip_status=stringReturns the 20 most recent direct messages sent to the authenticating user. Includes detailed information about the sender and recipient user. You can request…
  • POSTdirect_messages.destroy/direct_messages/destroy.json?id=string&include_entities=stringDestroys the direct message specified in the required ID parameter. The authenticating user must be the recipient of the specified direct message. Important:…
  • POSTdirect_messages.new/direct_messages/new.json?text=stringSends a new direct message to the specified user from the authenticating user. Requires both the user and text parameters and must be a POST. Returns the sent…
  • GETdirect_messages.sent/direct_messages/sent.json?count=string&since_id=string&max_id=string&include_entities=string&page=stringReturns the 20 most recent direct messages sent by the authenticating user. Includes detailed information about the sender and recipient user. You can request…
  • GETdirect_messages.show/direct_messages/show.json?id=stringReturns a single direct message, specified by an id parameter. Like the /1.1/direct_messages.format request, this method will include the user objects of the…
  • POSTfavorites.create/favorites/create.json?id=string&include_entities=stringFavorites the status specified in the ID parameter as the authenticating user. Returns the favorite status when successful. This process invoked by this…
  • POSTfavorites.destroy/favorites/destroy.json?id=string&include_entities=stringUn-favorites the status specified in the ID parameter as the authenticating user. Returns the un-favorited status in the requested format when successful.…
  • GETfavorites.list/favorites/list.json?count=string&since_id=string&max_id=string&include_entities=stringReturns the 20 most recent Tweets favorited by the authenticating or specified user.
  • GETfollowers.ids/followers/ids.json?stringify_ids=string&cursor=stringReturns a cursored collection of user IDs for every user following the specified user. At this time, results are ordered with the most recent following first…
  • GETfriends.ids/friends/ids.json?stringify_ids=string&cursor=stringReturns a cursored collection of user IDs for every user the specified user is following (otherwise known as their "friends"). At this time, results are…
  • POSTfriendships.create/friendships/create.json?follow=stringAllows the authenticating users to follow the user specified in the ID parameter. Returns the befriended user in the requested format when successful. Returns…
  • POSTfriendships.destroy/friendships/destroy.jsonAllows the authenticating user to unfollow the user specified in the ID parameter. Returns the unfollowed user in the requested format when successful.…
  • GETfriendships.incoming/friendships/incoming.json?stringify_ids=string&cursor=stringReturns the relationships of the authenticating user to the comma-separated list of up to 100 screen_names or user_ids provided. Values for connections can…
  • GETfriendships.lookup/friendships/lookup.jsonReturns the relationships of the authenticating user to the comma-separated list of up to 100 screen_names or user_ids provided. Values for connections can…
  • GETfriendships.outgoing/friendships/outgoing.json?stringify_ids=string&cursor=stringReturns a collection of numeric IDs for every protected user for whom the authenticating user has a pending follow request.
  • GETfriendships.show/friendships/show.json?source_id=string&source_screen_name=string&target_id=string&target_screen_name=stringReturns detailed information about the relationship between two arbitrary users.
  • POSTfriendships.update/friendships/update.json?device=string&retweets=stringAllows one to enable or disable retweets and device notifications from the specified user.
  • GETgeo.place_id/geo/id/:place_id.jsonReturns all the information about a known place.Example Values: df51dec6f4ee2b2c
  • POSTgeo.places/geo/places.json?attribute:street_address=string&callback=stringCreates a new place object at the given latitude and longitude. Before creating a place you need to query GET geo/similar_places with the latitude, longitude…
  • GETgeo.reverse_geocode/geo/reverse_geocode.json?lat=string&long=string&accuracy=string&granularity=string&max_results=string&callback=stringGiven a latitude and a longitude, searches for up to 20 places that can be used as a place_id when updating a status. This request is an informative call and…
  • GETgeo.search/geo/search.json?accuracy=string&granularity=string&contained_within=string&attribute:street_address=string&callback=stringSearch for places that can be attached to a statuses/update. Given a latitude and a longitude pair, an IP address, or a name, this request will return a list…
  • GETgeo.similar_places/geo/similar_places.json?contained_within=string&attribute:street_address=string&callback=stringLocates places near the given coordinates which are similar in name. Conceptually you would use this method to get a list of known places to choose from…
  • GEThelp.configurations/help/configuration.jsonReturns the current configuration used by Twitter including twitter.com slugs which are not usernames, maximum photo resolutions, and t.co URL lengths. It is…
  • GEThelp.languages/help/languages.jsonReturns the list of languages supported by Twitter along with their ISO 639-1 code. The ISO 639-1 code is the two letter value to use if you include lang with…
  • GEThelp.privacy/help/privacy.jsonReturns Twitter's Privacy Policy
  • GEThelp.tos/help/tos.jsonReturns the Twitter Terms of Service in the requested format. These are not the same as the Developer Rules of the Road.
  • POSTlists.create/lists/create.json?name=string&mode=string&description=stringCreates a new list for the authenticated user. Note that you can't create more than 20 lists per account.
  • POSTlists.destroy/lists/destroy.json?owner_screen_name=string&owner_id=stringDeletes the specified list. The authenticated user must own the list to be able to destroy it.
  • GETlists.list/lists/list.json?screen_name=string&user_id=stringReturns all lists the authenticating or specified user subscribes to, including their own. The user is specified using the user_id or screen_name parameters.…
  • GETlists.members/lists/members.json?owner_screen_name=string&owner_id=string&include_entities=string&skip_status=string&cursor=stringReturns the members of the specified list. Private list members will only be shown if the authenticated user owns the specified list.
  • POSTlists.members.create/lists/members/create.json?owner_screen_name=string&owner_id=stringAdd a member to a list. The authenticated user must own the list to be able to add members to it. Note that lists can't have more than 500 members.
  • POSTlists.members.create_all/lists/members/create_all.json?owner_screen_name=string&owner_id=string&user_id=string&screen_name=stringAdds multiple members to a list, by specifying a comma-separated list of member ids or screen names. The authenticated user must own the list to be able to…
  • POSTlists.members.destroy/lists/members/destroy.json?list_id=string&slug=string&owner_screen_name=string&owner_id=string&user_id=string&screen_name=stringRemoves the specified member from the list. The authenticated user must be the list's owner to remove members from the list.
  • POSTlists.members.destroy_all/lists/members/destroy_all.json?owner_screen_name=string&owner_id=string&screen_name=string&user_id=stringRemoves multiple members from a list, by specifying a comma-separated list of member ids or screen names. The authenticated user must own the list to be able…
  • GETlists.members.show/lists/members/show.json?owner_screen_name=string&owner_id=string&include_entities=string&skip_status=stringCheck if the specified user is a member of the specified list.
  • GETlists.memberships/lists/memberships.json?user_id=string&screen_name=string&cursor=string&filter_to_owned_lists=stringReturns the lists the specified user has been added to. If user_id or screen_name are not provided the memberships for the authenticating user are returned.
  • GETlists.show/lists/show.json?owner_screen_name=string&owner_id=stringReturns the specified list. Private lists will only be shown if the authenticated user owns the specified list.
  • GETlists.statuses/lists/statuses.json?owner_screen_name=string&owner_id=string&since_id=string&max_id=string&count=string&include_entities=string&include_rts=stringReturns tweet timeline for members of the specified list. Retweets are included by default. You can use the include_rts=false parameter to omit retweet objects.
  • GETlists.subscribers/lists/subscribers.json?owner_screen_name=string&owner_id=string&cursor=string&include_entities=string&skip_status=stringReturns the subscribers of the specified list. Private list subscribers will only be shown if the authenticated user owns the specified list.
  • POSTlists.subscribers.create/lists/subscribers/create.json?owner_screen_name=string&owner_id=stringSubscribes the authenticated user to the specified list.
  • POSTlists.subscribers.destroy/lists/subscribers/destroy.json?owner_screen_name=string&owner_id=stringUnsubscribes the authenticated user from the specified list.
  • GETlists.subscribers.show/lists/subscribers/show.json?owner_screen_name=string&owner_id=string&include_entities=string&skip_status=stringCheck if the specified user is a subscriber of the specified list. Returns the user if they are subscriber.
  • GETlists.subscriptions/lists/subscriptions.json?count=string&cursor=stringObtain a collection of the lists the specified user is subscribed to, 20 lists per page by default. Does not include the user's own lists.
  • POSTlists.update/lists/update.json?owner_screen_name=string&owner_id=string&name=string&mode=string&description=stringUpdates the specified list. The authenticated user must own the list to be able to update it.
  • POSTsaved_searches.create/saved_searches/create.json?query=stringCreate a new saved search for the authenticated user. A user may only have 25 saved searches.
  • POSTsaved_searches.destroy/saved_searches/destroy/:id.jsonDestroys a saved search for the authenticating user. The authenticating user must be the owner of saved search id being destroyed.
  • GETsaved_searches.list/saved_searches/list.jsonReturns the authenticated user's saved search queries.
  • GETsavedsearchesid/saved_searches/show/:id.jsonReturns the authenticated user's saved search queries.
  • GETsearch.tweets/search/tweets.json?q=string&geocode=string&lang=string&locale=string&result_type=string&count=string&until=string&since_id=string&max_id=string&include_entities=string&callback=stringReturns a collection of relevant Tweets matching a specified query. Please note that Twitter's search service and, by extension, the Search API is not meant…
  • POSTstatuses.destroy/statuses/destroy/:id.json?trim_user=stringDestroys the status specified by the required ID parameter. The authenticating user must be the author of the specified status. Returns the destroyed status…
  • GETstatuses.home_timeline/statuses/home_timeline.json?count=0&max_id=0&since_id=0&trim_user=string&exclude_replies=string&contributor_details=stringReturns a collection of the most recent Tweets and retweets posted by the authenticating user and the users they follow. The home timeline is central to how…
  • GETstatuses.mentions.timeline/statuses/mentions_timeline.json?count=0&since_id=0&max_id=0&trim_user=string&contributor_details=string&include_entities=trueReturns the 20 most recent mentions (tweets containing a users's @screen_name) for the authenticating user.The timeline returned is the equivalent of the one…
  • GETstatuses.oembed/statuses/oembed.json?maxwidth=0&hide_media=string&hide_thread=string&omit_script=string&align=left&related=string&lang=stringReturns information allowing the creation of an embedded representation of a Tweet on third party sites. See the oEmbed specification (http://oembed.com) for…
  • POSTstatusesretweetid/statuses/retweet/:id.json?trim_user=stringRetweets a tweet. Returns the original tweet with retweet details embedded.
  • GETstatuses.retweets/statuses/retweets/:id.json?count=string&trim_user=stringReturns up to 100 of the first retweets of a given tweet.
  • GETstatuses.show/statuses/show/:id.json?trim_user=string&include_my_retweet=string&include_entities=stringReturns a single status, specified by the id parameter below. The status's author will be returned inline.
  • POSTstatuses.update/statuses/update.json?status=Posting from @apigee's API test console. It's like a command line for the Twitter API! #apitools&in_reply_to_status_id=string&lat=37.426363&long=-122.141114&place_id=string&display_coordinates=false&trim_user=stringUpdates the authenticating user's status, also known as tweeting. To upload an image to accompany the tweet, use POST statuses/update_with_media…
  • POSTstatuses.update_with_media/statuses/update_with_media.json?status=string&media=string&possibly_sensitive=string&in_reply_to_status_id=string&lat=string&long=string&place_id=string&display_coordinates=stringUpdates the authenticating user's status and attaches media for upload. Unlike POST statuses/update…
  • GETstatuses.user_timeline/statuses/user_timeline.json?count=0&since_id=0&max_id=0&trim_user=string&exclude_replies=true&contributor_details=true&include_rts=trueReturns the 20 most recent statuses posted by the authenticating user. It is also possible to request another user's timeline by using the screen_name or…
  • GETtrends.available/trends/available.jsonReturns the locations that Twitter has trending topic information for. The response is an array of "locations" that encode the location's WOEID and some other…
  • GETtrends.closest/trends/closest.json?lat=string&long=stringReturns the locations that Twitter has trending topic information for, closest to a specified location. The response is an array of "locations" that encode…
  • GETtrends.place/trends/place.json?id=string&exclude=stringReturns the top 10 trending topics for a specific WOEID, if trending information is available for it. The response is an array of "trend" objects that encode…
  • GETusers.contributees/users/contributees.json?include_entities=string&skip_status=stringReturns a collection of users that the specified user can contribute to.
  • GETusers.contributors/users/contributors.json?include_entities=string&skip_status=stringReturns a collection of users who can contribute to the specified account.
  • GETusers.lookup/users/lookup.json?screen_name=string&user_id=string&include_entities=stringReturns fully-hydrated user objects for up to 100 users per request, as specified by comma-separated values passed to the user_id and/or screen_name…
  • POSTusers.report_spam/users/report_spam.jsonThe user specified in the id is blocked by the authenticated user and reported as a spammer.
  • GETusers.search/users/search.json?q=string&page=string&count=string&include_entities=stringProvides a simple, relevance-based search interface to public user accounts on Twitter. Try querying by topical interest, full name, company name, location,…
  • GETusers.show/users/show.json?screen_name=string&user_id=string&include_entities=stringReturns a variety of information about the user specified by the required user_id or screen_name parameter. The author's most recent Tweet will be returned…
  • GETusers.suggestions/users/suggestions.json?lang=stringAccess to Twitter's suggested user list. This returns the list of suggested user categories. The category can be used in GET users/suggestions/:slug to get…
  • GETusers.suggestions.slug/users/suggestions/:slug.json?lang=stringAccess the users in a given category of the Twitter suggested user list. It is recommended that applications cache this data for no more than one hour.
  • GETusers.suggestionsslugmembers/users/suggestions/:slug/members.jsonAccess the users in a given category of the Twitter suggested user list and return their most recent status if they are not a protected user.

API details

Base URL
https://api.twitter.com/1.1
Authentication
None declared in the description
Operations
83 operations on 82 pathsGET 51POST 32
Description format
Swagger 2.0, API version 1.1
Listed from
APIs.guru OpenAPI Directory (CC0-1.0)
Source updated

How to test the Twitter API in Swastik Codes

  1. Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
  2. Fork it into your workspaceChoose a workspace. You get your own copy of the Twitter API collection, without the publisher's secrets.
  3. Add your credentialsOpen the collection's variables or an environment and enter your API key or token, if the API needs one.
  4. Send a requestPick an endpoint, for example “account.settings.get” (GET /account/settings.json?trend_location_woeid=string&sleep_time_enabled=string&start_sleep_time=string&end_sleep_time=string&time_zone=string&lang=string), and press Send. Check the response, add tests and run the whole collection with the runner.

Frequently asked questions

What is the Twitter API?

Twitter API endpoints from X (Twitter) It is listed under Social and has 83 endpoints.

Who publishes the Twitter API?

It is listed from X (Twitter)'s public API description (an OpenAPI document), not published by X (Twitter) on Swastik Codes. Anyone who controls twitter.com can claim the profile by adding a DNS TXT record.

What is the base URL of the Twitter API?

Requests go to https://api.twitter.com/1.1. Endpoint paths are added to this base URL.

How do I authenticate with the Twitter API?

Its OpenAPI description does not declare an authentication scheme. Some endpoints may be open; check the provider's documentation before relying on that.

How many endpoints does the Twitter API have?

83 operations on 82 paths (51 GET, 32 POST).

Is forking the Twitter API free?

Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.

Suggest an API

Tell us which public API is missing. We check it, then add it here with its endpoints when it has an OpenAPI (Swagger) description.