NAME
MetAlerts - Weather alerts from the Norwegian Meteorological Institute
DESCRIPTION
This service provides meteorological warnings in CAP format, as well as a listing of current warnings in an RSS 2.0 feed. Both are in XML format, but there is an experimental GeoJSON version in beta.
Alerts are issued on three levels:
- Red - Extreme weather with over 50 % probability.
These will normally have an issued name,
look for
incidentName
in the CAP file - Orange - Severe weather, or extreme weather with less than 50 % probability
- Yellow - Less severe weather, or severe with less than 50 % probabilty
Each CAP message is one of the following types,
as indicated in the msgType
value:
- Alert - warning about a new phenomenon
- Update - modifies a previous Alert/Update (which is no longer valid)
- Cancel - invalidates a previous Alert/Update
For more information on the CAP format and meanings, see the "other resources" tab.
Output formats
XML
Unless the cap
parameter is given,
we return an RSS 2.0 feed of alerts.
Tip: Many browsers have removed RSS support and insist on downloading RSS feeds to disk despite being perfectly able to display XML.
To avoid this,
you can indicate .xml
as output format,
which will return the corresponding MIME type so it can be displayed in the browser:
GeoJSON format (beta)
Due to user feedback we are working on a supplemental GeoJSON format, where all relevant information is included without the need to open separate CAP files. This is currently considered a beta feature, and not suitable for high volume production as it is rather slow and costly to produce. We do not plan to make any more changes to the GeoJSON format in version 2.0; an official GeoJSON format may possibly be added later in 2024.
This also works for other methods,
like all
,
test
,
archive
and so on.
Icons
You can download alerting icons in SVG format (which can be converted to PNG) from the Yr GitHub page:
In the future this icon set will be migrated to the Weathericons GitHub repo as currently used with Locationforecast.
USAGE
Methods
/current - show active alerts
Use the RSS feed to get a list of CAP warnings, optionally filtered by query parameters.
https://api.met.no./weatherapi/metalerts/2.0/current.rss
https://api.met.no./weatherapi/metalerts/2.0/current.xml
https://api.met.no./weatherapi/metalerts/2.0/current.json
Do not download each CAP file more than once, and certainly not every time you download the RSS feed! (this is liable to getting you throttled). Once issued the CAP file never changes, so it should be downloaded only once and stored locally.
/all - show active and inactive alerts
Normally only active alerts are listed,
with expired alerts filtered out.
Using /all
will list all alerts issued during the last 30 days,
both active and inactive.
https://api.met.no./weatherapi/metalerts/2.0/all.rss
https://api.met.no./weatherapi/metalerts/2.0/all.xml
https://api.met.no./weatherapi/metalerts/2.0/all.json
/archive - historical alerts
This is used to get historical alerts from the archive, which is segmented by monthly intervals. Currently it contains data for the period Jan 2019 to Dec 2023; new periods are added at the start of each year.
Note: All alerts prior to May 2024 follows the v1 CAP profile.
/test - Test alerts (active)
/test_all - Test alerts (all)
Meteorologists sometimes want to test fictional CAP warnings to check that they work upstream.
/test
now only shows active warnings. To show all warnings issues in the last 30 days,
use /test_all
.
https://api.met.no./weatherapi/metalerts/2.0/test.rss
https://api.met.no./weatherapi/metalerts/2.0/test.json
https://api.met.no./weatherapi/metalerts/2.0/test?cap=...
https://api.met.no./weatherapi/metalerts/2.0/test_all.rss
https://api.met.no./weatherapi/metalerts/2.0/test_all.json
/example - Examples of different alerts
These are examples of test alerts, one for each event type (currently forestFire, blowingSnow, rainFlood, lightning and rainFlood). These don't expire until 2034, so will be available for use in development testing for years to come.
https://api.met.no./weatherapi/metalerts/2.0/example.rss
https://api.met.no./weatherapi/metalerts/2.0/example.json
https://api.met.no./weatherapi/metalerts/2.0/example?cap=...
Parameters
cap
Retrieve CAP XML message with given guid
lang
Output language, currently "no" or "en" for Norwegian and English, respectively
event
Filter by CAP eventType, legal values are: blowingSnow, forestFire, gale, ice, icing, lightning, polarLow, rain, rainFlood, snow, stormSurge, wind
You can find matching icons (SVG and PNG) for all events on the Yr warning icons repo.
incidentName
Filter by incident (names given to red alert extreme weather phenomena)
geographicDomain
Filter by land or marine
county (fylke)
Filter by Norwegian county number where available (only land areas, not gale warnings etc). The county number is defined as always having 2 digits, so the counties Østfold to Aust-Agder must be zero prefixed. Currently one single county allowed per request.
Note that the list of counties has changed several times during the 2018-2024 period. For an updated list, please see this dataset from SSB.
lat, lon
Coordinates for geographical search (returns all alerts covered by the search location)
period
Only used with the /archive
method.
Use ISO format for months,
on the form YYYY-MM.
Periods outside the archive timespan will return error.
Legal values are: 2019-01, 2019-02, 2019-03, 2019-04, 2019-05, 2019-06, 2019-07, 2019-08, 2019-09, 2019-10, 2019-11, 2019-12, 2020-01, 2020-02, 2020-03, 2020-04, 2020-05, 2020-06, 2020-07, 2020-08, 2020-09, 2020-10, 2020-11, 2020-12, 2021-01, 2021-02, 2021-03, 2021-04, 2021-05, 2021-06, 2021-07, 2021-08, 2021-09, 2021-10, 2021-11, 2021-12, 2022-01, 2022-02, 2022-03, 2022-04, 2022-05, 2022-06, 2022-07, 2022-08, 2022-09, 2022-10, 2022-11, 2022-12, 2023-01, 2023-02, 2023-03, 2023-04, 2023-05, 2023-06, 2023-07, 2023-08, 2023-09, 2023-10, 2023-11, 2023-12.
sort
Sort RSS items on field (in ascending order). The following fields are available:
- area
- event
- incidentName
- t_onset
- t_published
- type
Example requests
https://api.met.no./weatherapi/metalerts/2.0/current.rss?lang=en
https://api.met.no./weatherapi/metalerts/2.0/all.xml?county=42
(show alerts for Agder county)https://api.met.no./weatherapi/metalerts/2.0/current.xml?cap=... (check
RSS feed above for working URLs)
Changelog
2024-09-13
Added /test and /test_all endpoints
2024-05-07
MetAlerts 2.0 is now in production. Version 1.1 is deprecated and will be removed on 2 Sept 2024
2024-03-07
Several new properties added to GeoJSON output:
- status (Actual eller Test)
- municipality (kommunenr)
- web
- contact
- description (for resources, previously broken)
- altitude (feet above msl)
- ceiling (feet above msl)
2024-02-23
Added GeoRSS polygons to RSS feed. Position search has been optimized and is now production ready.
2023-08-06
New version 2.0 beta, using new CAP v2 profile for testing
2021-02-10
Added lightning
event type.
2021-02-10
Experimental alert archive implemented.
Use the period
parameter to enable.
The RSS feed link has been removed from available,
now only lists CAP files.
2019-11-01
The eventCode drivingConditions
has now been replaced by the eventCodes ice
and blowingSnow
to better reflect actual causes instead of consequences
2018-06-19
Support for filter on incidentName
2018-03-08
Support for search by county number (for warnings issued after 2018-03-15)
2017-07-22
Experimental support for search by coordinates
1.1, 2017-05-20
New version of CAP format (1.0). MetAlerts 1.0 will expire 2017-12-01
1.0, 2016-09-01
More search parameters,
improved stability.
The cap
parameter now requires an ID,
not a date.
0.2, 2016-04-20
Format officially changed to RSS 2.0
RSS now validates, using RFC-822 date format and no duplicate items
0.1, 2016-03-02
Renamed to MetAlerts. Format claimed to be Atom, but is in fact RSS 2.0 (invalid)
0.1, 2016-01-19
New product for testing
Changelog
Supplemental documentation
Output format descriptions
- CAP v2 profile
- MetAlerts GeoJSON format
Alerting colour criteria
Other documents (in Norwegian)
- Hva er ekstremvær?
- Farevarselplan - describes the criteria for issuing alerts
- Samordning av farevarsler ved MET og NVE (20-2017) - describes our application of the CAP format