YouTube embed gives “restricted from playback on certain sites” error despite API metadata indicating otherwise

Certain videos have a domain-level whitelist or blacklist applied to them. This is done at the discretion of the content owner. If there is a whitelist or a blacklist, and the domain of the embedding site can’t be determined (perhaps because of there not being a real referring domain in the case of your native … Read more

How to check if YouTube channel is streaming live

You can do this by using search.list and specifying the channel ID, setting the type to video, and setting eventType to live. For example, when I searched for: https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UCXswCcAMb5bvEUIDEzXFGYg&type=video&eventType=live&key=[API_KEY] I got the following: { “kind”: “youtube#searchListResponse”, “etag”: “\”sGDdEsjSJ_SnACpEvVQ6MtTzkrI/gE5P_aKHWIIc6YSpRcOE57lf9oE\””, “pageInfo”: { “totalResults”: 1, “resultsPerPage”: 5 }, “items”: [ { “kind”: “youtube#searchResult”, “etag”: “\”sGDdEsjSJ_SnACpEvVQ6MtTzkrI/H-6Tm7-JewZC0-CW4ALwOiq9wjs\””, “id”: { “kind”: … Read more

YouTube API to fetch all videos on a channel

You need to look at the YouTube Data API. You will find there documentation about how the API can be accessed. You can also find client libraries. You could also make the requests yourself. Here is an example URL that retrieves the latest videos from a channel: https://www.googleapis.com/youtube/v3/search?key={your_key_here}&channelId={channel_id_here}&part=snippet,id&order=date&maxResults=20 After that you will receive a JSON … Read more