How to get youtube video keywords using php
I am trying to get keywords for a video using the video id (or url).
I searched for it and found ways to get the video information (title, length, etc.), but couldn't find a way to get the keywords. So ... how to get youtube video keywords with php
code:
$entry = simplexml_load_file('http://gdata.youtube.com/feeds/api/videos/gzDS-Kfd5XQ?v=2');
$keywords = (string) $entry->children('media', TRUE)->group->keywords;
$keywords_array = explode(", ", $keywords);
print_r($keywords_array);
+3
user3379482
source
to share
2 answers
Buddy, you end up with something like:
Array
(
because you must be the video downloader - you must provide the key first.
you just can't extract it from a video you don't have!
+2
Obadah hammoud
source
to share
For this, you need the YouTube API .
which you will be looking for:
snippet.tags[]
https://developers.google.com/youtube/v3/docs/videos#properties
Get your credentials in the Google API Console
Example request:
https://www.googleapis.com/youtube/v3/videos?part=snippet&id=Lg7vPFnTuMg&order=date&key=YOURKEY
+1
Pedro lobito
source
to share