Use the data
Every figure on this site comes from plain JSON files that anyone can read: no key, no account, no sign-up. This page shows where they are, how to read them with curl or a few lines of JavaScript, what the terms let you do, and how to build a page like this one yourself.
What data.promptugal.news is
data.promptugal.news is, in its own words, "the raw public data behind every PrompTugal site", "collected by code, served as plain JSON files". It is run by PrompTugal.news, not by IPMA and not by this site. A small program per source (a collector, with no AI model in it) reads the publisher's own feed, for example IPMA's open data at api.ipma.pt, and the data site serves what it read as three files per source. GitHub Actions runs the collectors on a schedule, at 17 minutes past each hour for the hourly sources, and on every push to the data site's repository.
- Open. Every file is a GET with no key. The server sends
access-control-allow-origin: *, so a page on any website can read the files from the visitor's browser. It also sendscache-control: max-age=600, so a browser may keep a copy for up to 10 minutes. - Stable. Its contract (api/v1/README.md) says the v1 addresses and fields stay for the life of v1: fields may be added, none removed or renamed. A breaking change would go to
api/v2/, with v1 kept alongside. - Sourced. Every
latest.jsoncarries aprovenanceblock: the publisher's address that was read, the UTC time it was read, the collector that read it and the publisher's terms. - Not a warning service. The data site says so itself: for warnings, follow IPMA and ANEPC.
The addresses
Everything sits under https://data.promptugal.news/api/v1/.
| Address | What it holds |
|---|---|
/llms.txt | The data site in one text file: every source, its files and its terms. A good first read for a person or an AI agent. |
api/v1/index.json | The catalogue: every source with id, title, publisher, cadence, read_at, the addresses of its files and a terms_summary. |
api/v1/openapi.json | An OpenAPI 3.1 description of every path, with schemas and examples. There is also an API explorer. |
api/v1/<source>/latest.json | The records from the collector's last good read, with read_at and provenance. |
api/v1/<source>/reads.json | A log of the collector's runs, newest first: when each ran, the HTTP status, the size, the start of a checksum, and whether the bytes changed. It logs runs, not values. |
api/v1/<source>/card.json | The source card: who publishes the data, the terms, the schedule, the vault copy, who made the collector and what a run costs. |
The weather sources this site reads
| Source id | What | Publisher (from the card) | Cadence | On this site |
|---|---|---|---|---|
ipma-warnings | Weather warnings for every warning area: yellow, orange and red in full, green counted | IPMA | hourly | Warnings |
ipma-city-forecasts | Five-day forecasts for each district capital and island, and Loulé, Portimão and Sagres | IPMA | hourly | Forecasts |
ipma-observations | The latest hourly reading of each surface station | IPMA | hourly | Stations |
ipma-fire-risk | Fire risk class (RCM) per mainland municipality, today and the next two days | IPMA | hourly | Fire risk |
ipma-sea | Wave height, period and direction, and sea temperature, per coastal place | IPMA | hourly | Sea |
ipma-uv | UV index forecast by place and day | IPMA | hourly | UV |
meteoalarm-pt | Every CAP warning message in MeteoAlarm's Portugal feed, one line each | MeteoAlarm (EUMETNET), from IPMA | hourly | Warnings |
storm-charles-archive | The data files behind storm-charles.promptugal.news, 10 to 12 November 2026, each with its size and checksum | storm-charles.promptugal.news | once | Storm Charles |
The catalogue lists other sources too (flights around Faro, public contracts, events, social posts by link). This site uses only the weather ones. For the Algarve places, api/v1/by-place/now/<place>.json combines several sources for one place; this site's place view does its own combining, for every place, from the files above.
Examples you can copy
Each example was run on 18 November 2026 at about 16:30 UTC and worked as shown. The curl examples use jq to pick out fields. The JavaScript examples use fetch: paste one into your browser's developer console on a blank tab or most web pages (the console accepts await at the top level), or put it in a <script type="module">. The output changes every hour.
1. List the sources
curl
curl -s https://data.promptugal.news/api/v1/index.json \
| jq -r '.sources[] | "\(.id)\t\(.cadence)\t\(.read_at)"'
JavaScript
const r = await fetch('https://data.promptugal.news/api/v1/index.json');
const index = await r.json();
for (const s of index.sources) console.log(s.id, s.cadence, s.read_at);
2. The latest warnings
Each record in active has area, area_name, type (in English; type_pt as IPMA writes it), level, start, end and IPMA's text. Times are as IPMA gives them, Portugal local time. counts gives the number active, by level, and the number of green (no warning) entries.
curl
curl -s https://data.promptugal.news/api/v1/ipma-warnings/latest.json \
| jq -r '"read at \(.read_at)",
(.active[] | "\(.level)\t\(.area_name)\t\(.type)\t\(.start) to \(.end)")'
JavaScript
const r = await fetch('https://data.promptugal.news/api/v1/ipma-warnings/latest.json');
const w = await r.json();
console.log(`read at ${w.read_at}: ${w.counts.active} active warnings`);
for (const a of w.active) console.log(a.level, a.area_name, a.type, a.start, a.end);
3. The forecast for one place
Places are keyed by IPMA's globalIdLocal, which the file calls id: 1080500 is Faro, 1110600 Lisboa, 1131200 Porto. Each place has its own read_at and five days, with t_min_c, t_max_c, rain_prob_pct, IPMA's weather_type code, wind_dir, and IPMA's wind and rain classes. To list every id:
curl -s https://data.promptugal.news/api/v1/ipma-city-forecasts/latest.json \
| jq -r '.cities[] | "\(.id)\t\(.name)"'
curl
curl -s https://data.promptugal.news/api/v1/ipma-city-forecasts/latest.json \
| jq '.cities[] | select(.id == 1080500)
| {name, read_at, days: [.days[] | {date, t_min_c, t_max_c, rain_prob_pct}]}'
JavaScript
const r = await fetch('https://data.promptugal.news/api/v1/ipma-city-forecasts/latest.json');
const f = await r.json();
const place = f.cities.find(c => c.id === 1080500); // IPMA's globalIdLocal for Faro
console.log(place.name, 'read at', place.read_at);
console.table(place.days.map(d => ({ date: d.date, min: d.t_min_c, max: d.t_max_c, rain: d.rain_prob_pct })));
4. The nearest station to a point
Each station has lat, lon and a reading (temperature, humidity, wind, rain, pressure, radiation) for the hour in hour_utc. A station that sent nothing that hour has reading: null, so skip it. The point below is Faro (37.0146, -7.9331), the point IPMA gives for Faro in its forecast file and the one the place card uses; the answer we saw was Faro (Aeródromo), 3.5 km away. The jq version uses a flat-earth distance, close enough over tens of kilometres; the JavaScript version uses the great-circle distance.
curl
curl -s https://data.promptugal.news/api/v1/ipma-observations/latest.json \
| jq --argjson lat 37.0146 --argjson lon -7.9331 '
.hour_utc as $h
| [.stations[] | select(.reading != null)
| . + {d: ((((.lat - $lat) * 111.2) | . * .)
+ (((.lon - $lon) * 111.2 * ($lat * 0.017453 | cos)) | . * .) | sqrt)}]
| min_by(.d)
| {name, km: (.d * 10 | round / 10), hour_utc: $h, reading}'
JavaScript
const r = await fetch('https://data.promptugal.news/api/v1/ipma-observations/latest.json');
const o = await r.json();
const km = (lat1, lon1, lat2, lon2) => { // great-circle distance
const k = Math.PI / 180;
const a = Math.sin((lat2 - lat1) * k / 2) ** 2
+ Math.cos(lat1 * k) * Math.cos(lat2 * k) * Math.sin((lon2 - lon1) * k / 2) ** 2;
return 12742 * Math.asin(Math.sqrt(a));
};
const here = { lat: 37.0146, lon: -7.9331 }; // Faro
const near = o.stations.filter(s => s.reading)
.map(s => ({ ...s, km: km(here.lat, here.lon, s.lat, s.lon) }))
.sort((a, b) => a.km - b.km)[0];
console.log(near.name, near.km.toFixed(1), 'km away; hour (UTC):', o.hour_utc, near.reading);
5. Read a card
curl
curl -s https://data.promptugal.news/api/v1/ipma-warnings/card.json \
| jq '{title, publisher, cadence: .schedule.cadence, terms: .terms.summary,
terms_page: .terms.page, terms_read: .terms.read_at, since}'
JavaScript
const r = await fetch('https://data.promptugal.news/api/v1/ipma-warnings/card.json');
const card = await r.json();
console.log(card.publisher);
console.log(card.schedule.cadence, '|', card.terms.summary);
console.log('terms page:', card.terms.page, '| terms read on', card.terms.read_at);
6. When did the collector last run?
reads.json shows each run: its time, how many reads succeeded and how many failed.
curl -s https://data.promptugal.news/api/v1/ipma-warnings/reads.json \
| jq -r '.runs[0:5][] | "\(.at)\tok \(.ok)\tfailed \(.failed)"'
How to read a card
Read a source's card.json before you reuse its data. These are the fields that matter, with what the ipma-warnings card held when we read it:
publisher- Who publishes the data: "IPMA, Instituto Português do Mar e da Atmosfera". Name them beside every figure.
source_homeandreader_page- The publisher's own file that the collector reads (here IPMA's
warnings_www.json), and the publisher's page for people. Link the reader page so your visitors can check the original. terms.summary,terms.quote,terms.page,terms.read_at- The reuse terms in one line, the publisher's own words where the card has them (for IPMA, in Portuguese), the page they come from and the date they were read.
terms.republishsays in short whether you may republish and on what conditions. Some cards add anopen_questionthat is not settled yet. schedule.cadenceandschedule.how- How often the collector is meant to run ("hourly", or "once" for the archive) and what runs it. This is the plan;
reads.jsonis what happened. api- The addresses of this source's
latest,reads,cardandopenapifiles, and its page on the data site. since,split,cost- When collection started (17 November 2026 for the IPMA sources), what code, agents and people did (the cards say no person has checked the values yet), and what a run costs (no AI model is called when collecting, so 0 tokens).
license- The licence of the card itself and of what PrompTugal.news makes (CC BY 4.0). It is not the licence of the publisher's data: that is in
terms.
The read times are not in the card but in the data: read_at at the top of each latest.json (the collector's last good read), the same time in provenance.read_at, and, in the forecasts file, one read_at per place. The card's vault block says where the bytes as received are kept (an sgit vault, with a dated copy when they change); this page does not repeat its read key.
The terms
The terms belong to the publishers, not to PrompTugal.news or to us, and the data site says they are "not ours to relax". As the cards give them on 18 November 2026:
- IPMA (the six ipma-* sources): "free to copy and use for personal or public use if the use has no profit-making or offensive purpose; always name IPMA as the source." So: no profit-making use (no ads, payments or paid products built on it under these terms), no offensive use, and name IPMA every time. IPMA's own words, as the card quotes them from api.ipma.pt: "O Utilizador pode copiar, importar ou utilizar gratuitamente informações ou símbolos nacionais existentes neste site para uso pessoal ou público desde que dessa utilização não decorram finalidades lucrativas ou ofensivas. O Utilizador deve referir, sempre, a fonte de informação."
- MeteoAlarm (meteoalarm-pt): "re-users must name the national service (IPMA), keep the time of issue, link www.meteoalarm.org and publish MeteoAlarm's disclaimer." The file's
attributionblock carries all four: the national service, the link, and the disclaimer text; each message'ssent_utcis its time of issue. The card says these terms were read on 11 November 2026 and not re-read since; its terms page is meteoalarm.org's terms and conditions.curl -s https://data.promptugal.news/api/v1/meteoalarm-pt/latest.json \ | jq '{read_at, attribution, first: (.messages[0] | {sent_utc})}' - The Storm Charles archive: "The storm site's own data: Apache-2.0 (its repository's licence). Quoted sources keep their own terms; each item links its source."
This site follows them by having no ads, payments or tracking, by naming the publisher beside every figure with the time read, and by showing MeteoAlarm's disclaimer wherever it shows a MeteoAlarm message.
Stale data: check the time
A file can be hours behind the publisher. The cards say "hourly", but the collectors do not always run: in the ipma-warnings run log (reads.json, read 18 November 2026 at 16:22 UTC) the longest gap between runs was 7 hours 15 minutes, from 02:28 to 09:43 UTC that day, and two others were over 3 hours. When a read fails, the last good file stays and reads.json records the failure, so a file never disappears; it just gets older.
So compare read_at with the time now, every time, and say it beside the figures. This site calls a file stale past 3 hours and old past 24 hours, and says so on the page; those limits are our choice, not IPMA's. A page that shows a figure without its age can mislead.
curl
curl -s https://data.promptugal.news/api/v1/ipma-warnings/latest.json \
| jq -r '.read_at as $r | (now - ($r | fromdateiso8601)) / 3600
| "read \($r), \(. * 10 | floor / 10) hours ago"
+ (if . > 3 then ": stale, say so beside the figures" else "" end)'
JavaScript
const r = await fetch('https://data.promptugal.news/api/v1/ipma-warnings/latest.json');
const w = await r.json();
const hours = (Date.now() - Date.parse(w.read_at)) / 36e5;
console.log(hours > 3
? `Stale: this file was read ${hours.toFixed(1)} hours ago`
: `Read ${Math.round(hours * 60)} minutes ago`);
Build a page like this one
This site is static HTML, CSS and a few small scripts. No server of ours holds the data: each page fetches the files when you open it. You can do the same with one file:
- A static HTML page, on any host (or opened from your disk).
- A
fetchof the source'slatest.jsonandcard.json. - The figures, with the card's publisher and terms beside them, and the read time.
- A plain message when the file is stale, and another when it cannot be read. Never a guess.
- The line every page of ours carries: "Not a warning service. For warnings and safety, follow IPMA (ipma.pt) and ANEPC."
Here is a complete page that lists the current warnings. Save it as warnings.html and open it in a browser. It is 47 lines, uses no library, and we ran it on 18 November 2026: it listed 32 active warnings, with IPMA's terms below them, and showed the stale and error messages when we tested those cases.
<!doctype html>
<html lang="en-GB">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Warnings now</title>
<style>
body{font:16px/1.5 system-ui,sans-serif;max-width:40rem;margin:2rem auto;padding:0 16px}
.stale{background:#fff4d6;color:#3b2f00;padding:.5rem}
small{color:#555}
</style>
</head>
<body>
<h1>Weather warnings in Portugal</h1>
<p><strong>Not a warning service. For warnings and safety, follow IPMA (ipma.pt) and ANEPC.</strong></p>
<p id="status">Reading the file...</p>
<ul id="list"></ul>
<p><small id="credit"></small></p>
<script type="module">
const API = 'https://data.promptugal.news/api/v1/ipma-warnings';
const $ = id => document.getElementById(id);
const get = async url => {
const r = await fetch(url);
if (!r.ok) throw new Error(`HTTP ${r.status} for ${url}`);
return r.json();
};
try {
const [latest, card] = await Promise.all([get(`${API}/latest.json`), get(`${API}/card.json`)]);
const hours = (Date.now() - Date.parse(latest.read_at)) / 36e5;
const when = new Date(latest.read_at).toLocaleString('en-GB', { timeZone: 'Europe/Lisbon' });
$('status').textContent = `${latest.counts.active} active warnings. File read ${when}, Lisbon time.`;
if (hours > 3) {
$('status').className = 'stale';
$('status').textContent += ` This is ${hours.toFixed(1)} hours old: check ipma.pt for now.`;
}
for (const w of latest.active) {
const li = document.createElement('li');
li.textContent = `${w.area_name}: ${w.level}, ${w.type}, ${w.start} to ${w.end} (local time)`;
$('list').append(li);
}
$('credit').textContent = `Source: ${card.publisher}, read by data.promptugal.news. ${card.terms.summary}`;
} catch (e) {
$('status').textContent = `Could not read the warnings (${e.message}). See ipma.pt.`;
}
</script>
</body>
</html>
From there, the same pattern draws anything in the catalogue: change the source id and the fields. The pages of this site add a timeout, a "slow" message after 4 seconds and charts in SVG, but the idea is the same. Their code is open: AgentiCCells__Site__Weather-Demo (code Apache-2.0).
Facts on this page from: data.promptugal.news/llms.txt, api/v1/README.md, api/v1/index.json, the cards of ipma-warnings, meteoalarm-pt and storm-charles-archive, and ipma-warnings/reads.json, all read on 18 November 2026 between 16:21 and 16:35 UTC. The response headers were read with curl at the same time.