- Docs
- Connect your users
Set up YouTube
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
- Create a project
In the Google Cloud console, create a project.
- Turn on the API
Under Enabled APIs and services, enable YouTube Data API v3.
- 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.
- Create the OAuth client
Under Credentials, create an OAuth client ID of type Web application and add the redirect URI below.
- Copy the credentials
Copy the Client ID and the Client secret.
Redirect URI
Add this exact URI under Authorized redirect URIs:
https://api.musicapi.com/callback/youtube
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
- Open Integrations in the dashboard and pick YouTube.
- Paste the Client ID and the Client Secret, and save.
- Turn Is Enabled on.
- 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).
Direct sign-in link
https://app.musicapi.com/{slug}/youtube/auth?returnUrl={returnUrl}