In Q2 2024, DMI will migrate its forecast models to a new super computer and upgrade our weather model HARMONIE. This will introduce some breaking changes, read the full announcement here.
Click here for Swagger - Interactive API explorer
To execute calls the service input your api-key by clicking the "Authorize" button in Swagger
Example: https://dmigw.govcloud.dk/v1/forecastdata/collections/harmonie_dini_sf/items?api-key=<api-key>
Description: Will return up to 1000 (the default limit) STAC item objects from the HARMONIE DINI surface model each containing a single step in the forecast.
Example: https://dmigw.govcloud.dk/v1/forecastdata/collections/harmonie_ig_sf/items?api-key=<api-key>
Description: Will return up to 1000 (the default limit) STAC item objects from the HARMONIE IG surface model each containing a single step in the forecast.
The collection endpoints support a number of query parameters to filter or sort data. Make sure to read the query primer to make use of the below query parameters.
{
"type": "FeatureCollection",
"features": [
{
"stac_version": "1.0.0",
"bbox": [
7.0,
53.0,
16.0,
60.0
],
"geometry": {
"coordinates": [
[
[
7.0,
53.0
],
[
16.0,
53.0
],
[
16.0,
60.0
],
[
7.0,
60.0
],
[
7.0,
53.0
]
]
],
"type": "Polygon"
},
"collection": "wam_dw",
"id": "WAM_DW_SF_2023-10-24T120000Z_2023-10-24T120000Z.grib",
"asset": {
"data": {
"href": "https://dmigw.govcloud.dk/v1/forecastdata/download/WAM_DW_SF_2023-10-24T120000Z_2023-10-24T120000Z.grib",
"title": "Forecast file download resource",
"type": "application/x-grib",
"roles": [
"data"
]
}
},
"type": "Feature",
"properties": {
"created": "2023-10-25T00:03:25.859Z",
"datetime": "2023-10-24T12:00:00Z",
"modelRun": "2023-10-24T12:00:00Z"
}
}
],
"timeStamp": "2023-10-26T09:58:40Z",
"numberReturned": 1,
"links": [
{
"href": "https://dmigw.govcloud.dk/v1/forecastdata/collections/wam_dw/items?limit=1",
"rel": "self",
"type": "application/geo+json",
"title": "This document"
},
{
"href": "https://dmigw.govcloud.dk/v1/forecastdata/collections/wam_dw/items?limit=1&offset=1",
"rel": "next",
"type": "application/geo+json",
"title": "Next set of results"
}
]
}
Example: https://dmigw.govcloud.dk/v1/forecastdata/collections
Description: Will return all available collections in the API.
The Weather Model (HARMONIE) can be found in the collections:
for the North Eastern Area (Denmark and surrounding area) in the collections starting with harmonie_dini and Greenland in the collections starting with harmonie_ig.
The Wave Model (WAM) can be found in the collections:
for area Danish Waters, North Atlantic and North Sea-Baltic, respectively.
The Storm Surge Model (DKSS) can be found in the collections:
for the area North Sea Baltic Sea, Inner Danish Waters, Wadden Sea, Roskilde/Isefjord, Limfjord and Little Belt, respectively.
limit |
Specify a maximum number of objects (e.g forecast files) you want to be returned. If a limit is not specified, the default limit is 1000. If more than 300000 objects are needed then use either the offset to request the next set of observations or download the data. Please be advised that this is a "maximum" and the result size could be less than what is requested Max possible limit: 300000 is the maximum limit you can request Example: Returns a maximum of 100 objects |
offset |
Specify the number of objects that should be skipped before returning matching objects. Default: 0. Max possible offset: 1.000.000 Using the limit and the offset parameters, a client can page through the objects returned - page size is set by the limit parameter. This will only work up to the maximum possible offset. If datasets larger than maximum limit plus maximum offset are required then data should be retrieved using the download service or by splitting requests by the datetime parameter. Example: Returns a maximum of 100 objects skipping the first 1000 |
modelRun |
Narrow the search to a specific model run, which means the beginning of a specific forecast. These forecasts are run (ie. calculated) each day at the hours 00, 03, 06, 09, 12, 15, 18 and 21 in UTC depending on model. API only retain data covering the last 48 hours. Model runs that started more than 48 hours ago are therefore out of circulation. If you want a filter to only include forecast step files from one specific forecast, you should use this filter. Example: Returns forecast files from a model run which begins at 03/01/2022 00:00:00 UTC. |
datetime |
Narrow the search for forecast steps to a date range where both ends of the range are inclusive or a specific date. The range can be open on one side. If that is the case simply use ".." (double-dot) in stead of the an actual date for the open side. If only one date is supplied, then only exactly matching dates will be included. If both sides of the range are open, simply omit the datetime parameter. The plus sign "+" must be URL encoded: The API only retains data covering the last 48 hours. A WAM forecast covers 5½ days into the future. The effective range of the datetime parameter for a WAM forecast model at any given time is therefore from 48 hours ago, until 132 hours into the future. Examples: Returns forecast files within the dates UTC 2018-02-12 at midnight and UTC 2018-03-18 at midnight. Both dates are inclusive.
Returns forecast files within the dates 2019-01-01 at midnight and 2020-01-01 at midnight in Danish summer timezone. Both dates are inclusive.
Returns forecast files from the date 2019-01-01 at midnight (Danish summer timezone) and after
Returns forecast files before or matching the date 2019-01-01 at midnight (Danish summer timezone).
Returns forecast files matching the date 2019-01-01 at midnight (Danish summer timezone) |
bbox |
Narrow the search to only include objects within the specified bounding box. A bounding box (usually shortened to bbox) is an area defined by two longitudes and two latitudes, where:
They follow the standard format of: bbox = Southwesterly point (lon,lat) followed by northeasterly point (lon, lat) This bbox tool may be useful. Please use a decimal point as the decimal separator, e.g. 1.99 (and not 1,99) Examples: Returns forecast files spanning an area intersecting with the bounding box having the Southwesterly point of 7.0, 54.0 and northeasterly point of 16.0, 58.0 (which basically covers the area of Denmark)
Returns forecast files spanning an area intersecting with the bounding box having the Southwesterly point of 8.351697,55.421038 and northeasterly point of 8.542584,55.511345 (which basically covers the area of the city of Esbjerg in Denmark) |
bbox-crs |
Specifies the coordinate reference system of the bbox parameter. This service only support the CRS84 coordinate reference system. Example: Returns forecast files spanning an area intersecting the bounding box having the Southwesterly point of 7.0, 54.0 and northeasterly point of 16.0, 58.0 (which basically covers the area of Denmark) using the CRS84 coordinate reference system |
sortorder |
Sorts returned objects. Asking for results to be sorted should only be done when it is needed - responses are generally faster when asking for results with no sorting. Example: Returns the response sorted by the forecasted time in descending order |
Example: Returns forecast files from the model run 01/03/2022 at 00:00:00 UTC and forecasted time step files part of that run for the timeframe of 24-48 hours, by requiring steps to be between 02/03/2022 at 00:00:00 UTC and 03/03/2022 at 00:00:00 UTC. Results should also cover an area that intersects with a bbox covering Denmark in the CRS84 coordinate system. Result shall be in descending datetime order, with offset 0. |
Link to the file can be found by querying using the /collections/<collection name>/items documented above. Link will be in the asset section of the features.
Example:
Downloads the file. File is in GRIB file format.
The download can be validated by comparing the “content-length” HTTP header in the response with the downloaded file length. If these do not match the file download has been interrupted and can be retried or resumed by using a GET request with a “Range” HTTP header.
The API is a STAC API - Features service and follows this standard as documented here: https://api.stacspec.org/v1.0.0-beta.4/core/
Data is returned in a FeatureCollection object that describes the returned data set. Data points are found in the features field which contains a number of Feature objects as described below.
Features are wrapped in a STAC Item FeatureCollection object, which includes:
Key | Not null | Data Type | Description |
type | yes | String | Always equal to "FeatureCollection" |
features | yes | list<Feature> | See below for the description of the specific Feature object |
timeStamp | yes | String | Timestamp when the response was generated. In RFC3339 5.6 format. |
numberReturned | yes | Number | Number of Feature objects returned |
links | yes | List of Link objects |
Links to pages;
|
These are STAC Items, as described by STAC Item Specification and the table below describes the returned data:
(Note that a STAC Item can be seen as an augmented GeoJson feature )
Key | Not null | Data Type | Description |
stac_version | yes | String | STAC version |
bbox.0 | yes | float | Southwesterly point longitude* |
bbox.1 | yes | float | Southwesterly point latitude* |
bbox.2 | yes | float | Northeasterly point longitude* |
bbox.3 | yes | float | Northeasterly point latitude* |
geometry.coordinates | yes | GeoJson polygon | GeoJson polygon of the covered area*. See: https://www.rfc-editor.org/rfc/rfc7946.html#section-3.1.6 |
collection | yes | String | Name of the collection (wam_dw, wam_nsb and wam_natlant). Each collection is the WAM model covering a specific area. dw = danish waters, nsb = north sea + baltic and natlant = north atlantic |
id | yes | String | feature id (forecast file name) |
asset.data.href | yes | string <uri> | The location of the forecast file, where it can be downloaded |
asset.data.title | yes | String | The title of the ressource, always "Forecast file download resource" |
asset.data.type | yes | String | The media type of the resource, always "application/x-grib" What is GRIB ? |
asset.data.roles.0 | yes | String | role is always "data" |
type | yes | String | type is always "feature" |
properties.datetime | yes | String | Timestep of the forecast in RFC3339 5.6 format. |
properties.created | yes | String | Creation time in database (in RFC3339 5.6 format, e.g. "2020-07-10T07:59:38Z") |
properties.modelRun | yes | String | The start time of the forecast, and time for which the forecast model was run. The field is in RFC3339 5.6 format. |
* forecast models are by their very nature models of a fictitious world with a fictitious geodetic datum, ie. not tied to any actual physical locations on earth. The coordinates returned by our service are therefore not WGS84, as required by the GeoJSON specification: RFC 7946 section 4. The coordinate system used by our forecast models also use the IERS Reference Meridian, so the coordinates could be interpreted as WGS84 in order to use the data in the physical world, when taking into account the inherent uncertainty of the model. However, it is up to the end user how they want to interpret the model in the physical world.