Youtube API returning different playlist items

This is a similar issue to this one, however there is no search involved and I get different results for the exact same playlist OLAK5uy_lOk7qDh2bFNSqCEbQYkHfUQYPlCynN7OQ

The API call (note: not a search) returns a bunch of unavailable video ids:

https://www.googleapis.com/youtube/v3/playlistItems?playlistId=OLAK5uy_lOk7qDh2bFNSqCEbQYkHfUQYPlCynN7OQ&key={API_KEY}&part=snippet&maxResults=50

while using the website for the exact same playlist id

https://www.youtube.com/playlist?list=OLAK5uy_lOk7qDh2bFNSqCEbQYkHfUQYPlCynN7OQ

gives me completely different video ids, all of which are available. Is this a region issue?

Upvotes: 2

Views: 513

Answers (1)

Benjamin Loison
Benjamin Loison

Reputation: 5612

If you are interested in having actual YouTube videos contained in the playlist, you can use either:

  1. youtube-dl -j "OLAK5uy_lOk7qDh2bFNSqCEbQYkHfUQYPlCynN7OQ" | jq -r '.id'
    
  2. my open-source YouTube operational API by requesting https://yt.lemnoslife.com/playlistItems?part=snippet&playlistId=OLAK5uy_lOk7qDh2bFNSqCEbQYkHfUQYPlCynN7OQ

Upvotes: 2

Related Questions