MapScale Docs

MapScale API

Contract-derived reference for auth, parameters, response codes, and curl examples.

Autocomplete

Session-priced place suggestions for search boxes and map pickers.

GET/v1/autocomplete

Autocomplete a place or address query

Autocomplete suggestions. Backed by Photon (v1) -> ES phonetic (v1.5). Billing SKU: autocomplete (per session, not per keystroke).

Public endpoint3 response codes6 parameters
NameInTypeRequired
qquerystringyes
langquerystringno
session_tokenquerystringno
bboxquerystringno
proximityquerystringno
typesquerystringno
200400404
curl
curl \
  -H "X-MapScale-Key: $MAPSCALE_API_KEY" \
  "https://api.mapscale.io/v1/autocomplete?q=13.7563&lang=example&session_token=example"
  • Geocoding

Geocoding

Forward, reverse, place detail and Thai administrative lookup endpoints.

GET/v1/admin-areas/reverse

Reverse lookup Thai administrative areas

Point-in-polygon admin-area lookup over geography.* (PostGIS ST_Contains). Billing SKU: geocode.

Public endpoint3 response codes2 parameters
NameInTypeRequired
pointquerystringyes
langquerystringno
200400404
curl
curl \
  -H "X-MapScale-Key: $MAPSCALE_API_KEY" \
  "https://api.mapscale.io/v1/admin-areas/reverse?point=13.7563&lang=example"
  • Geocoding
GET/v1/geocode

Geocode a place or address query

Forward geocode. Backed by Photon /api. Billing SKU: geocode.

Public endpoint3 response codes6 parameters
NameInTypeRequired
qquerystringyes
langquerystringno
limitqueryintegerno
bboxquerystringno
proximityquerystringno
countryquerystringno
200400404
curl
curl \
  -H "X-MapScale-Key: $MAPSCALE_API_KEY" \
  "https://api.mapscale.io/v1/geocode?q=13.7563&lang=example&limit=example"
  • Geocoding
GET/v1/place/{id}

Fetch a place by ID

Place details, by a photon:... id (from /v1/geocode or /v1/autocomplete) or a mapscale places.places uuid. Billing SKU: geocode (free if same session).

Public endpoint3 response codes2 parameters
NameInTypeRequired
idpathstringyes
langquerystringno
200400404
curl
curl \
  -H "X-MapScale-Key: $MAPSCALE_API_KEY" \
  "https://api.mapscale.io/v1/place/example-id?lang=example"
  • Geocoding
GET/v1/reverse

Reverse geocode coordinates

Reverse geocode. Backed by Photon /reverse, enriched with PostGIS admin-area names. Billing SKU: geocode.

Public endpoint3 response codes3 parameters
NameInTypeRequired
pointquerystringyes
langquerystringno
zoomqueryintegerno
200400404
curl
curl \
  -H "X-MapScale-Key: $MAPSCALE_API_KEY" \
  "https://api.mapscale.io/v1/reverse?point=13.7563&lang=example&zoom=example"
  • Geocoding

Routes

Directions and isochrones powered by Thailand-aware routing data.

GET/v1/isochrone

Build a travel-time isochrone

Time/distance reachability polygons around a point. Backed by Valhalla /isochrone. Billing SKU: routing.

Public endpoint3 response codes3 parameters
NameInTypeRequired
pointquerystringyes
profilequerystringno
contoursquerystringyes
200400502
curl
curl \
  -H "X-MapScale-Key: $MAPSCALE_API_KEY" \
  "https://api.mapscale.io/v1/isochrone?point=13.7563&profile=example&contours=100.5018"
  • Routing
GET/v1/route

Calculate a route with query parameters

Route between 2+ waypoints. Backed by Valhalla /route. Billing SKU: routing.

Public endpoint3 response codes4 parameters
NameInTypeRequired
coordinatesquerystringyes
profilequerystringno
alternativesquerybooleanno
langquerystringno
200400502
curl
curl \
  -H "X-MapScale-Key: $MAPSCALE_API_KEY" \
  "https://api.mapscale.io/v1/route?coordinates=13.7563&profile=example&alternatives=example"
  • Routing
POST/v1/route

Calculate a route with a JSON body

Route between 2+ waypoints. Backed by Valhalla /route. Billing SKU: routing.

