Contact salesGet a free key

Docs

On this page
The examples use YOUR_KEY. Get a free key to run them; it takes about a minute and needs no card.Get a free key

Quickstarts

Machine-readable: OpenAPI 3.1 spec · llms.txt · this page as Markdown

Getting started

Get a key from the dashboard. Every request takes it as ?key=ps_… or as an Authorization: Bearer ps_… header. The base URL is https://api.mapiron.com.

curl "https://api.mapiron.com/v1/geocode?q=Oswego%20IL&limit=1&key=YOUR_KEY"

JavaScript:

const r = await fetch("https://api.mapiron.com/v1/geocode?q=" + encodeURIComponent("Oswego IL") + "&limit=1", {
  headers: { Authorization: "Bearer YOUR_KEY" }
});
const { features } = await r.json();
const [lng, lat] = features[0].geometry.coordinates;

Python:

import requests
r = requests.get("https://api.mapiron.com/v1/geocode", params={"q": "Oswego IL", "limit": 1},
                 headers={"Authorization": "Bearer YOUR_KEY"}, timeout=10)
lng, lat = r.json()["features"][0]["geometry"]["coordinates"]

PHP (for example in WordPress):

$url = "https://api.mapiron.com/v1/geocode?" . http_build_query(["q" => "Oswego IL", "limit" => 1, "key" => "YOUR_KEY"]);
$data = json_decode(file_get_contents($url), true);
[$lng, $lat] = $data["features"][0]["geometry"]["coordinates"];

Static images

GET /v1/static returns an image. Give a center and zoom, or let us fit the view to your markers, path or area.

ParameterMeaningDefault
centerlat,lngfitted
zoom0 to 20, decimals allowedfitted
sizeWIDTHxHEIGHT, each 16 to 1280600x400
scale2 for high-density screens1
stylelight, dark, white, grayscalelight
formatpng, jpg, webppng
markersUp to 25 points: lat,lng|lat,lng
marker_colorHex coloure11d48
pathA line through 2 to 200 points: lat,lng|lat,lng|…
path_color, path_widthHex colour; 1 to 12 px2563eb, 4
paddingPixels kept clear around fitted content40
<img src="https://api.mapiron.com/v1/static?markers=41.8781,-87.6298|41.6828,-88.3515&size=600x300&scale=2&key=YOUR_KEY"
     width="600" height="300" alt="Map from Chicago to Oswego">

Images are deterministic: the same URL gives the same picture, so cache them for as long as your plan allows. On the Free plan, images carry a small "Map by mapiron.com" mark in the bottom-left corner; paid plans have none.

Privacy area mode

For listings, deliveries or anything where the exact address should stay private. Send the real point as area; we snap it to a grid, draw a shaded circle, and add no pin.

ParameterMeaningDefault
areaThe point as lat,lng, ideally already rounded to the grid (below)
radiusCircle radius in metres, 100 to 25000. Raised if needed so the circle always contains the real point.1000
snapGrid size in degrees, 0.005 to 0.1 (anything smaller, including 0, uses 0.005). 0.01 is about 1 km.0.01
colorHex colour of the circle0f766e
https://api.mapiron.com/v1/static?area=41.68,-88.35&size=640x300&key=YOUR_KEY

Every address in the same grid cell gets the identical image, so viewers can't narrow the location down by comparing maps. Whatever you put in area is visible to anyone who views the page, so round it to the grid on your server first: Math.round(lat / snap) * snap, and the same for lng (41.6843 becomes 41.68 with the default 0.01). The image is identical, and the page shows only the grid point. See privacy-safe listing maps for a full walkthrough.

Address search

GET /v1/geocode?q=… returns GeoJSON features, best match first. /v1/autocomplete takes the same parameters and suits type-ahead boxes; each call counts as one lookup, so wait for a short pause in typing (about 250 ms) before calling it.

ParameterMeaning
qText to search for (required)
limit1 to 20, default 5
lat, lonPrefer results near this point
bboxminLon,minLat,maxLon,maxLat to restrict results
langen, de, fr or default (local names)
layerFilter: house, street, city, county, state, country and more
curl "https://api.mapiron.com/v1/geocode?q=4%20Yorkville%20Rd%20Oswego&limit=1&key=YOUR_KEY"

Paid plans may store and reuse results indefinitely; Free results may be stored for up to 30 days. Each response carries a license field that says which applies. US house-number coverage follows OpenStreetMap and varies by area; street and town results are reliable everywhere.

Reverse lookup

GET /v1/reverse?lat=…&lon=… returns the nearest address or place. Optional radius (km), limit, lang.

Schools & districts

GET /v1/schools?lat=…&lon=… returns the US public school districts at a point and, grade by grade, the assigned public school with its attendance zone. It comes with platform and enterprise contracts, not with self-serve plans. See Schools & districts.

Texas special districts

GET /v1/districts?lat=…&lon=… returns the Texas municipal utility districts, water control and improvement districts, management districts and PIDs that contain a point, with each district's self-reported tax rate and debt, its website and the statute for the purchaser's notice. Growth plans and up. See Texas special districts.

