Request
POST https://isochronemaps.com/api/v1/route-lead
Content-Type: application/json
Authorization: Bearer wk_… (optional: your workspace key)
{ "mapId": "austin-demo", "lat": 30.2672, "lng": -97.7431 }
{ "mapId": "austin-demo", "address": "1100 Congress Ave, Austin, TX" }
{ "mapId": "austin-demo", "zip": "78702" }Response
{
"matched": true,
"matchedTerritory": "Austin Central",
"kind": "isochrone", // "zip" | "isochrone" | "radius" | null
"driveMinutes": 5, // the band's upper bound, for drive-time matches
"radiusMiles": null, // for radius matches
"rep": "central-team",
"zip": null, // the ZIP you sent, or the geocoded one
"distanceMiles": 0.24, // straight line to the nearest map centre or pin
"point": { "lat": 30.2672, "lng": -97.7431 },
"mapId": "austin-demo",
"tookMs": 0.4
}JavaScript
const res = await fetch("https://isochronemaps.com/api/v1/route-lead", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: `Bearer ${process.env.ISOCHRONEMAPS_KEY}` },
body: JSON.stringify({ mapId: "YOUR_MAP_ID", address: lead.address }),
})
const { matched, matchedTerritory, rep } = await res.json()
if (matched) assignTo(rep)Rule types
- ZIP list. A ZIP territory matches when the request’s ZIP is in its list, or when the point falls inside the territory’s ZCTA shapes.
- Drive time. A band matches when the point is inside its polygon.
driveMinutesis the band’s limit (a point in the 15-minute band but not the 5-minute band is “within 15 minutes”). - Radius. A circle matches when the point is inside it; circles are geodesic, so this equals a great-circle distance test.
Matching is a deterministic ray-casting point-in-polygon test, so the same input always gets the same answer. Build the shapes on the territory map, drive time map or radius map.
Authentication and limits
Your workspace key is created in your browser the first time you save a map, and shown under “Workspace and API key” on the studio’s Embed tab. Send it as Authorization: Bearer wk_…. Without it, or for maps another workspace saved, the free limits apply.
| Plan | Calls per map per day | Burst |
|---|---|---|
| Free Studio | 100 | 60 / min |
| Embed Pro | 1,000 | 300 / min |
| Territory Team | 5,000 | 300 / min |
| Routing API | 50,000 | 1,200 / min |
Errors
| Status | error | Meaning |
|---|---|---|
| 400 | bad_request | No lat/lng, address or 5-digit zip in the body. |
| 404 | map_not_found | The mapId does not exist. |
| 422 | address_not_found / zip_unknown | The address could not be placed, or the ZIP has no Census ZCTA (PO-box-only ZIPs). |
| 429 | rate_limited / daily_quota | Too many requests. Retry-After says when to try again. |
CORS is open, so you can call the API from a browser form. Do not put your workspace key in public front-end code; call it from your server or a form-handler function instead. Plans and limits are on the pricing page.
Frequently asked questions
How fast is the lead-routing API?
Requests with coordinates or a ZIP are answered from memory, typically in a few milliseconds of server time; the response includes tookMs. Requests with a street address add a geocoding step, which is usually under a second and cached afterwards.
Do I need an API key?
No key is needed to test against any saved map, within the free limits. Send your workspace key as a Bearer token to apply your plan's limits to maps your workspace saved.
What happens when a lead is in two areas?
The API returns one match, chosen in a fixed order: an explicit ZIP listed in a ZIP territory first, then the smallest containing area (ZIP territories, then drive-time bands from shortest, then radius circles from smallest).
Can I route by drive time without saving a map?
Routing runs against saved maps so that the boundary is fixed and every lead is judged against the same shape. Draw the drive-time bands in the studio, save, and use the map ID.
Is the result accurate enough to assign leads automatically?
Results depend on input data: address geocoding from OpenStreetMap, Census ZCTA boundaries for ZIPs and estimated free-flow drive times. Validate a sample of routed leads before using it for anything with financial or legal weight.