Getting started with youtube-api
Remarks#
This section provides an overview of what youtube-api is, and why a developer might want to use it.
It should also mention any large subjects within youtube-api, and link out to the related topics. Since the Documentation for youtube-api is new, you may need to create initial versions of those related topics.
Getting started with YouTube APIs
There are currently three YouTube APIs available to the public:
- YouTube Data API
- YouTube Analytics API
- YouTube Reporting API
Each of these offer different functionality and are treated as separate, individual APIs.
Since YouTube is a subsidiary of Google, the various YouTube APIs are provided and maintained by Google. In order to access any Google-provided API, following steps are necessary:
- You will need a Google Account to access the Google Developers Console.
- Create a new project in your Google Developers Console.
- You then are able to request an API key, and register your application.
- The required API’s that you will need access to will need to be enabled in the API library of the Google Cloud Console.
When On the credentials screen, an API key has to be generated. The type of key that is needed depends on the individual application.
There are five types of API keys:
Key type | Description | Use case / language |
---|---|---|
None | Has no restrictions and is normally used for testing and development | open to all environments |
Server key | Used for server-side applications. The key is considered a secret and may not be exposed to the public. | PHP, Java, Python, Ruby, C, etc. |
Browser key | Used for client-side applications. Since the client is going to issue requests to the API, the key cannot be a secret. | JavaScript |
Android key | For use within an Android app. | Android app |
iOS key | For use within an iOS app. | iOS app |
Once an API key is obtained and configured, you can then use it to make calls to the API.
For general API call’s, all you need is the API Key.
But if you need to access a user’s account to gain more information, upload or generally modify a user’s account data, you will need a “Client ID” and a “Client secret”.
These are used for authentication with the OAuth2 framework.
YouTube Data API
This API, sometimes also referred to as “API v3”, “YouTube Data API v3” or just “YouTube API”, is the most commonly used YouTube API. It enables an application to read, alter, add or delete data related to videos, playlists and channels. This includes, but is not limited to:
- Performing full-text searches for videos, channels and/or playlists
- Retrieving information about a video, channel or playlist by id
- Uploading videos
- Editing a video’s, channel’s or playlist’s description, visibility and other information
- Managing a channels profile picture, banner and other information
- Reading, posting and editing comments
YouTube Analytics API & YouTube Reporting API
These APIs are used to query for video and channel analytics, like views/clicks and votes.