Skip to the content
  1. Docs
  2. Connect your users

Set up YouTube

Core + Managed TransfersGuide · 2 min
What you need from the Google Cloud console (YouTube Data API v3, consent screen, OAuth client), the redirect URI and scopes, and the YouTube limits.

The youtube integration connects a Google account and works on its YouTube and YouTube Music library through the YouTube Data API. YouTube Music playlists and liked songs are YouTube playlists.

What you need from Google

  1. Create a project

    In the Google Cloud console, create a project.

  2. Turn on the API

    Under Enabled APIs and services, enable YouTube Data API v3.

  3. Set up the consent screen

    Pick the user type, set the app name and a developer contact email, and add the scopes below. While the app is not verified, add your testers as Test users.

  4. Create the OAuth client

    Under Credentials, create an OAuth client ID of type Web application and add the redirect URI below.

  5. Copy the credentials

    Copy the Client ID and the Client secret.

Redirect URI

Add this exact URI under Authorized redirect URIs:

Authorized redirect URI
https://api.musicapi.com/callback/youtube

Scopes

Default scopes
https://www.googleapis.com/auth/youtube
https://www.googleapis.com/auth/userinfo.email
https://www.googleapis.com/auth/userinfo.profile

The user must allow every scope. When the user unticks one, the sign-in fails with errorType: "missingScopes".

The youtube scope is a sensitive scope. Google must verify your app before people outside your test users can sign in.

Add it to MusicAPI

  1. Open Integrations in the dashboard and pick YouTube.
  2. Paste the Client ID and the Client Secret, and save.
  3. Turn Is Enabled on.
  4. Press Test YouTube and sign in once with your own Google account.

Quirks

  • Playlists work: read, create, rename, delete, add, remove and reorder items.
  • There are no saved albums or followed artists, and no liked-track writes.
  • YouTube gives no ISRC, so matching into YouTube uses the title and the artist. YouTube titles often mix both.
  • Each Google project has a daily YouTube Data API quota. A busy project can run out before the day ends.
  • At most 50 items per page (limitParam).
YouTube sign-in
https://app.musicapi.com/{slug}/youtube/auth?returnUrl={returnUrl}