Antony
Antony

Reputation: 4344

Youtube devicesupport through PHP

For some reason when I call the following code:

echo file_get_contents('http://gdata.youtube.com/feeds/api/videos/wGG543FeHOE?v=2&alt=json');

I get the following image: http://i.ytimg.com/vi/UKY3scPIMd8/sddefault.jpg

This was working a few days ago - have Youtube started to restrict PHP access to their API?

Upvotes: 0

Views: 201

Answers (1)

Antony
Antony

Reputation: 4344

For anyone else who gets this problem - see https://developers.google.com/youtube/v3/getting-started. Basically they've deprecated the free4all api and are now limiting it to token access. Its quite easy to get a token and once you have one just call:

https://www.googleapis.com/youtube/v3/videos?id=ID&key=YOUR__KEY&part=snippet,contentDetails,statistics,status

Upvotes: 1

Related Questions