youtube-api Getting started with youtube-api Getting started with YouTube APIs


Example

There are currently three YouTube APIs available to the public:

  1. YouTube Data API
  2. YouTube Analytics API
  3. 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:

  1. You will need a Google Account to access the Google Developers Console.
  2. Create a new project in your Google Developers Console.
  3. You then are able to request an API key, and register your application.
  4. 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 typeDescriptionUse case / language
NoneHas no restrictions and is normally used for testing and developmentopen to all environments
Server keyUsed 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 keyUsed for client-side applications. Since the client is going to issue requests to the API, the key cannot be a secret.JavaScript
Android keyFor use within an Android app.Android app
iOS keyFor 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.