Yahoo! Maps Web Services - Geocoding API
Finding Latitudes and Longitudes
The Geocoding Web Service allows you to find the specific latitude and longitude for an address. You can use this service to geocode your points in advance or forego it altogether with built-in geocoding in our AJAX and Flash APIs.
This API has been deprecated (that is, no longer recommended for use by new developers). A new geocoding API called Yahoo! PlaceFinder is now available and provides more features than this API, including reverse geocoding (translating coordinates into street addresses) and WOEID support. Current developers using this API are encouraged to migrate to PlaceFinder.
Request URL
http://local.yahooapis.com/MapsService/V1/geocode
Request parameters
See information on constructing REST queries
Parameter | Value | Description |
---|---|---|
appid | string (required) | The application ID. See Application IDs for more information. |
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 | 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. |
output | string:xml(default),php | The format for the output. If php is requested, the results will be returned inSerialized PHP format. |
Sample Request Url:
Response fields
The schema document for this service response is located athttp://local.yahooapis.com/MapsService/V1/GeocodeResponse.xsd
Field | Description |
---|---|
ResultSet | Contains all of the query responses. |
Result | Contains each individual response. More than one result may be returned if the given address is ambiguous. Has attributes:
|
Latitude | The latitude of the location. |
Longitude | The longitude of the location. |
Address | Street address of the result, if a specific location could be determined. |
City | City in which the result is located. |
State | State in which the result is located. |
Zip | Zip code, if known. |
Country | Country in which the result is located. |
Sample response
The following is a sample response for the geocode of the Yahoo! headquarters:
- xml version="1.0" encoding="UTF-8"?>
- <ResultSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="urn:yahoo:maps"
- xsi:schemaLocation="urn:yahoo:maps http://local.yahooapis.com/MapsService/V1/GeocodeResponse.xsd">
- <Result precision="address">
- <Latitude>37.416384Latitude>
- <Longitude>-122.024853Longitude>
- <Address>701 FIRST AVEAddress>
- <City>SUNNYVALECity>
- <State>CAState>
- <Zip>94089-1019Zip>
- <Country>USCountry>
- Result>
- ResultSet>
Errors
The Geocoding service returns the standard errors.
Rate Limit
The Geocoding service is limited to 5,000 queries per IP address per day. See information on rate limiting.
Terms of Use
Use of the Yahoo! Maps APIs is governed by the Yahoo! Maps APIs Terms of Use and the Yahoo! Maps Terms of Use. These Terms of Use supplant the general Yahoo! Developer Network Terms of Use. See also the Usage Policy for more information about acceptable usage of these APIs or to request additional queries.
Support & Community
All Yahoo! Maps Web Services are discussed on the yws-maps mailing list.
0 comments:
Post a Comment