Sunday, August 5, 2012

Yahoo! Maps Web Services - Geocoding API

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

ParameterValueDescription
appidstring (required)The application ID. See Application IDs for more information.
streetstringStreet name. The number is optional.
citystringCity name.
statestringThe United States state. You can spell out the full state name or you can use the two-letter abbreviation.
zipinteger 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.
locationfree 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.

outputstring:xml(default),phpThe format for the output. If php is requested, the results will be returned inSerialized 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 athttp://local.yahooapis.com/MapsService/V1/GeocodeResponse.xsd

FieldDescription
ResultSetContains all of the query responses.
ResultContains 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.
LatitudeThe latitude of the location.
LongitudeThe longitude of the location.
AddressStreet address of the result, if a specific location could be determined.
CityCity in which the result is located.
StateState in which the result is located.
ZipZip code, if known.
CountryCountry in which the result is located.

Sample response

The following is a sample response for the geocode of the Yahoo! headquarters:

  1. xml version="1.0" encoding="UTF-8"?>
  2. <ResultSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xmlns="urn:yahoo:maps"
  4. xsi:schemaLocation="urn:yahoo:maps http://local.yahooapis.com/MapsService/V1/GeocodeResponse.xsd">
  5. <Result precision="address">
  6. <Latitude>37.416384Latitude>
  7. <Longitude>-122.024853Longitude>
  8. <Address>701 FIRST AVEAddress>
  9. <City>SUNNYVALECity>
  10. <State>CAState>
  11. <Zip>94089-1019Zip>
  12. <Country>USCountry>
  13. Result>
  14. 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

free counters
 
© Copyright Officiel Yahoo Blog 2011 - Some rights reserved | Powered by Blogger.com.
Template Design by Noval Blogger Bima | Published by Premium Wordpress Themes
Yahoo! Maps Web Services - Geocoding API - Officiel Yahoo Blog