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 <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:

  • city, state
  • city, state, zip
  • zip
  • street, city, state
  • street, city, state, zip
  • street, zip

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-9G7bey8_JXxQP6rxl.fBFGgCdNjoDMACQA--&street=701+First+Ave&city=Sunnyvale&state=CA

Response fields

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:
  • precision: The precision of the address used for geocoding, from specific street address all the way up to country, depending on the precision of the address that could be extracted. Possible values, from most specific to most general are:
    • address
    • street
    • zip+4
    • zip+2
    • zip
    • city
    • state
    • country
  • warning: If the exact address was not found, the closest available match will be noted here.
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:

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.

Ready to get started?