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

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.

Can be printed in high-resolution

High-resolution maps

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.

Draw polygons and polylines on maps

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

No extra costs for printed maps

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:
https://maps.geoapify.com/v1/staticmap?style=osm-bright-smooth&width=800&height=600&center=lonlat:-74.004158,40.722619&zoom=12.1401&apiKey=YOUR_API_KEY
  • This API call retuns a static map image of the specified area:
https://maps.geoapify.com/v1/staticmap?style=osm-bright-smooth&width=800&height=600&area=rect:-74.04472450744129,40.69366453643252,-73.98100315654642,40.72408084086641&apiKey=YOUR_API_KEY

High-resolution maps

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:
https://maps.geoapify.com/v1/staticmap?style=toner&width=800&height=600&center=lonlat:-0.113019,51.503962&zoom=15.0858&apiKey=YOUR_API_KEY
  • scaleFactor = 2:
https://maps.geoapify.com/v1/staticmap?style=toner&scaleFactor=2&width=800&height=600&center=lonlat:-0.113019,51.503962&zoom=15.0858&apiKey=YOUR_API_KEY

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:

https://maps.geoapify.com/v1/staticmap?style=positron&width=800&height=600&center=lonlat:13.405672,52.519409&zoom=11.7625&marker=lonlat:13.357885880465687,52.51379161179807;type:awesome;color:%23bb3f73;size:x-large;icon:paw|lonlat:13.435403556257342,52.52559069888832;type:material;color:%234c905a;icon:tree;icontype:awesome|lonlat:13.384108273311824,52.54648810294509;type:material;color:%234c905a;icon:tree;icontype:awesome|lonlat:13.468449875005945,52.48931087952414;type:material;color:%234c905a;icon:tree;icontype:awesome|lonlat:13.416138151658686,52.485695501631085;type:material;color:%234c905a;icon:tree;icontype:awesome|lonlat:13.376173654521267,52.496637126048455;type:material;color:%234c905a;icon:tree;icontype:awesome|lonlat:13.414388320414929,52.508181651118974;type:material;color:%234c905a;icon:tree;icontype:awesome&apiKey=YOUR_API_KEY

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:

https://maps.geoapify.com/v1/staticmap?style=positron&width=800&height=600&geometry=polygon:2.303309440612793,48.87913539780315,2.305106520652771,48.87817579776886,2.305160164833069,48.87820049358877,2.3049724102020264,48.87939646227402,2.3049402236938477,48.87945290846696,2.303309440612793,48.87913539780315;fillcolor:%23ff1234&apiKey=YOUR_API_KEY

Add a GeoJSON

The following Static Map URL example shows how to add a geometry as a GeoJSON:

https://maps.geoapify.com/v1/staticmap?style=positron&width=800&height=600&geojson=%7B%22type%22%3A%22FeatureCollection%22%2C%22features%22%3A%5B%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%22linecolor%22%3A%22%23555555%22%2C%22linewidth%22%3A2%2C%22lineopacity%22%3A1%2C%22fillcolor%22%3A%22%235873f9%22%2C%22fillopacity%22%3A0.5%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B2.303309440612793%2C48.87913539780315%5D%2C%5B2.305106520652771%2C48.87817579776886%5D%2C%5B2.305160164833069%2C48.87820049358877%5D%2C%5B2.3049724102020264%2C48.87939646227402%5D%2C%5B2.3049402236938477%2C48.87945290846696%5D%2C%5B2.303309440612793%2C48.87913539780315%5D%5D%5D%7D%7D%5D%7D&apiKey=YOUR_API_KEY

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.

Static maps examples

Quick Start

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!

FAQ

What is Static Map?

Static maps is an API that generates map pictures in JPG or PNG format. So you can add them to a website, application with no JavaScript (or other code), or print them. The API allows setting map view, map style, adding map markers.

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.

World map

Ready to get started?

We have a Freemium pricing model. Start for free now and upgrade later!