The API
The API is a set of plain JSON files, all GET, no key, no sign-up. The build writes them; there is no server to fail. The addresses are stable for the life of v1: read the contract.
Start here
| What | Address |
|---|---|
| Catalogue of every source | https://data.promptugal.news/api/v1/index.json |
| OpenAPI 3.1, every path | https://data.promptugal.news/api/v1/openapi.json |
| OpenAPI for one source | https://data.promptugal.news/api/v1/<source>/openapi.json |
| Latest read of a source | https://data.promptugal.news/api/v1/<source>/latest.json |
| Every read of a source | https://data.promptugal.news/api/v1/<source>/reads.json |
| A source's card (terms, schedule, vault) | https://data.promptugal.news/api/v1/<source>/card.json |
| Algarve places, now | https://data.promptugal.news/api/v1/by-place/now/index.json, then https://data.promptugal.news/api/v1/by-place/now/<place>.json |
| Try it in the browser | API explorer |
curl -s https://data.promptugal.news/api/v1/index.json
curl -s https://data.promptugal.news/api/v1/ipma-warnings/latest.json
curl -s https://data.promptugal.news/api/v1/by-place/now/faro.json
Sources and places
Source ids: adsb-faro, base-gov-pt, cams, events-pt, github-pt, ipma-city-forecasts, ipma-fire-risk, ipma-observations, ipma-sea, ipma-uv, ipma-warnings, meteoalarm-pt, social, storm-charles-archive.
Places with a now file: albufeira, alcoutim, algarve, aljezur, castro-marim, faro, lagoa, lagos, loule, monchique, olhao, portimao, quarteira, sao-bras-de-alportel, silves, tavira, vila-do-bispo, vila-real-de-santo-antonio.
Every value has a source
Each latest.json has a provenance block: the source address, the page a reader would use, the time read, what read it, and the source's terms. Keep the source named when you reuse a value, and check the terms on the card first: they differ.
CORS
GitHub Pages serves every file with Access-Control-Allow-Origin: *, so a browser page on any origin can read these files with fetch. The API explorer on this site calls only this site.
The other four PrompTugal sites
Each site publishes the same kind of catalogue at the same path. These are the intended addresses; this site does not check that they are live yet.
| Site | Catalogue |
|---|---|
| Weather | https://weather.promptugal.news/api/v1/index.json |
| Civic | https://civic.promptugal.news/api/v1/index.json |
| Startups | https://startups.promptugal.news/api/v1/index.json |
| Travel | https://travel.promptugal.news/api/v1/index.json |