Parcel lines

GET /v1/parcels?lat=…&lon=… returns the property parcel at a point: its boundary, the county parcel number (APN) and its area, from open government records. Draw parcel lines on static images with parcels=1, highlight one with parcel=…, or add the vector or raster parcel overlay to an interactive map. Growth plans and up. See Parcel lines.

Raster tiles

256-pixel PNG tiles, with @2x for sharp screens. Use them with Leaflet, OpenLayers or anything that takes an XYZ URL. A typical map view loads about 16 tiles.

L.tileLayer("https://api.mapiron.com/v1/tiles/light/{z}/{x}/{y}@2x.png?key=YOUR_KEY", {
  tileSize: 256, maxZoom: 19,
  attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap contributors</a>'
}).addTo(map);

Vector tiles & styles

For MapLibre GL, point the map at a style. Fonts, icons and tile URLs inside it already carry your key.

new maplibregl.Map({
  container: "map",
  style: "https://api.mapiron.com/v1/styles/light.json?key=YOUR_KEY",
  center: [-88.35, 41.68], zoom: 12
});

Styles: light, dark, white, grayscale. Raw tiles are at /v1/tiles/vector/{z}/{x}/{y}.pbf (Protomaps schema, zoom 0 to 15), described by /v1/tiles/vector.json.

Keys & websites

Keys used in web pages are visible to visitors. In the dashboard, limit such a key to your websites (for example example.com, *.example.com); requests from other sites are refused. Keep an unrestricted key on your server only. Revoking a key takes effect within a minute. Free accounts have 1 key, the 14-day Growth trial 3, and paid plans up to 20.

Plans, caps & errors

Each plan has a monthly cap per product (see Pricing). Caps reset on the 1st of each month (UTC). We email the account at 80% and at 100% of a cap. Paid plans can raise a month's caps with a one-time top-up pack from the dashboard ($20 for 100,000 images, 100,000 lookups and 1,000,000 tiles; never automatic). The Free plan also allows 5 requests a second per account, with bursts up to 60, and the Growth trial 25 a second; paid plans have no per-second limit.

Errors are JSON with an error code and a readable message you can show to people. 429 answers carry Retry-After in seconds. Every code, with what to do about it: openapi.json (Error schema).

StatuserrorMeaning and what to do
400bad_requestA parameter is missing, malformed or out of range, or the query string or path couldn't be parsed. Fix the request. Don't retry unchanged.
401missing_keyA metered endpoint got no API key. Add the key.
401invalid_keyThe key is unknown, revoked, or is a management token (psm_) used on a map endpoint. Use a live ps_ key from the dashboard.
403referer_deniedThe key is limited to other websites and the request's Origin/Referer isn't one of them. Add the site to the key's websites in the dashboard, or use a server-side key.
403plan_upgrade_requiredA data product the plan doesn't include (parcel lines, Texas special districts on Free/Starter). Upgrade (Growth or higher).
404not_foundNo such path, tile, style, key, webhook, release or record (also every admin, edge and ops path to anyone not allowed to see it, so they look like unknown paths). Check the URL or ID.
405method_not_allowedThe path exists but not with this HTTP method (also GET/DELETE on the MCP endpoint, which is POST-only). Use a method from the Allow header.
409privacy_mode_activeA static map asked for parcel lines together with a privacy area. Drop one of the two.
413payload_too_largeThe request body is over the endpoint's size limit. Send a smaller body (split batches).
415unsupported_media_typeA POST/PATCH endpoint that takes JSON got another Content-Type. Set Content-Type: application/json.
422invalid_bodyA JSON body is valid JSON but is missing a field or has a value of the wrong type. Fix the body. Don't retry unchanged.
429monthly_cap_reachedThe account's (scope account) or the key's own (scope key) hard monthly cap for this product is used up. Nothing is ever billed for overage. Includes product, cap, resets, upgrade_url, scope. Upgrade, buy a top-up pack, raise the key's cap, or wait for resets (1st of the month, UTC).
429slow_downA short-window rate limit: the Free/trial per-second limit, key creation rate, too many sign-in or checkout attempts, passkey requests, or downloads running at once. Wait for Retry-After (1 second for per-second limits; up to an hour for sign-in and checkout limits).
429daily_limit_reachedA per-day limit: school-data pipeline downloads per licence, test-kit requests per address or network. Wait for Retry-After (up to 24 hours) or contact sales.
500internalA bug or database error on our side. The cause is logged on the server and never sent to the client. Retry once; if it persists, email support@mapiron.com with the time of the request.
502engine_errorThe map renderer or geocoder didn't answer (overloaded or restarting). Retry with backoff (1 s, 2 s, 4 s).
503unavailableA feature isn't configured or is switched off on this server (billing, email, a data release), or sign-ups are closed. Retry later or contact support.

Attribution

Map data comes from OpenStreetMap under the Open Database License. Show © OpenStreetMap contributors near any map or results you display, linked to openstreetmap.org/copyright (opens in a new tab). Static images already include it in the corner. MapIron is not affiliated with or endorsed by the OpenStreetMap Foundation.

↑ Contents