youtubeplaylistgoogle-apis-explorer

YouTube Data API V3 unkownPart "localizations"


I have been trying to fetch all videos from a playlist using YouTube Data API, which worked like a char; next, I wanted to try and filter videos based on languages, so I wanted to try to include the "localizations" part. However, whenever I do, I get a 400 response stating that "localizations" is "unkownPart". From what I could see in the documentation, I should have my GET request structured properly:

`https://youtube.googleapis.com/youtube/v3/playlistItems?part=localizations&part=snippet&maxResults=${limit}&playlistId=${playlistId}&key=${apiKey}`

Error message in postman:

{
    "error": {
        "code": 400,
        "message": "'localizations'",
        "errors": [
            {
                "message": "'localizations'",
                "domain": "youtube.part",
                "reason": "unknownPart",
                "location": "part",
                "locationType": "parameter"
            }
        ]
    }
}

"localizations" is a direct copy from the documentation. The GET request works fine if I remove it so I'm confident that the problem is either the order or my parameters, or the combinations of parameters in use (though I couldn't find anything about incompatible parameters in the documentation).

Parameters order goes as follows:

  1. localizations
  2. snippet
  3. playlistId
  4. key

EDIT: link to the documentation: https://developers.google.com/youtube/v3/docs/playlists/list


Solution

  • After sending the Issue Report it was discovered that I had been using the wrong API endpoint. Somehow (I can't remember why) I was using the "playlistItem" endpoint which doesn't support "localizations", and needed to shift to using the "playlists" endpoint instead.

    Furthermore when using a combination of both "snippet" and "localization", they should be within the same parameter but comma-separated, however, Postman doesn't auto-convert the commas in the parameters to "%2C" and therefore would cause further trouble understanding the requests. Fixing these 2 steps, it now works as intended.