Static Images API

Introduction

The Static Images API serves standalone, static map images generated from NextBillion.ai styles. These images can be displayed on web and mobile devices without the aid of a mapping library or API. They look like an embedded map, but do not have interactivity or controls.

Center-based image

GET

https://api.nextbillion.io/maps/{mapId}/static/{lat},{lon},{zoom}/{width}x{height}{scale}.{format}?key={your_api_key}

Request Parameter

Loading..

Sample Request

curl --location 'https://api.nextbillion.io/maps/hybrid/static/33.93,-118.12,9/512x512.png?key=<your_api_key>'

Sample Image

documentation imagee

Bounds-based image

Generates a raster image based on the given bounds.

GET

https://api.nextbillion.io/maps/{mapId}/static/{miny},{minx},{maxy},{maxx}/{width}x{height}{scale}.{format}?key={your_api_key}

Request Parameter

Loading..

Example

https://api.nextbillion.io/maps/hybrid/static/-11.54,34.1,23.6,52.96/512x512.png?key=Your_API_Key

Sample Image

documentation imagee

Auto-fitted image

Generates a raster image based on the given features. The area is calculated so that all the paths and markers given in the query are visible.

GET

https://api.nextbillion.io/maps/{mapId}/static/auto/{width}x{height}{scale}.{format}?key={your_api_key}

Request Parameters

Loading..

Example

https://api.nextbillion.io/maps/streets/static/auto/512x512.png?path=stroke:green|width:3|fill:none|5.9,45.8|5.9,47.8|10.5,47.8|10.5,45.8|5.9,45.8&key=Your_API_Key

Sample Image

documentation imagee

API Error Codes

Response codeDescriptionAdditional notes
200Normal success case.Normal success case.
400Input validation failed.There is a missing or an invalid parameter or a parameter with an invalid value type is added to the request.
401APIKEY not supplied or invalidThis error occurs when the wrong API key is passed in the request or the key is missing altogether
403APIKEY is valid but does not have access to requested resourcesYou might be querying for a geographical region which is not valid for your account, or requesting a service which is not enabled for you.
404Requested host/path not foundThis error occurs when a malformed hostname is used.
414Request is too longThis error occurs when the URI is too long. Maximum allowed length is 8192 bytes.
422Could not process the requestThe requested tiles were not found. Please check the input request. Reach out to [email protected] if the issue persists.
429Too many requestsQPM limit or API usage quota reached.
500Internal Service error.There was an internal issue with NextBillion.ai services. You can reach out to [email protected] for an explanation.