bradleygsmith
bradleygsmith

Reputation: 135

YouTube API v3: a Video Response's contentDetails.contentRating

I've been pulling video responses from the YouTube API v3 to create video content for my web app. Videos that get pulled get moderated and are made available publicly.

I got to thinking that I want to make sure that videos that get moderated don't accidentally release content to the public side of the website that is not suitable for children because I'm not requiring a user to log in to view videos on the front side; therefore, I'm not checking their age before I serve them videos. My video content from the YouTube API needs to be suitable for all ages.

I did a little research and found the content on this page, https://developers.google.com/youtube/v3/docs/videos, related to a video's content rating. It looks like there are over 60+ potential content ratings, each rating is dependent on a particular country.

To date, I've pulled 200,000+ videos from the API. Not all of them are publicly available because 1) they have not all been moderated and 2) some of the results (or videos) returned are not applicable to my site. Of these 200,000+ videos, I store all responses I get from the API each time I ping for that video's details. I've stored over 3,000,000+ API v3 video responses and not a single one has a contentDetails.contentRating.

Here's one of my sample calls:

https://www.googleapis.com/youtube/v3/videos?id=sXSovIsUuM0&part=snippet%2CcontentDetails%2Cstatistics%2Cstatus%2CtopicDetails%2Cplayer&key={my_key_here}

Am I doing something wrong with my YouTube API request like limiting the request to not include this information in the response back to me?

I'm more than happy to include an API response that results from my example request above.

Thanks in advance.

Upvotes: 0

Views: 1548

Answers (1)

mpgn
mpgn

Reputation: 7251

If there is a restriction of age on a video, YouTube show up

  "contentRating": {
     "ytRating": "ytAgeRestricted"
    }

But i don't thinks videos have a restriction in accordance for each country like we see in the doc. In fact, by default, videos haven't restriction, unless you set one.

If the video is only for adults you have the contentRating.ytRating to ytAgeRestricted. With that, your app cannot accidentally release content to the public side of the website that is not suitable for children unless thez are connected with an google accound with a age more than 18 are 21 regarding the country

Hope it's help !

Upvotes: 3

Related Questions