Latest Release Notes
June 25th, 2008 | Published in Youtube API
Posted by Daniel Danciu, Software Engineer
We have recently pushed a few updates to the YouTube API, so here's a quick overview of a few new features you can play with.
http://gdata.youtube.com/feeds/videos?location=
You'll notice that all results returned by the api now have a location returned in the georss:where tag:
gml:Point>
gml:pos>40.44263458251953 -79.94313049316406/gml:pos>
/gml:Point>
/georss:where>
This opens the gates for some pretty cool mashups that combine Google Maps and YouTube. (And closes out this feature request). We'll be doing some more work with geo in the future, so stay tuned.
X-GData-User-Country: CH
This is useful in a few cases, the most common of which is an authenticated request to a user's own upload, favorites or playlists feed. The API will, in this case, return all videos in the feed, including the videos that are restricted in the country where the request was made from. Combine X-GData-User-Country with the tag to filter out these videos (for example, you can show the video's thumbnail but disable the playback).
Please note that in order to be able to view all videos of a user (including restricted or private videos), the request has to be authenticated and should not contain additional filtering parameters (like format or vq).
Don't forget that if you have your own website, you can always forward to the API (and we encourage you to do so) the country of origin or IP of origin of your requests using the restriction= parameter. This will ensure that videos are properly filtered for the location where your user is. In this case, the X-GData-User-Country response header will return the country specified in the restriction parameter.
http://gdata.youtube.com/feeds/api/standardfeeds/most_popular
It is different from most_viewed or top_rated in the sense that it uses a smarter algorithm to evaluate the popularity of a video. Oh, and if you're an international user, don't forget that the API supports standard feeds for all the countries YouTube does. For example, if you are interested in most popular videos in Germany, du kannst einfach:
http://gdata.youtube.com/feeds/api/standardfeeds/de/most_popular
** This is now called "Rising Videos" on the main site.
Enjoy! If you have any questions or feedback, visit us in our developer forum.
We have recently pushed a few updates to the YouTube API, so here's a quick overview of a few new features you can play with.
Restrict for videos that have location information
You can now restrict your search to videos that have an associated location (latitude-longitude pair). Simply add a 'location=' empty parameter to the URL of your query, whether it is search, or a query for uploads, playlists or favorites:http://gdata.youtube.com/feeds/videos?location=
You'll notice that all results returned by the api now have a location returned in the georss:where tag:
gml:Point>
gml:pos>40.44263458251953 -79.94313049316406/gml:pos>
/gml:Point>
/georss:where>
This opens the gates for some pretty cool mashups that combine Google Maps and YouTube. (And closes out this feature request). We'll be doing some more work with geo in the future, so stay tuned.
Country request returned in the header
We now return the country the request came from in the X-GData-User-Country header of the response. For example, if you made the request from Switzerland, you'll see the following header in the response from the API server:X-GData-User-Country: CH
This is useful in a few cases, the most common of which is an authenticated request to a user's own upload, favorites or playlists feed. The API will, in this case, return all videos in the feed, including the videos that are restricted in the country where the request was made from. Combine X-GData-User-Country with the tag to filter out these videos (for example, you can show the video's thumbnail but disable the playback).
Please note that in order to be able to view all videos of a user (including restricted or private videos), the request has to be authenticated and should not contain additional filtering parameters (like format or vq).
Don't forget that if you have your own website, you can always forward to the API (and we encourage you to do so) the country of origin or IP of origin of your requests using the restriction= parameter. This will ensure that videos are properly filtered for the location where your user is. In this case, the X-GData-User-Country response header will return the country specified in the restriction parameter.
New Standard Feed: Most Popular
There's a new standard feed out there:http://gdata.youtube.com/feeds/api/standardfeeds/most_popular
It is different from most_viewed or top_rated in the sense that it uses a smarter algorithm to evaluate the popularity of a video. Oh, and if you're an international user, don't forget that the API supports standard feeds for all the countries YouTube does. For example, if you are interested in most popular videos in Germany, du kannst einfach:
http://gdata.youtube.com/feeds/api/standardfeeds/de/most_popular
** This is now called "Rising Videos" on the main site.
Same Authsub tokens for uploads.gdata.youtube.com and gdata.youtube.com
You can now use the same AuthSub token to query a user's inbox, to update a playlist or to upload a video, even with secure AuthSub. No need for hacks. Read more about AuthSub for YouTube in the docs.Programmatic login token is valid for 2 weeks
We have extended the life time of the authentication token obtained via ClientLogin from 1 day to 2 weeks. This will hopefully enable a better user experience for all clients of installed applications by not forcing them to login every day.Enjoy! If you have any questions or feedback, visit us in our developer forum.