Skip to main content

YouTube Music

MusicAPI holds the YouTube Music credentials used to authenticate your listeners. They are used solely to facilitate music transfers a listener has authorised, the same way FreeYourMusic works. You do not need a YouTube Music developer account, and you never store YouTube Music tokens.

Enable YouTube Music

  1. Open the MusicAPI Developer Dashboard and go to Integrations.
  2. Mark YouTube Music as Enabled so listeners see it as an option.
  3. Use the Test YouTube Music button to run the login flow once with your own account.

Listeners see your business name and logo on the authorisation screen. Set both under Account in the dashboard.

Redirect listeners to YouTube Music

To open the YouTube Music authorisation flow directly:

Or let listeners pick from every service you enabled:

After authorisation the listener returns to your returnUrl. See Authentication Callback for the payload.

YouTube Music specifics

  • There is no official YouTube Music API. YouTube Music playlists and liked songs are YouTube playlists, read and written through the YouTube Data API.
  • Video-only and user-uploaded items return an explicit unmatched reason instead of being silently omitted.
  • The YouTube Data API has a daily quota per Google project. MusicAPI manages that quota for you.

Advanced: use your own YouTube Music developer app

You do not need this for a standard integration. Use it only when you already run a YouTube Music developer app and want listeners to authorise that app instead of the MusicAPI one.

Steps for your own YouTube Music app
  1. In the Google API Console click Create project.

  2. On the Enabled APIs page click ENABLE APIS AND SERVICES, search for "YouTube Data API v3" and enable it.

    Example Youtube Search

    Example Youtube API

  3. Open OAuth consent screen, pick the user type, set the app name and a developer contact email.

    Example Youtube Configure Consent1

    Example Youtube Configure Consent2

  4. Click ADD OR REMOVE SCOPES and add:

    https://www.googleapis.com/auth/youtube

    https://www.googleapis.com/auth/userinfo.email

    https://www.googleapis.com/auth/userinfo.profile

    https://www.googleapis.com/auth/youtube.readonly

    https://www.googleapis.com/auth/youtube.upload

    https://www.googleapis.com/auth/youtube.force-ssl

  5. Add Test Users while the app is unverified.

  6. Go to Credentials, click Create CredentialsOAuth client ID, choose Web application, name it (for example "MusicAPI Login") and set the Redirect URI to exactly:

    https://api.musicapi.com/callback/youtube

  7. Copy the Client ID and Client Secret.

    Example Youtube Secrets

Then, in the MusicAPI Developer Dashboard, open Integrations, paste the credentials into the YouTube Music integration and save.