
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.
http://local.yahooapis.com/MapsService/V1/geocode
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 <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. |
| output | string: xml (default), php | The format for the output. If php is requested, the results will be returned in Serialized PHP format. |
Sample Request Url:
http://local.yahooapis.com/MapsService/V1/geocode?appid=YD-.b1IAsQ_JXzHkvaZitXRNA--&street=701+First+Ave&city=Sunnyvale&state=CA
The schema document for this service response is located at http://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. |
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.416384</Latitude>
<Longitude>-122.024853</Longitude>
<Address>701 FIRST AVE</Address>
<City>SUNNYVALE</City>
<State>CA</State>
<Zip>94089-1019</Zip>
<Country>US</Country>
</Result>
</ResultSet>
The Geocoding service returns the standard errors.
The Geocoding service is limited to 5,000 queries per IP address per day. See information on rate limiting.
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.
All Yahoo! Maps Web Services are discussed on the yws-maps mailing list.
Copyright © 2008 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Copyright Policy - Job Openings