Integrate enterprise-grade routing, elevation, geocoding, and timezone services into your applications.
The MapTools API is a small set of public HTTP endpoints that sit behind the tools on this website. There is no API key, account or sign-up: you call the same geocoding, elevation, routing and timezone services the site itself uses, and you get plain JSON back. The base URL for every endpoint is https://www.maptools.site, and all traffic must use HTTPS.
Conventions are deliberately boring. POST endpoints accept a JSON body with a Content-Type: application/json header; GET endpoints take query parameters. Every response — success or error — is a JSON object. Coordinates are always WGS 84 decimal degrees (EPSG:4326). Distances are returned in metres, durations in seconds and elevations in metres above sea level, so convert to miles or feet on your side if your users expect imperial units. Successful responses carry a source field naming the upstream open-data or mapping provider that produced the result; because more than one provider can answer, treat that field as information, not as part of your contract.
If you are new to geospatial data, the companion GIS documentation explains the coordinate systems, datums and file formats these endpoints deal with, and the developer playground tool lets you try requests from the browser before writing any code.
Calculates driving/walking distance and duration between origin and destination with optional intermediate waypoints and TSP sequencing.
| Name | Type | Required | Description |
|---|---|---|---|
| origin | { lat, lng } | Required | Start point of the route, as WGS 84 decimal degrees. |
| destination | { lat, lng } | Required | End point of the route, as WGS 84 decimal degrees. |
| waypoints | Array of { lat, lng } | Optional | Intermediate stops to visit on the way. They are visited in the order given unless optimize is set. |
| mode | string | Optional | Travel mode: "DRIVE" (default), "WALK" or "BICYCLE". |
| optimize | boolean | Optional | When true, the waypoint order is re-sequenced (travelling-salesman optimisation) to shorten the overall trip. |
curl -X POST "https://www.maptools.site/api/routes" \
-H "Content-Type: application/json" \
-d '{
"origin": {"lat": 40.7128, "lng": -74.006},
"destination": {"lat": 34.0522, "lng": -118.2437},
"mode": "DRIVE"
}'{
"distanceMeters": 4485000,
"durationSeconds": 147600,
"source": "google"
}distanceMeters (number) — Total route distance in metres.durationSeconds (number) — Estimated travel time for the route, in seconds.source (string) — Provider that computed the route ("google", or "fallback" when the built-in estimator answered).Samples ground surface elevation (in meters) along a polyline track or for discrete coordinates using the Copernicus DEM and SRTM digital elevation models served by Open-Meteo.
| Name | Type | Required | Description |
|---|---|---|---|
| locations | Array of { lat, lng } | Either / or | Discrete points to sample. Send either locations or path — not both. |
| path | Array of { lat, lng } | Either / or | Polyline vertices. Sample points are interpolated evenly along the line between vertices. |
| samples | number | Optional | How many points to sample along a path. Defaults to 50. Ignored when locations is used. |
curl -X POST "https://www.maptools.site/api/elevation" \
-H "Content-Type: application/json" \
-d '{
"path": [{"lat": 37.7456, "lng": -119.5936}, {"lat": 37.728, "lng": -119.573}],
"samples": 10
}'{
"results": [
{"elevation": 1214.5, "lat": 37.7456, "lng": -119.5936, "resolution": 90},
{"elevation": 2199.2, "lat": 37.728, "lng": -119.573, "resolution": 90}
],
"source": "open-meteo"
}results[].elevation (number) — Ground elevation in metres above sea level, rounded to one decimal place.results[].lat / results[].lng (number) — WGS 84 coordinates of the sampled point.results[].resolution (number) — Nominal ground resolution of the elevation sample, in metres (about 90 m for the Open-Meteo DEM grid).source (string) — Provider that supplied the samples: "open-meteo" or "google".Forward geocodes any postal address or landmark into high-precision WGS84 latitude and longitude coordinates. Send lat and lng instead of address to reverse geocode a coordinate pair into the nearest address.
| Name | Type | Required | Description |
|---|---|---|---|
| address | string (query) | Either / or | Free-text address, place name or landmark to forward geocode. URL-encode spaces and special characters. |
| lat | number (query) | Either / or | Latitude for reverse geocoding. Must be sent together with lng. |
| lng | number (query) | Either / or | Longitude for reverse geocoding. Must be sent together with lat. |
curl -X GET "https://www.maptools.site/api/geocode?address=Golden+Gate+Bridge"
{
"formattedAddress": "Golden Gate Bridge, San Francisco, CA, USA",
"coords": {"lat": 37.8199, "lng": -122.4783},
"source": "google"
}formattedAddress (string) — Human-readable address or place name of the best match.coords.lat / coords.lng (number) — WGS 84 coordinates of the match.components (array) — Structured address components (street, city, postal code, country) when the answering provider supplies them.source (string) — Provider that answered: "photon" (forward), "nominatim" (reverse) or "google".Resolves the authoritative IANA time zone ID, current UTC offset in seconds, and Daylight Saving Time (DST) status.
| Name | Type | Required | Description |
|---|---|---|---|
| lat | number (query) | Required | Latitude of the point, in WGS 84 decimal degrees. |
| lng | number (query) | Required | Longitude of the point, in WGS 84 decimal degrees. |
curl -X GET "https://www.maptools.site/api/timezone?lat=37.7749&lng=-122.4194"
{
"timeZoneId": "America/Los_Angeles",
"timeZoneName": "Pacific Daylight Time",
"rawOffset": -28800,
"dstOffset": 3600,
"totalOffsetSeconds": -25200,
"source": "google"
}timeZoneId (string) — IANA time zone identifier, for example "America/Los_Angeles" or "Europe/Berlin".timeZoneName (string) — Local name of the zone at the current date, for example "Pacific Daylight Time".rawOffset (number) — Standard (non-DST) offset from UTC, in seconds.dstOffset (number) — Daylight-saving adjustment in seconds — 3600 while DST is in effect, 0 otherwise.totalOffsetSeconds (number) — Effective offset right now: rawOffset + dstOffset.source (string) — Provider that resolved the zone.Errors are JSON too. A failed request returns an appropriate HTTP status code and a body of the form { "error": "Provide address or lat/lng" }. The three cases you will actually meet are:
The endpoints cache responses on the server, and repeated identical requests are answered from that cache — you can spot this from the X-Cache: HIT response header. Please cache on your side as well: geocoding and elevation results are stable reference data, so a well-behaved client can answer most repeat lookups locally. Batch related work into single calls where the endpoint allows it (the elevation endpoint accepts whole arrays of points), avoid polling endpoints for dashboards or live tracking, and keep the OpenStreetMap attribution intact wherever you display geocoded results. If you expect to make heavy use of the API, talk to us through the contact page before you launch.
No. The four endpoints documented on this page are public and need no key, token or sign-up. They are the same endpoints that power the tools on this website. In return, we ask that you follow the fair-use etiquette described above: cache responses, batch your requests, and avoid polling endpoints in a loop.
All coordinates are WGS 84 (EPSG:4326) decimal degrees — the same system GPS receivers and GeoJSON use. In JSON request bodies, points are objects with "lat" and "lng" properties, latitude first. Distances come back in metres, durations in seconds, and elevations in metres above sea level.
It names the upstream provider that produced that particular result — for example "open-meteo" for elevation samples, "photon" or "nominatim" for geocoding, and "google" where a Google service answered. The value can legitimately differ between requests, so always code against the documented response fields, never against a specific source value.
A 400 response means a required parameter is missing or malformed; the JSON body contains an "error" message explaining what to fix, so correct the request instead of retrying it unchanged. A 5xx response usually means a temporary problem at an upstream data provider — retry a few times with exponential backoff (wait 1, 2, then 4 seconds) and cache successful responses so you need fewer calls.
There is no published key-based quota for ordinary use. The endpoints are a shared free resource, so keep your traffic reasonable: send elevation points in one batched request instead of many single calls, cache results on your side, and do not poll for live-updating dashboards. Sustained heavy or abusive traffic may be throttled to keep the service available for everyone. If you expect heavy usage, reach us through the contact page first.
Yes, reasonable use in commercial projects is welcome. Keep in mind that the underlying open data keeps its own licence: geocoding results derive from OpenStreetMap data (© OpenStreetMap contributors, ODbL), so your product must carry the OpenStreetMap attribution where it displays those results. The API is provided for planning and information purposes — do not build life-critical navigation or safety systems on top of it.
Looking for the concepts behind the calls? Read the GIS & developer documentation, or browse the full tool directory to see the endpoints in action.