...

/

API Model for YouTube Service

API Model for YouTube Service

Learn about the main data entities and API endpoints needed to build a streaming service like YouTube.

This lesson discusses important data entities to help us get started with API design. We’ll look at the message format for each API endpoint needed to meet our functional requirements. Also, we'll see some interesting ways to make streaming smooth and efficient.

Base URL and API endpoints

We will use the following reference URL for our YouTube API design. The api.youtube.com is the host URL, v1.0 represents the first version, and videos defines the endpoint for accessing the streaming service.

Press + to interact
The base URL for the streaming API
The base URL for the streaming API

The following illustration shows a map of basic operations that can be performed by using a streaming service.

API endpoints for the streaming service

While we have explored the details of searching, commenting, and rating a design problem, here, we’ll focus on endpoints that are unique to the YouTube design problem. Therefore, we emphasize on performing three different operations as shown in the above illustration:

  • Manifest file: The manifest file of a video is obtained by calling the /videoId endpoint.

  • Streaming: The clients can call the /playback endpoint for the following two types of requests:

    • Segments: Accessing data chunks of video and audio with appropriate parameters.

    • Events: Issuing and logging commands (play quality, stopped playing—in case the user is logged in and we want to sync playback time on other devices—and other player configurations) to the server. ...