Skip to content

Twitter API API

by twitter.com

No authHTTPSSocial
Open documentation ↗

Overview

Use the X API with an all-new Developer Console and consumption-based billing. No fixed monthly costs, no monthly caps.

Twitter API is a social API from twitter.com. It needs no API key. It is served over HTTPS. Its OpenAPI description documents 83 endpoints.

At a glance

Authentication
No auth
HTTPS
Yes
CORS
Unknown
Category
Social
Base URL
https://api.twitter.com/1.1
Version
1.1
Endpoints
83
Spec updated
2021-06-21

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "https://api.twitter.com/1.1/account/settings.json" \
  -H "Accept: application/json"
JavaScript
const response = await fetch("https://api.twitter.com/1.1/account/settings.json", {
  method: "GET",
  headers: {
    "Accept": "application/json",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    "GET",
    "https://api.twitter.com/1.1/account/settings.json",
    headers={
    "Accept": "application/json",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
GET/account/settings.jsonReturns settings (including
POST/account/settings.jsonUpdates the
POST/account/update_delivery_device.jsonSets which
POST/account/update_profile.jsonSets values that
POST/account/update_profile_background_image.jsonUpdates the authenticating user's profile background image. This method can also be used to enable
POST/account/update_profile_colors.jsonSets one or
POST/account/update_profile_image.jsonUpdates the
GET/application/rate_limit_status.jsonReturns the
POST/blocks/create.jsonBlocks the specified user from
POST/blocks/destroy.jsonUn-blocks the user specified
GET/blocks/ids.jsonReturns an array of numeric user
GET/blocks/list.jsonAllows one to enable or
GET/direct_messages.jsonReturns the 20 most recent
POST/direct_messages/destroy.jsonDestroys the direct
POST/direct_messages/new.jsonSends a new direct
GET/direct_messages/sent.jsonReturns the 20 most
GET/direct_messages/show.jsonReturns a single direct
POST/favorites/create.jsonFavorites the status
POST/favorites/destroy.jsonUn-favorites the status
GET/favorites/list.jsonReturns the 20 most recent
GET/followers/ids.jsonReturns a cursored collection
GET/friends/ids.jsonReturns a cursored collection of
POST/friendships/create.jsonAllows the authenticating
POST/friendships/destroy.jsonAllows the
GET/friendships/incoming.jsonReturns the
GET/friendships/lookup.jsonReturns the relationships
GET/friendships/outgoing.jsonReturns a collection of
GET/friendships/show.jsonReturns detailed information
POST/friendships/update.jsonAllows one to enable or
GET/geo/id/{place_id}.jsonReturns all the
POST/geo/places.jsonCreates a new place object at the
GET/geo/reverse_geocode.jsonGiven a latitude and a
GET/geo/search.jsonSearch for places that can be
GET/geo/similar_places.jsonLocates places near the
GET/help/configuration.jsonReturns the current
GET/help/languages.jsonReturns the list of languages
GET/help/privacy.jsonReturns Twitter's Privacy Policy
GET/help/tos.jsonReturns the Twitter Terms of Service
POST/lists/create.jsonCreates a new list for the
POST/lists/destroy.jsonDeletes the specified list.
GET/lists/list.jsonReturns all lists the
GET/lists/members.jsonReturns the members of the
POST/lists/members/create.jsonAdd a member to a list.
POST/lists/members/create_all.jsonAdds multiple
POST/lists/members/destroy.jsonRemoves the specified
POST/lists/members/destroy_all.jsonRemoves multiple
GET/lists/members/show.jsonCheck if the specified
GET/lists/memberships.jsonReturns the lists the
GET/lists/show.jsonReturns the specified list.
GET/lists/statuses.jsonReturns tweet timeline for
GET/lists/subscribers.jsonReturns the subscribers of
POST/lists/subscribers/create.jsonSubscribes the
POST/lists/subscribers/destroy.jsonUnsubscribes the
GET/lists/subscribers/show.jsonCheck if the specified
GET/lists/subscriptions.jsonObtain a collection of
POST/lists/update.jsonUpdates the specified list. The
POST/saved_searches/create.jsonCreate a new saved
POST/saved_searches/destroy/{id}.jsonDestroys a
GET/saved_searches/list.jsonReturns the authenticated
GET/saved_searches/show/{id}.jsonReturns the
GET/search/tweets.jsonReturns a collection of
POST/statuses/destroy/{id}.jsonDestroys the status
GET/statuses/home_timeline.jsonReturns a collection
GET/statuses/mentions_timeline.jsonReturns the 20
GET/statuses/oembed.jsonReturns information allowing
POST/statuses/retweet/{id}.jsonRetweets a tweet.
GET/statuses/retweets/{id}.jsonReturns up to 100 of
GET/statuses/show/{id}.jsonReturns a single status,
POST/statuses/update.jsonUpdates the authenticating
POST/statuses/update_with_media.jsonUpdates the
GET/statuses/user_timeline.jsonReturns the 20 most
GET/trends/available.jsonReturns the locations that
GET/trends/closest.jsonReturns the locations that
GET/trends/place.jsonReturns the top 10 trending
GET/users/contributees.jsonReturns a collection of
GET/users/contributors.jsonReturns a collection of
GET/users/lookup.jsonReturns fully-hydrated user
POST/users/report_spam.jsonThe user
GET/users/search.jsonProvides a simple,
GET/users/show.jsonReturns a variety of information
GET/users/suggestions.jsonAccess to Twitter's
GET/users/suggestions/{slug}.jsonAccess the users in
GET/users/suggestions/{slug}/members.jsonAccess the

Questions

Does the Twitter API API need an API key?

No. The Twitter API API can be called without an API key or sign-up, which makes it handy for prototypes and front-end demos.

Does the Twitter API API support HTTPS?

Yes, the Twitter API API is served over HTTPS.

How many endpoints does the Twitter API API have?

Its OpenAPI description lists 83 endpoints in version 1.1. All of them are shown on this page.

What are alternatives to the Twitter API API?

Other Social APIs include Blogger, Facebook, Twitter, Pinterest, TikTok.

Compare alternatives →

Listed from APIs.guru (CC0).