
The latest version of the Local Search Web Service allows you to search the Internet for businesses near a specified location, and now returns both the latitude and longitude and Yahoo! user ratings of the establishment.
The Local Search service is discussed on the yws-search-general mailing list.
http://local.yahooapis.com/LocalSearchService/V2/localSearch
See information on constructing REST queries
| Parameter | Value | Description |
|---|---|---|
| appid | string (required) | The application ID. See Application IDs for more information. |
| query | string (required) | The query to search for. |
| results | integer: default 10, max 20 | The number of results to return. |
| start | integer: default 1 | The starting result position to return (1-based). |
| sort | relevance (default), title, distance, or rating | Sorts the results by the chosen criteria. |
| radius | float | How far (in miles) from the specified location to search for the query terms. The default radius varies according to the location given. |
| street | string | Street name. The number is optional. |
| city | string | City name. |
| state | string | The United States state. You can spell out the full state name or you can use the two-letter abbreviation. |
| zip | integer or <integer>-<integer> | The five-digit zip code, or the five-digit code plus four-digit extension. If this location contradicts the city and state specified, the zip code will be used for determining the location and the city and state will be ignored. |
| location | free text |
This free field lets users enter any of the following:
If location is specified, it will take priority over the individual fields in determining the location for the query. City, state and zip will be ignored. |
| latitude | float: -90 to 90 | The latitude of the starting location. |
| longitude | float: -180 to 180 | The longitude of the starting location. If both latitude and longitude are specified, they will take priority over all other location data. If only one of latitude or longitude is specified, both will be ignored. |
| output | string: xml (default), json, php | The format for the output. If json is requested, the results will be returned in JSON format. If php is requested, the results will be returned in Serialized PHP format. |
| callback | string | The name of the callback function to wrap around the JSON data. The following characters are allowed: A-Z a-z 0-9 . [] and _. If output=json has not been requested, this parameter has no effect. More information on the callback can be found in the Yahoo! Developer Network JSON Documentation. |
Sample Request Url: http://local.yahooapis.com/LocalSearchService/V2/localSearch?appid=YahooDemo&query=pizza&zip=94306&results=2
The schema document for this service response is located at http://local.yahooapis.com/LocalSearchService/V2/LocalSearchRepsonse.xsd
| Field | Description |
|---|---|
| ResultSetMapUrl | The URL of a webpage containing a map graphic with all returned results plotted on it. |
| ResultSet |
Contains all of the query responses. Has attributes:
|
| Result | Contains each individual response. |
| Title | Name of the result. |
| Address | Street address of the result. |
| City | City in which the result is located. |
| State | State in which the result is located. |
| Phone | Phone number of the business, if known. |
| Latitude | The latitude of the location. |
| Longitude | The longitude of the location. |
| Rating | An enclosure tag for rating information. |
| AverageRating | Average score of end-user ratings for the business or service. |
| TotalRatings | The total number of ratings submitted for the business or service. |
| TotalReviews | The total number of reviews submitted for the business or service. Reviews can be viewed at the location pointed to by the ClickUrl tag. |
| LastReviewDate | The date of the last review submitted for the business or service unix timestamp format. |
| Distance |
The distance as calculated by one of the following methods:
|
| Url | The URL to the detailed page for a business. |
| ClickUrl | The URL for linking to the detailed page for a business. See URL linking for more information. |
| MapUrl | The URL of a map for the address. |
| BusinessUrl | The URL of the businesses website, if known. |
| BusinessClickUrl | The URL for linking to the businesses website if known. See URL linking for more information. |
The following is a sample response for the query pizza in zip code 94306:
The Local Search service is limited to 5,000 queries per IP address per day. See information on rate limiting.
The Local Search service returns the standard errors. There are no service-specific errors.
Copyright © 2008 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Copyright Policy - Job Openings