Requirements of the Twitter API

Learn the functional and non-functional requirements for Twitter's API service.

Introduction to the Twitter API

Twitter is a social media platform where millions of users share their TweetsA Tweet can contain text, images, or videos.The tweet can consist of text, images, or videos. and billions of other users react to those Tweets on a daily basis. Twitter provides users with an interface where they can perform different operations. However, behind the scenes, many services and components interact to create a Tweet, generate a timelineThe timeline includes a stream of Tweets and various recommendations based on the user's interests and followers' activity (such as their Tweets, Retweets, likes, etc.)., and perform other relevant tasks.

Designing an API for a platform like Twitter requires an in-depth understanding of the back-end system. In this chapter, we provide an overview of the workflow of the Twitter system and then move on to designing an API for it.

Let's establish the expectations from our API by defining some requirements.


This section discusses the functional and non-functional requirements that the Twitter API needs to fulfill.

Functional requirements

  • Post a Tweet: The API should allow users to post a Tweet. Apart from text, users should be able to upload images, videos, or any (non-executable) documents to the platform as part of the Tweet.

  • View timeline: It should be possible for users to retrieve their timelines.

  • Search: The API should enable users to search for any Tweet or account.

  • Comment on a Tweet: The users should be able to comment on a Tweet.

  • Rate a Tweet: The users should be able to like a Tweet (or unlike a liked Tweet).

Note: Most of these core functionalities require the users to be authenticated. However, some of the functionalities mentioned above are already available to us in the form of building blocks that we designed earlier.

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy