Yahoo! Maps Web Services - Map Image API
Map Image - Getting a map
The Map Image API from Yahoo! Maps provides a reference to a map graphic generated according to the parameters you specify in your request. You can specify lat/long or address in your request. This API returns a reference to a static map image in PNG format.
Request URL
http://local.yahooapis.com/MapsService/V1/mapImage
How do I get started?
- Online Documentation
Read the online documentation below and FAQs.
- Get an Application ID
To access Yahoo! Search Web services, you will need to get an application ID. Like a browser's User-Agent string, the Application ID uniquely identifies your application and has no effect on rate limiting.
- Download the SDK
The development kit includes BSD licensed examples and libraries for various languages: Perl, Python and PHP, Java, JavaScript, and Flash.
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:
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. |
| image_type | png (default) or gif | The image format for the map. |
| image_height | integer: 10 to 2000 (default: 500) | The height of the image being generated, in pixels. |
| image_width | integer: 10 to 2000 (default: 620) | The width of the image being generated, in pixels. |
| zoom | integer: 1 to 12 (default: 6) | The zoom level for the map, from 1 (street level) to 12 (country level). If a radius is specified, this is ignored. |
| radius | float | How far (in miles) from the specified location to display on the map. The default radius varies according to the location given and the zoom level. |
| 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/mapImage?appid=YD-4g6HBf0_JX0yq2IsdnV1Ne9JTpKxQ3Miew--&street=701+First+Avenue&city=Sunnyvale&state=CA
Response fields
There is no schema for this service.
| Field | Description |
|---|---|
| Result | The URL of the image file corresponding to the requested map. Has an optional attribute:
|
Sample response
The following is a sample response for a map of the Yahoo! headquarters:
Displaying the map image using PHP
This example uses PHP to make the image request, requesting serialized php output and then displays the image.
Errors
The Map Image service returns the standard errors.
Rate Limit
The Maps Image service is limited to 50,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.
Recent Blog Articles
SearchMonkey Rides with the Semantic Web Gang
August 29, 2008
Show off the videos of your favourite band with the Yahoo Music API
August 29, 2008
August 28, 2008
August 22, 2008


Send Your Suggestions