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.

CallWhat it answers
GET /availabilityHow many AED locations are open, locked or unknown at a time. preset, at, schoolClose (15, 18, 21), includeAi, list=1 for every site.
GET /nearestFrom 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 /relocationNYC schools ranked by after-hours cardiac-arrest calls within a two-minute walk. limit up to 100.
GET /summaryEvery headline number for a preset, with sources.
GET /presetsThe cities available and how their hours were built.
POST /analyzeBring 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 /geocodeUp to 25 addresses to points, with Amazon Location Service.
POST /isolinesUp to 25 points to walking areas: {"points":[[lon,lat]], "seconds":120}.
POST /askA 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.

Street map of East New York with a yellow walking route from a collapse point past a locked AED four minutes away to an open AED a 53-minute walk to the east.
One 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.
Street map of P.S. 053 in the Bronx with its two-minute walking area and a fire station 268 metres away.
The first row of 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.

Built on AWS, end to end

Every number on this site comes from this pipeline. The code is open, so any city can run it on its own data.