Twitter is what’s happening in the world and what people are talking about right now. You can access Twitter via the web or your mobile device. To share information on Twitter as widely as possible, we also provide companies, developers, and users with programmatic access to Twitter data through our APIs (application programming interfaces). This article explains what Twitter’s APIs are, what information is made available through them, and some of the protections Twitter has in place for their use.
At a high level, APIs are the way computer programs “talk” to each other so that they can request and deliver information. This is done by allowing a software application to call what's known as an endpoint: an address that corresponds with a specific type of information we provide (endpoints are generally unique like phone numbers). Twitter allows access to parts of our service via APIs to allow people to build software that integrates with Twitter, like a solution that helps a company respond to customer feedback on Twitter.
Twitter data is unique from data shared by most other social platforms because it reflects information that users choose to share publicly. Our API platform provides broad access to public Twitter data that users have chosen to share with the world. We also support APIs that allow users to manage their own non-public Twitter information (e.g., Direct Messages) and provide this information to developers whom they have authorized to do so.
Accessing Twitter Data
When someone wants to access our APIs, they are required to register an application. By default, applications can only access public information on Twitter. Certain endpoints, such as those responsible for sending or receiving Direct Messages, require additional permissions from you before they can access your information. These permissions are not granted by default; you choose on a per-application basis whether to provide this access, and can control all the applications authorized on your account.
The Twitter APIs include a wide range of endpoints, which fall into five primary groups:
Accounts and users
We allow developers to programmatically manage an account’s profile and settings, mute or block users, manage users and followers, request information about an authorized account’s activity, and more. These endpoints can help citizen services like the Commonwealth of Virginia’s Department of Emergency Management which provides information to residents about emergency responses and emergency alerts.
Tweets and replies
We make public Tweets and replies available to developers, and allow developers to post Tweets via our API. Developers can access Tweets by searching for specific keywords, or requesting a sample of Tweets from specific accounts.
These endpoints are used by NGOs like the UN to identify, understand and counter misinformation around public health initiatives. For example, in Indonesia, there were persistent rumors that vaccinations either contained pork product or caused infertility. Understanding how the rumors started and were spread allowed the UN to get a team on the ground to help dispel these myths, which caused particular concern in this Muslim-majority nation. Similarly, we help researchers listen for early symptomatic indications of disease outbreaks and monitor their spread. A team at Northeastern University recently developed a new flu-tracking technique using Twitter data that forecasts outbreaks up to six weeks in advance — much earlier than many other models, without sacrificing accuracy.
Our Direct Message endpoints provide access to the DM conversations of users who have explicitly granted permission to a specific application. We do not sell Direct Messages. Our DM APIs provide limited access to developers to create personalized experiences on Twitter, like Wendy's March Madness bracket builder. For accounts they own or manage, businesses can create these human- or chatbot-powered conversational experiences to communicate directly with customers for customer service, marketing, and brand engagement experiences.
We provide a suite of APIs to let developers, like Sprinklr, help businesses automatically create and manage ad campaigns on Twitter. Developers can use public Tweets to identify topics and interests, and provide businesses with tools for running advertising campaigns to reach the diverse audiences on Twitter.
Publisher tools and SDKs
We provide tools for software developers and publishers to embed Twitter timelines, share buttons, and other Twitter content on webpages. These tools allow brands to bring live, public conversations from Twitter into their web experience and make it easy for their customers to share information and articles from their sites.
You can learn more about our APIs and the specifics of each endpoint in our developer documentation.
Across all of our APIs and data products, we take our responsibility to protect our users' data seriously. We maintain strict policies and processes to assess how developers are using Twitter data, and restrict improper use of this data. When we learn that a developer violates our policies, we will take appropriate action, which can include suspension and termination of access to Twitter’s APIs and data products.
To learn more about Twitter’s APIs, please visit developer.twitter.com and review our developer policies and agreements. For more information on Twitter and GDPR, please visit https://gdpr.twitter.com/.