Public endpoint3 response codes0 parameters
Request bodyOptional application/json
200400502
curl
curl \
  -X POST \
  -H "X-MapScale-Key: $MAPSCALE_API_KEY" \
  "https://api.mapscale.io/v1/route"
  • Routing

Matrix

Travel-time and distance matrices for dispatch, ranking and coverage checks.

POST/v1/matrix

Calculate a route matrix

Travel-time/distance matrix, capped at 25x25 in v1. Backed by Valhalla /sources_to_targets. Billing SKU: matrix (per element).

Public endpoint3 response codes0 parameters
Request bodyOptional application/json
200400502
curl
curl \
  -X POST \
  -H "X-MapScale-Key: $MAPSCALE_API_KEY" \
  "https://api.mapscale.io/v1/matrix"
  • Routing

Tiles

Vector tiles for interactive MapLibre maps.

GET/tiles/v1/{tileset}/{z}/{x}/{yFile}

Fetch a vector tile

Public endpoint3 response codes4 parameters
NameInTypeRequired
tilesetpathstringyes
zpathintegerno
xpathintegerno
yFilepathstringyes
200404503
curl
curl \
  -H "X-MapScale-Key: $MAPSCALE_API_KEY" \
  "https://api.mapscale.io/tiles/v1/example-tileset/1/1/example.json"
  • Tiles

Static maps

Server-rendered map images for previews, emails and sharing.

GET/v1/static/{lonLatZoom}/{sizeFile}

Render a static map image

Public endpoint5 response codes7 parameters
NameInTypeRequired
lonLatZoompathstringyes
sizeFilepathstringyes
styleIdquerystringno
langquerystringno
accentquerystringno
markersquerystringno
pathquerystringno
200400404502503
curl
curl \
  -H "X-MapScale-Key: $MAPSCALE_API_KEY" \
  "https://api.mapscale.io/v1/static/example-lonLatZoom/example.json?styleId=example&lang=example&accent=example"
  • Static maps

Styles

MapLibre style documents that reference MapScale tiles, glyphs and sprites.

GET/styles/v1/{styleId}

Fetch a MapLibre style

Public endpoint1 response codes4 parameters
NameInTypeRequired
styleIdpathstringyes
langquerystringno
accentquerystringno
hidequerystring[] | stringno
200
curl
curl \
  -H "X-MapScale-Key: $MAPSCALE_API_KEY" \
  "https://api.mapscale.io/styles/v1/example-styleId?lang=example&accent=example&hide=example"
  • Styles

Glyphs and sprites

Font ranges and sprite assets consumed by MapLibre styles.

GET/fonts/v1/{fontstack}/{rangeFile}

Fetch a glyph range

Public endpoint2 response codes2 parameters
NameInTypeRequired
fontstackpathstringyes
rangeFilepathstringyes
302503
curl
curl \
  -H "X-MapScale-Key: $MAPSCALE_API_KEY" \
  "https://api.mapscale.io/fonts/v1/example-fontstack/0-255.pbf"
  • Fonts
GET/sprites/v1/{styleId}/{filename}

Fetch a map sprite asset

Public endpoint2 response codes2 parameters
NameInTypeRequired
styleIdpathstringyes
filenamepathstringyes
302503
curl
curl \
  -H "X-MapScale-Key: $MAPSCALE_API_KEY" \
  "https://api.mapscale.io/sprites/v1/example-styleId/example.json"
  • Sprites

Health and contract

Public operational checks and the OpenAPI document.

GET/v1/health

Liveness probe

Public endpoint1 response codes0 parameters
200
curl
curl \
  -H "X-MapScale-Key: $MAPSCALE_API_KEY" \
  "https://api.mapscale.io/v1/health"
  • Health
GET/v1/status

Check dependency status

Public endpoint1 response codes0 parameters
200
curl
curl \
  -H "X-MapScale-Key: $MAPSCALE_API_KEY" \
  "https://api.mapscale.io/v1/status"
  • Health
POST/v1/trial-key

Create a limited publishable trial key

Creates a trial account and a browser-safe `pk_test_*` key for client-side MapScale integration. The key is restricted to tiles, autocomplete and static maps.

Public endpoint3 response codes0 parameters
Request bodyRequired application/json
201400429
curl
curl \
  -X POST \
  -H "X-MapScale-Key: $MAPSCALE_API_KEY" \
  "https://api.mapscale.io/v1/trial-key"
  • keys

On this page