The engine, as an API.
Everything the map does, from your own code: which defibrillators are open at a given hour, the nearest one you can actually reach, and the analysis of any list you bring. One click for a key. Nothing to install.
Get a free key
5 requests a second, 1,000 a day. No sign-up, no email. Shown once, so copy it.
Try it live
Pick a call, change anything, send it. With your key it goes to /api/v1, exactly as your code would; without one it uses the site's own route so you can look first.
The response appears here.
Endpoints
Base URL /api/v1. Send your key in the x-api-key header. Responses are JSON. Times are local to the city: send at=2026-11-01T03:00, or leave it out for right now.
| Call | What it answers |
|---|---|
GET /availability | How many AED locations are open, locked or unknown at a time. preset, at, schoolClose (15, 18, 21), includeAi, list=1 for every site. |
GET /nearest | From lat, lon: the nearest AED by walking time, the nearest one that is open, and how much longer it takes. Walking times from Amazon Location Service. route=1 adds the walking line; address=1 adds the street address of the point (Amazon Location reverse geocoding). |
GET /relocation | NYC schools ranked by after-hours cardiac-arrest calls within a two-minute walk. limit up to 100. |
GET /summary | Every headline number for a preset, with sources. |
GET /presets | The cities available and how their hours were built. |
POST /analyze | Bring your own list: {"timeZone", "sites":[{"name","lat","lon","hours"}]}. Returns open counts for every hour of a week, peak, trough, unreadable rows, and each site's 336-hour pattern. |
POST /geocode | Up to 25 addresses to points, with Amazon Location Service. |
POST /isolines | Up to 25 points to walking areas: {"points":[[lon,lat]], "seconds":120}. |
POST /ask | A question in plain words, {"question":"Sunday 11 PM near Penn Station"}, read by Amazon Bedrock into a place and an hour, and geocoded by Amazon Location Service. Pass the result to /nearest for the answer. New York only. |
Opening hours use OpenStreetMap syntax. Anything unreadable is treated as unknown, never as open.
GET /nearest answer, drawn: East New York, Sunday 9 PM. The nearest AED is locked; the route is to the nearest open one. Rendered with Amazon Location static maps.
GET /relocation: P.S. 053 in the Bronx, with a fire station 268 m away. Every row has a printable brief.Use it from Claude
After Hours is also a remote MCP server, so an AI assistant can call it as a tool: "Which Bronx ZIPs have no defibrillator open after 9 PM?" or "Rank the schools in Harlem to make 24/7."
Claude Code
claude mcp add --transport http after-hours https://YOUR-SITE/api/mcp
Claude Desktop, Cursor or any MCP client that reads JSON config
Tools: aed_availability, nearest_open_aed, relocation_candidates, city_findings, analyze_sites. Read-only, throttled, no key needed.
Fair use
- Each key: 5 requests a second, 1,000 a day, set by an Amazon API Gateway usage plan.
- Data is open: NYC Open Data terms, Licence Ouverte 2.0 for Géo'DAE. Credit the sources when you publish.
- It is a planning tool. Never put it between someone and 911.
- The code is Apache-2.0. Run your own copy with one
cdk deploy.