I know that i can get the whole info about a video by using:
http://gdata.youtube.com/feeds/api/videos/ID
but that outputs a lot of information and im using a regular expression to get the title out of it. I was wondering if there was a way to let that page only output the title and not all the other stuff that i dont need.
YouTube Data API costs are based on quota usage, and all requests will incur at least a 1-point quota cost. For each project, you're allowed 10,000 free quota units per day. You can use the quota calculator to determine your quota costs.
Projects that enable the YouTube Data API have a default quota allocation of 10,000 units per day, an amount sufficient for the majority of our API users. You can see your quota usage on the Quotas page in the API Console.
The YouTube Data API, is a free API google does not charge you for accessing this api. You are free to use it. THere for no billing account is needed in order to access this api. You do have a quota which limits the number of request that you can make to the api over a period of time.
The snippet object contains basic details about the video, such as its title, description, and category. The date and time that the video was published. Note that this time might be different than the time that the video was uploaded.
Not sure if this will help since I've never worked with youtube api before. I just ran across this info yesterday. According to http://dl.google.com/googleio/2010/googleapis-how-google-builds-apis.pdf you can do a Partial Get (just search that pdf for "Partial Response") by using fields=entry(title)
(though I think it's for searching for videos). By querying for the actual video id instead of a string it will return just that one video.
Example:
http://gdata.youtube.com/feeds/api/videos?v=2&q=[video_id]&max-results=1&fields=entry(title)&prettyprint=true
<?
$id = 'VIDEOID';
$xmlData = simplexml_load_string(file_get_contents("http://gdata.youtube.com/feeds/api/videos/{$id}?fields=title"));
$title = (string)$xmlData->title;
echo $title;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With