Static Maps API
Create map pictures with markers and geometries
The Static Maps API lets you create map images in PNG or JPG format. Once created, these images can be added to webpages or printed on paper.
With the Static Maps API, you can choose from a wide variety of map styles, add markers to a map, and draw lines and shapes on it.
This Live Demo illustrates a static map for a single location. You can try to select a different location, map style, or map view:
At the Static Maps Playground, you can try to generate maps with multiple markers. Check out the documentation page to learn about API options and map URL examples.
About Geoapify Static Maps
Multiple map markers
Add multiple map markers to your map. You can choose different types of marker icons. You can also change the icon’s shape, size, and color of the markers.
Marker icons are generated by the Map Markers API.
The Static Maps API can be used to generate big-size and high-resolution map pictures. The API supports JPEG and PNG image formats.
You can get a map of up to 4096 x 4096 pixels with the standard API endpoints. We can also provide you with bigger sizes upon request.
Polylines and polygons on maps
To your map images, you can add geometries (circles, rectangles, lines, and polygons). So you can highlight areas and draw routes.
You can specify the fill color and opacity for shapes and stroke width, line style, and more. Read more details about the drawing options on the Static Maps API documentation >>.
Storing and printing at no extra costs
We use OpenStreetMap as a base for our maps, so you can cache, store and redistribute the generated maps at no extra cost.
However, it is necessary to credit OpenStreetMap and other contributors by providing appropriate attributions properly. Learn more about attributions on our documentation page >>
Static maps examples
Here are a few static map examples that demonstrate how to create different map views, prepare for print and add map markers.
Different map views
- This API call generates a static map using map center and zoom to define map view:
- This API call retuns a static map image of the specified area:
Geoapify Static Map API allows the creation of high-resolution map images. You can increase the resolution of the map up to 8 times with the scaleFactor parameter. So you can generate high-quality pictures for print media.
- No scaleFactor specified:
- scaleFactor = 2:
By default, the maximal scale factor is 2. Bigger values are possible upon request. For more information on this, please email us.
Adding map markers
You can place multiple markers on the map with the markers parameter. You can also change the marker icons using our Map Marker Icon API:
Add a polygon
You can add a single geometry or multiple geometries to the map - circles, rectangles, polylines, polygons. Here is an example of a URL with a polygon:
Add a GeoJSON
The following Static Map URL example shows how to add a geometry as a GeoJSON:
What's about static maps price?
Geoapify has a Freemium pricing model, so it's free to start and simple to scale as you grow. We calculate your usage in credits. The Free pricing plan includes 3000 credits/day.
Because the API uses a combination of map tiles and map icons inside, it's hard to get the exact cost in credits. However, here are a few principles that may help to roughly estimate the cost:
- Estimate how many tiles you'll need to cover the map. You can get roughly the number of tiles needed by dividing map size to map tile size. As one tile is 256x256 px, the NUMBER_OF_TILES = MAP_WIDTH x MAP_HEIGHT / (256 * 256).
- Count the NUMBER_OF_MARKERS you add to the map.
Then you can use the Credits Calculator to estimate how many credits you'll need.
Example 1. If you would like to request the 4096 x 4096 map, it will cost you 65 credits per request. You can generate up to 46 (~ 3000 / 65) such maps every day for Free.
Example 2. When you render a 1280 × 1024 map showing 100 places, it will cost you 106 credits per request.
Please be aware that the number of tiles will increase when you use the pitch parameter to create perspective images.
Step 1. Get API Key
To start using Geoapify API, you need to register an account on MyProjects Geoapify, create a new project and get an API Key.
For more information about Geoapify projects and API keys, visit the Getting Started page.
Step 2. Generate Static Map URL
You can use the Static Map Playground to generate map URL.
Here is where you would configure the map view and add markers. The markers used on the map can be generated with the Marker Icon API.
Step 3. Embed as an image, HTML, or CSS
The Playground provides the map URL and the code to embed the map with HTML or CSS. Just copy & paste it!
What is Static Map?
What file formats can static maps be saved as?
Geoapify Static Maps API returns map pictures in JPG and PNG formats.
What is the pricing for the Static Maps API?
Static Maps API calls are calculated as a combination of Map Tile requests and Market Icon API requests required to visualize the map. Check our Pricing for Map Tiles. You can roughly estimate the number of tiles by dividing the area of the static map by the area of a map tile. For example, width x height / (256 x 256). Please note that when a pitch parameter is different than 0, the number of tiles can be bigger.
Can I cache static map images?
Yes, you can. But the map attribution should stay.
Can I generate a map image for the retina screen?
Yes, you need to provide scaleFactor=2 to the map URL. Read more about Static Map API parameters >>
What is the maximal map image size I can generate with Static Maps API?
The maximal map image width and height is 4096px. Contact us if you need bigger pictures.
Can I display routes and other geometries on the map?
Not at the moment, but the feature is coming soon.
Can I use the print version of the map in commercial products? How do you calculate the price?
Geoapify is a service provider, but we don't own the data. That means that you pay us for the map generation, but not for the map by itself. So you are free to use generated maps in commercial products without extra costs. However, note that you need to provide the appropriate attributions. Read more about required attributions on the documentation page.