← back to the map · about & data sources
API & embedding
Everything the map shows is available as read-only JSON from the same origin. No key is needed. Please keep polling modest (the map itself refreshes every few seconds over WebSocket; a poll every 30–60 s is plenty for scripts) and credit the original sources listed on the about page, whose licences apply to the data.
Embedding the map
Add ?embed=1 to any map link to get a chrome-free view with just the map, the clock and a link back. Share-link parameters still work, so you can pin the layers, options, theme and position:
<iframe src="https://ukrecord.uk/?embed=1&on=warnings,floods,powercuts&off=ac-civil&theme=dark#view=6/54.5/-3"
width="100%" height="600" style="border:0" loading="lazy" allowfullscreen></iframe>
Use the Share button in the Layers panel to build the link, then append &embed=1.
Endpoints
| Path | Returns |
|---|---|
GET /api/snapshot | Everything in one call: entities[], alerts[], stats{}, feeds[]. Several MB; prefer the narrower calls below. |
GET /api/entities?kind=&cat= | Entities on the map, optionally filtered by kind (aircraft, vessel, flood, power_cut, sewage, generator, ferry …) and category. Each has id, kind, cat, src, lat, lon, ts, expires, label, severity, props. |
GET /api/alerts | Current alerts (newest first): id, kind, cat, title, body, lat, lon, severity 0–3, ts, expires, entityId. |
GET /api/stats | The Status pane as data: electricity, gas, carbon, frequency, agile (all regions), solar, generators, interconnectors, isps, atlas, lonap, rainfall, marine, inshore, health, parliament, fuel, trains, rtppm and more. Each object carries _ts. |
GET /api/feeds | Health of every feed: feed, group, ok, enabled, lastRun, lastOk, lastError, count, ms, note. |
GET /api/series?keys=elec.demand,grid.hz&hours=24 | Five-minute time series for the sparkline keys (up to 72 h): { key: [[epochMs, value], …] }. |
GET /api/history/:id?hours=6 | Recorded positions for a tracked aircraft or vessel entity id. |
GET /api/replay/index · GET /api/replay?t=epochMs | Snapshot times kept for replay (12 h, every 5 min) and the full state at the snapshot nearest t. |
GET /api/geo/fuel · GET /api/geo/chargers | GeoJSON point collections: forecourt prices (E10, E5, B7, SDV in p/litre) and rapid EV chargers. |
GET /api/crime?lat=&lng= | GeoJSON of street-level crime within a mile of the point for the latest published month (England, Wales, NI). |
GET /api/geocode?q= | Place, postcode or outcode lookup: [{ name, detail, lat, lon, type }]. |
GET /api/radar | RainViewer frame list for the radar overlay. |
GET /api/health | Liveness: database state, entity count, feeds ok / total, uptime. |
WS /ws | Live stream. First message is the full snapshot, then deltas every ~2 s: { type: 'delta', upsert[], remove[], alerts[], stats }. |
Examples
curl -s https://ukrecord.uk/api/entities?kind=aircraft&cat=military | jq '.[] | {label, alt: .props.alt}'
curl -s https://ukrecord.uk/api/stats | jq '.electricity.demandMW, .frequency.hz'
curl -s "https://ukrecord.uk/api/series?keys=grid.hz&hours=1" | jq '.["grid.hz"] | last'
Independent, not an official service. Data belongs to its publishers; see the about page for attribution and licences. The API may change without notice.