File Under: Multimedia

YouTube Gets Local With API Update

YouTubeYouTube announced V2 of its API, and with it the option to search based on location. Users uploading videos have been able to add geotags for over a year, and they’ve been viewable by location in Google Earth for almost as long. There hasn’t been a way for others to access the location data until now.

Using the API, you can now search videos by location, or a combination of location and a search term. For example, here is an XML result of videos containing the term “internet” within five miles of Wired’s offices.

To implement location search, there are two new parameters, location and location-radius, in the search API. You can find out more in the YouTube API reference.

YouTube also added versioning to its API, and dubbed this new release version 2. Providing the option to bake the version number into API calls means that applications written on top of the API shouldn’t break. Though the YouTube API will move forward, code you write today should still work. In other words, YouTube is preparing for backwards compatibility.

If you’ve written something using the previous YouTube API, you probably ought to toss v=1 into the parameters. On the other hand, if you’re new to all this, check out our YouTube Data API tutorial.

See also: