The viewport request
Every parameter, how zoom picks the detail level, and the caching headers.
Livehttps://api.offendersearch.appSandboxhttps://sandbox.offendersearch.appThe request
GET /v1/map/viewport answers one map view. Call it when the map first loads and each time it stops moving. One call is one map request.
curl -G https://api.offendersearch.app/v1/map/viewport \
-H "X-API-Key: $OFFENDERSEARCH_KEY" \
-d bbox=-83.2,39.8,-82.8,40.1 \
-d zoom=10Parameters
Every query parameter and header, with its type, default and an example, is in the request table below. The ones a map sends on every call are bbox and zoom; center with radiusMiles answers a circle instead (see Near an address), and sandbox=true puts the request in test mode.
Send bbox, or center with radiusMiles. Not both.
The optional X-End-User header carries any id you choose for the person using the map. It is read on this route and on POST /v1/map/area. See Limits & errors.
How the zoom picks the detail level
| Effective zoom | mode | Returned |
|---|---|---|
| 3–12 | clusters | A count for each grid cell, with its extent and a breakdown. |
| 13–14 | pins | One pin for each address: a position, with no name. |
| 15+ | markers | Pins with a name label and basic fields. |
The effective zoom is worked out like this:
- It starts as the
zoomyou sent. If you sent none, it is the zoom at which the box is about four map tiles wide. - If the box covers more than 64 map tiles at that zoom, the zoom is lowered until it fits.
- It is never lower than 3.
The response states the zoom that was used, in zoom, and the level, in mode. Draw from mode, not from your own zoom.
Any size of area
There is no largest box. A view of a whole country is answered as clusters, in one map request, at the same price as a view of one street. A wide box is simply answered at a lower zoom.
The 300-pin rule
A response holds at most 300 pins. A view at zoom 13 or closer with more than that is answered as clusters on a finer grid, with mode: "clusters". Each cluster’s expansionZoom says how far to zoom for it to come apart.
The response
{
"mode": "clusters",
"zoom": 10,
"bbox": [-83.2, 39.8, -82.8, 40.1],
"datasetVersion": "2026-10-12",
"total": 508,
"breakdown": {
"street": 508, "housed": 247, "homeless": 96, "incarcerated": 0
},
"clusters": [
{
"id": "c10_1103_1551",
"lat": 39.9612, "lng": -82.9988,
"count": 412,
"bbox": [-83.06, 39.91, -82.97, 39.98],
"expansionZoom": 11,
"breakdown": {
"street": 412, "housed": 201, "homeless": 77, "incarcerated": 0
}
}
],
"markers": [],
"areas": [],
"unplaced": {"count": 96, "states": ["OH"]},
"notice": "A pin shows a registered address, not a person's current location.",
"sandbox": true
}Every response field is in the response table below. What to draw is in clusters, markers and areas, and each of those objects is defined once, in Clusters & markers.
Markers are sorted by distance from the centre of the view.
Sex offender map API: GET /v1/map/viewport request and response fields
What to draw for one map view: clusters, pins or named pins of registered sex offenders. Send the view as bbox, or as center with radiusMiles. One map request per answer, whatever the view holds; a 304, test mode and errors are free.
Request
| Field | Type | Description |
|---|---|---|
| X-API-Key required | string | A secret API key (from your server), or a map browser key os_map_pk_… sent from a site on that key's list. A dashboard session can send Authorization: Bearer <token> instead. |
| X-End-User optional | string | Any id you use for the person behind this request. Their pin views are then also counted against the per-end-user daily area budget (2,000 distinct areas), so one heavy user is stopped before the account is. |
| If-None-Match optional | string | The ETag of an earlier answer for the same view. An unchanged view answers 304 with no body and is not billed. |
| Field | Type | Description |
|---|---|---|
| bbox optional | string | The view, west,south,east,north in degrees. Any size: a wide box is answered at a lower zoom, never refused. A box crossing the date line has west greater than east. Send bbox, or center with radiusMiles, not both.Example "-83.5,39.6,-82.4,40.3" |
| center optional | string | Instead of bbox: lat,lng in degrees. Requires radiusMiles. Only what is inside the circle comes back.Example "39.9612,-82.9988" |
| radiusMiles optional | number | With center: the radius in miles, 0.1 to 100.Example 0.5 |
| zoom optional | number | The map's current zoom, 0 to 22; a fraction is floored. Leave it out and the zoom at which the box is about four tiles wide is used. Example 13 |
| format optional · default "json" | string one of "json", "geojson" | json for the response below, geojson for a MapGeoJson FeatureCollection (application/geo+json). |
| detail optional · default "full" | string one of "full", "count" | full for what to draw, count for numbers only (mode: "count", no ids). |
| housing optional | string | Keep only people with these housing statuses: one or more of housed, homeless, incarcerated, comma-separated. Leave it out to keep everyone.Example "homeless,incarcerated" |
| precision optional | string one of "street", "any" | street keeps only people with an exact street address. any, or leaving it out, keeps everyone. |
| sandbox optional · default false | boolean | true answers in test mode: made-up people around eight US cities, in the real response shape, never billed, no plan needed. |
Response
The answer for this view. Every answer carries Cache-Control: private, max-age=300 and an ETag.
| Field | Type | Description |
|---|---|---|
| mode | string one of "clusters", "pins", "markers", "count" | What this answer holds. clusters at zoom 3 to 12, or for a closer view holding more than 300 pins. pins at zoom 13 and 14. markers (pins with names) at zoom 15 and closer. count with detail=count: numbers only, and clusters, markers and areas are empty. |
| zoom | integer | The effective zoom this view was answered at: your zoom (or the one derived from the box), lowered until the box fits in 64 map tiles, never below 3. |
| bbox | array of number | The box answered, [west, south, east, north] in degrees. For a radius request it is the box around the circle; for a drawn shape, the shape's bounding box. |
| datasetVersion | string (date) | The date of the map data that answered. Example "2026-10-12" |
| total | integer | People in the view, each counted once. In clusters mode: the people in the clusters returned. On a radius request: the people inside the circle, equal to withinRadius. |
| breakdown | MapBreakdown | The four counts for total. |
| clusters | array of MapCluster | The clusters to draw, largest first. [] outside clusters mode. |
| markers | array of object | The pins to draw, nearest the centre of the view first. Each entry is one person's pin (a MapMarker) or a many-people pin (a MapGroupPin, id: null with a groupId). [] in clusters and count mode. |
| areas | array of MapArea | Approximate-area pins. [] in clusters and count mode. |
| unplaced | MapUnplaced | People in the states this view touches who have no mappable address. |
| center | array of number | [lat, lng] of the circle answered. Present only on a center + radiusMiles request. |
| radiusMiles | number | The radius answered, in miles. Present only on a radius request. |
| withinRadius | integer | The exact number of people inside the circle, at every detail level. Present only on a radius request. |
| shape | string one of "polygon", "route" | polygon or route: the shape that was drawn. Present only on a POST /v1/map/area answer. |
| totalIsEstimate | boolean | Present, and true, only on a POST /v1/map/area answer counted from clusters (clusters mode, or count mode at a cluster zoom): a cluster is counted when its centre is inside the shape. Zoom in or draw a smaller shape for an exact total. |
| sandbox | boolean | Present, and true, only on a test-mode answer. |
| notice | string | A sentence to show on the map, on every answer. Example "A pin shows a registered address, not a person's current location." |
The view has not changed since the ETag sent in If-None-Match. No body, not billed: draw the body you kept.
| Status | Code | When |
|---|---|---|
| 401 | — | The key is missing or invalid. The body is the plain detail string. |
| 403 | map_not_enabled | The Map API is off for this account (map_paused when we paused it, origin_not_allowed for a browser key used from a site not on its list). Send sandbox=true to build first. |
| 422 | invalid_bbox | A parameter cannot be read. The code names it: invalid_bbox, invalid_center, invalid_radius, invalid_zoom, invalid_filter, invalid_format, invalid_detail. |
| 429 | map_busy | Too many map requests at the same moment (Retry-After: 1). map_sweep_limit and map_end_user_limit when a daily area budget is used (clusters still work); overloaded when the service is at capacity. |
| 503 | map_unavailable | The map could not be read just now (map_index_not_ready, map_not_configured likewise). Nothing was charged; retry after Retry-After. |
Caching
Every answer carries Cache-Control: private, max-age=300 and an ETag.
- Send the
ETagback inIf-None-Match. An unchanged view answers304, with no body. A304is not billed. - The
ETagchanges when the map data changes, and at least every 12 hours, so marker ids are never kept past their life. - Keep the body with its
ETag. On a304, draw the body you kept. - The answer is private to your account. Do not put it in a shared cache.
Errors
A bad parameter answers 422 with a code that names it: invalid_bbox, invalid_center, invalid_radius, invalid_zoom, invalid_filter, invalid_format, invalid_detail. All codes are in Limits & errors.