user7179574
user7179574

Reputation: 1

Retrieving embed domain settings through YouTube API

Youtube Data API seems to allow you to get the embeddable status of the video: https://developers.google.com/resources/api-libraries/documentation/youtube/v3/java/latest/com/google/api/services/youtube/model/VideoStatus.html#getEmbeddable()

But there is also a feature in youtube where the content owners can set the video to be embeddable (or not embeddable) on certain domains: https://support.google.com/youtube/answer/6301625

In this case, the embeddable status returned by the YouTube API is insufficient and can be misleading. For a video id (example: TZ82ZR70vcc) which seems to have domain based embeddable settings, the embeddable status returns true, however, it not true for all domain.

Is there a way to retrieve the embed domain settings? Or to check if the video is embeddable on a given domain or not?

Upvotes: 0

Views: 224

Answers (1)

ReyAnthonyRenacia
ReyAnthonyRenacia

Reputation: 17651

The Youtube blog on Understanding Playback Restrictions states that

if you’d like to only search for videos that are embeddable, add format=5 to your query.

So add a &format=5 to your Youtube Data URL.

You may also read this SO thread for additional insight.

Upvotes: 0

Related Questions