REST API
Everything the site shows comes from a public, read-only JSON API. Reading it needs no key.
Base URL
https://rift.news/api/v1
OpenAPI
A full description of the API, in OpenAPI 3.1, is served at /api/v1/openapi.json. It is generated from the server's own route table, so it cannot list a route that does not exist.
Notable endpoints
| Endpoint | Returns |
|---|---|
GET /events/recent | Current events |
GET /events/nearby?lat=&lon=&radius_km= | Events near a point |
GET /events/{id} | One event |
GET /events/{id}/coverage | News articles tied to one event, and its region's live news channel |
GET /alerts | Official warnings, with protective-action class, urgency and certainty |
GET /doomsday | The Doomsday Clock and its parts |
GET /threat/rankings | Countries by threat score |
GET /countries/{iso}/threat | One country's threat score |
GET /forecast?lat=&lon= | The next 24 hours of forecast from MET Norway |
GET /freshness | The state of every source, as on the status page |
GET /search?q= | Search across events, countries and map layers |
The OpenAPI description has the full list and every parameter.
Rate limit
Each IP address can make short bursts of up to 120 requests, refilled at 3 per second (180 a minute). Over the limit, the API answers 429 Too Many Requests with a Retry-After header saying how long to wait.
Cross-origin requests
The API allows browser requests only from EHW's own site. You can call it from a server, a script or the command line, but not from JavaScript running on another website.
Attribution
The data behind the API belongs to the agencies that publish it. If you reuse it, follow each source's licence on the terms page.