Skip to main content

DMI Open Data API

Simple Python interface to the The Danish Meteorological Institute's (DMI) v2 Open Data API.

Weather data from Denmark and Greenland are publicly available through DMI's Open Data API. Fetch raw weather observations from all available weather stations in Denmark and Greenland. Parameters available include temperature, windspeed, humidity, pressure, _precipitation__, and many more.

Requirements

Installation

$ pip install dmi-open-data

Example

from datetime import datetime
import os

from dmi_open_data import DMIOpenDataClient, Parameter, ClimateDataParameter, OceanographicDataParameter


# Get 10 stations
client = DMIOpenDataClient(api_key=os.getenv('DMI_API_KEY'))
stations = client.get_stations(limit=10)

# Get all stations
stations = client.get_stations()

# Get DMI station
dmi_station = next(
    station
    for station in stations
    if station['properties']['name'].lower() == 'dmi')

# Get closest station
closest_station = client.get_closest_station(
    latitude=55.707722,
    longitude=12.562119)

# Get available parameters
parameters = client.list_parameters()

# Get temperature observations from DMI station in given time period
observations = client.get_observations(
    parameter=Parameter.TempDry,
    station_id=dmi_station['properties']['stationId'],
    from_time=datetime(2021, 7, 20),
    to_time=datetime(2021, 7, 24),
    limit=1000)

# Init climate data client
climate_data_client = DMIOpenDataClient(api_key=os.getenv('DMI_CLIMATE_DATA_API_KEY'))

# Get climate data
climate_data = climate_data_client.get_climate_data(
    parameter=ClimateDataParameter.MeanTemp,
    station_id=dmi_station['properties']['stationId'],
    from_time=datetime(2021, 7, 20),
    to_time=datetime(2021, 7, 24),
    time_resolution='day',
    limit=1000)

# Init oceanographic data client
ocean_data_client = DMIOpenDataClient(api_key=os.getenv('DMI_OCEAN_DATA_API_KEY'))

# Get oceanographic data
ocean_data = ocean_data_client.get_ocean_data(
    parameter=OceanographicDataParameter.Tw,
    station_id="31061",
    from_time=datetime(2025, 9, 8),
    to_time=datetime(2025, 9, 10),
    limit=1000)

API Key

API Key can be obtained for free at the DMI Open Data.

Tests

Run tests

$ python -m unittest discover tests

Release files for dmi-open-data 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dmi-open-data 0.1.5
File Size Uploaded
dmi_open_data-0.1.5.tar.gz 11.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dmi-open-data 0.1.5
File Interpreter ABI Platform
dmi_open_data-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 21.3 kB

Release files / dmi_open_data-0.1.5.tar.gz

Download URL dmi_open_data-0.1.5.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ed46b7d991b483d979242eb56b4b562f24aa9f25bea0198532062a03d3cec097
BLAKE2b-256 checksum
How to use checksums
e28ed9bdbbba4ac728801aa2cf301831d6dfa6c8794952d8bc8730a782dcfb44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Release files / dmi_open_data-0.1.5-py3-none-any.whl

Download URL dmi_open_data-0.1.5-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5e350f4280d07e0a88970aeea6e1e6e87f657711012e49288228f89e20d44262
BLAKE2b-256 checksum
How to use checksums
67d549c00ccbee97ca893f8f173d178ff3dffab302cbdaca3020f0af3837e3d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

1 release file

0.1.2

2 release files

0.1.1

1 release file

0.1.0

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page