Youtube API v3 - get list of all restricted countries

1.7k views Asked by At

In Youtube API v2 there was the section to describe in which countries video will be blocked:

<media:restriction type='country' relationship='deny'>
  BD BE BF...
</media:restriction>

How can I get the same information using new Youtube API v3?

1

There are 1 answers

2
Saumini Navaratnam On BEST ANSWER

The country restriction details is in the video's contentDetails part. Try request like below.

https://www.googleapis.com/youtube/v3/videos?part=contentDetails&id={YOUR_VIDEO_ID}&key={YOUR_API_KEY}

The above request will return a response something like this "contentDetails":{...,"regionRestriction":{"blocked":["SG", "US", "SL"]}} if the video has a country restriction. Its a list of all restricted countries for specific video.