Yahoo Local API Now Lets You Search Along Routes

Earlier this week Yahoo announced the release of a new version of its Yahoo Local Search API. This new release adds some interesting functionality: it allows developers to issue queries to the API based on a route.

According to Yahoo:

We are releasing a new version of the Yahoo! Local API (V3), that gives developers a key new feature – the ability to search for convenient points of interest for a given user defined route. For example, as you are driving from San Francisco to Sacramento, you could search for a Starbucks or for a hardware store.

The RESTful API now includes a “route” parameter that is a series of latitude/longitude coordinates, with the first pair of coordinates as the starting point and the last pair of coordinates as the ending point. A string sent as the route paramater would be structured as follows:

lat1 long1,lat2 long2,...,latn longn

The API returns XML, JSON, or serialized PHP. If you request the response in JSON, you can include a Callback parameter to a JavaScript Function. I put together the example below to demonstrate how the new Local Search API can be used in conjunction with Yahoo! Maps to display pizza restaurants along a route in Portland, Oregon (the example below requests data in JSON format and includes a callback parameter request).

Yahoo! Local Route Search Results

This is the first API to add route-based search functionality, and it certainly enhances developer's ability to improve local search results for a variety of mashups and applications that use Yahoo! Local Search.

Our Yahoo! Local Search API profile includes additional information on the API and lists several mashups that use this API, including Ski Bonk and Boston T Subway Map. Additional Documentation on the API is available on the Yahoo Developer Network.

We're excited to see some route-based mashups emerge in the near future.

Be sure to read the next Mapping article: 3 Ways to Improve Your Map Mashup