Weather Data API
Getting Started
The Weather Data Source Service endpoints provide information about the available data sources and weather parameters available in the API.
To quickly get weather data for your location, simply follow the following steps:
We will use this API URL : https://test.madiphs.org/weather
Get list of all weather data sources for your location
We are going to list all weather data sources registered in the Weather Data Service.
We will use the following coordinates to query weather data for our location (Lilongwe, Malawi):
latitude = -14.159339
longitude = 33.776864
Our end point URL will be: https://test.madiphs.org/weather/rest/weatherdatasource/location/point/?latitude=-13.995720&longitude=33.759819
Response
[
{
"id": "no.met.locationforecast",
"name": "Met Norway Locationforecast",
"description": "9-day forecasts for the entire planet. 2.5 km resolution in the Nordic-Baltic region, 9km elsewhere",
"public_URL": "https://api.met.no/weatherapi/locationforecast/1.9/documentation",
"endpoint": "{WEATHER_API_URL}/rest/weatheradapter/yr/",
"authentication_type": "NONE",
"needs_data_control": "false",
"access_type": "location",
"priority": 0,
"temporal": {
"forecast": 9,
"historic": {
"start": null,
"end": null
},
"intervals": [
3600
]
},
"parameters": {
"common": [
1001,
3001,
2001,
4002
],
"optional": null
},
"spatial": {
"countries": null,
"geoJSON": "{\"type\": \"Sphere\"}"
},
"organization": {
"name": "The Norwegian Meteorological Institute",
"country": "Norway",
"address": "Postboks 43 Blindern",
"postal_code": "0371",
"city": "Oslo",
"email": "david.melchior@met.no",
"url": "https://www.met.no/en"
},
"active": true,
"endpointFullPath": "https://test.madiphs.org/weather/rest/weatheradapter/yr/"
},
{
"id": "no.nibio.mockweatherdatasource",
"name": "Mock Weather Data Source",
"description": "Placeholder datasource providing same data for all locations and periods",
"public_URL": "https://test.madiphs.org/mwds/",
"endpoint": "https://test.madiphs.org/mwds/weather_data",
"authentication_type": "NONE",
"needs_data_control": "false",
"access_type": "location",
"priority": 0,
"temporal": {
"forecast": 0,
"historic": {
"start": "2021-01-01",
"end": "2021-12-31"
},
"intervals": [
3600,
86400
]
},
"parameters": {
"common": [
1002,
1003,
1004,
1112,
2001,
3002,
3101,
4002,
4003,
5001
],
"optional": null
},
"spatial": {
"countries": null,
"geoJSON": "{\"type\": \"Sphere\"}"
},
"organization": {
"name": "NIBIO",
"country": "Norway",
"address": "Høgskoleveien 7",
"postal_code": "1431",
"city": "Ås",
"email": "tor-einar.skog@nibio.no",
"url": "https://nibio.no"
},
"active": true,
"endpointFullPath": "https://test.madiphs.org/mwds/weather_data"
},
{
"id": "com.open-meteo",
"name": "Open-Meteo",
"description": "Seasonal weather data and forecasts for the entire world",
"public_URL": "https://open-meteo.com/",
"endpoint": "{WEATHER_API_URL}/rest/weatheradapter/openmeteo/",
"authentication_type": "NONE",
"needs_data_control": "false",
"access_type": "location",
"priority": 1,
"temporal": {
"forecast": 8,
"historic": {
"start": "2020-01-01",
"end": null
},
"intervals": [
3600,
86400
]
},
"parameters": {
"common": [
1001,
1003,
1004,
1901,
2001,
3001,
4012,
5001
],
"optional": null
},
"spatial": {
"countries": null,
"geoJSON": "{\"type\": \"Sphere\"}"
},
"organization": {
"name": "Open-Meteo",
"country": "Germany",
"address": "Unknown",
"postal_code": "Unknown",
"city": "Unknown",
"email": "info@open-meteo.com",
"url": "https://open-meteo.com/"
},
"active": true,
"endpointFullPath": "https://test.madiphs.org/weather/rest/weatheradapter/openmeteo/"
}
]
Response Explanation
id
is the unique identifier for the weather data sourcename
is the name of the weather data sourcedescription
describes the weather data sourceendpoint
is where client software sends their requests for weather dataauthentication_type
could beNONE
,CREDENTIALS
orBEARER_TOKEN
needs_data_control
: A value oftrue
means that the source may have missing or erroneous dataaccess_type
could bestations
orlocation
temporal
describes how far back and forward in time the data source can deliver data. Theforecast
property is minimum 0 and is measured in days ahead.historic
takes ISO dates (YYYY-MM-DD) ornull
(as end) if the station is activeparameters
is a list of weather parameters. An updated list can be found at the endpoint[API_URL]/rest/parameter
spatial
is used by the API to locate where the data source is valid/has data. It could either be ISO three-letter country codes, a regular geoJSON polygon(s) or a geoJSON list of stations (such as in the above)
Read more about the Response Metadata
Get list of weather API parameters
We need to know the parameters acceptable by the Weather Data Service. These parameters determine the response we get from the service. We will send a request to this end point: https://test.madiphs.org/weather/rest/parameter
Response
[
{
"id": 1001,
"name": "Instantaneous temperature at 2m",
"description": null,
"unit": "Celcius",
"aggregationType": "AVG"
},
{
"id": 1002,
"name": "Mean air temperature at 2m",
"description": null,
"unit": "Celcius",
"aggregationType": "AVG"
},
{
"id": 1003,
"name": "Minimum air temperature at 2m",
"description": null,
"unit": "Celcius",
"aggregationType": "MIN"
},
{
"id": 1004,
"name": "Maximum air temperature at 2m",
"description": null,
"unit": "Celcius",
"aggregationType": "MAX"
},
{
"id": 1021,
"name": "Instantaneous temperature in canopy",
"description": null,
"unit": "Celcius",
"aggregationType": "AVG"
},
{
"id": 1022,
"name": "Mean air temperature in canopy",
"description": null,
"unit": "Celcius",
"aggregationType": "AVG"
},
{
"id": 1023,
"name": "Minimum air temperature in canopy",
"description": null,
"unit": "Celcius",
"aggregationType": "MIN"
},
{
"id": 1024,
"name": "Maximum air temperature in canopy",
"description": null,
"unit": "Celcius",
"aggregationType": "MAX"
},
{
"id": 1101,
"name": "Instantaneous temperature at -5cm (Celcius)",
"description": null,
"unit": "Celcius",
"aggregationType": "AVG"
},
{
"id": 1102,
"name": "Mean temperature at -5cm",
"description": null,
"unit": "Celcius",
"aggregationType": "AVG"
},
{
"id": 1111,
"name": "Instantaneous temperature at -10cm (Celcius)",
"description": null,
"unit": "Celcius",
"aggregationType": "AVG"
},
{
"id": 1112,
"name": "Mean temperature at -10cm",
"description": null,
"unit": "Celcius",
"aggregationType": "AVG"
},
{
"id": 1121,
"name": "Instantaneous temperature at -20cm (Celcius)",
"description": null,
"unit": "Celcius",
"aggregationType": "AVG"
},
{
"id": 1122,
"name": "Mean temperature at -20cm",
"description": null,
"unit": "Celcius",
"aggregationType": "AVG"
},
{
"id": 1131,
"name": "Instantaneous temperature at -30cm (Celcius)",
"description": null,
"unit": "Celcius",
"aggregationType": "AVG"
},
{
"id": 1132,
"name": "Mean temperature at -30cm",
"description": null,
"unit": "Celcius",
"aggregationType": "AVG"
},
{
"id": 1141,
"name": "Instantaneous temperature at -40cm (Celcius)",
"description": null,
"unit": "Celcius",
"aggregationType": "AVG"
},
{
"id": 1142,
"name": "Mean temperature at -40cm",
"description": null,
"unit": "Celcius",
"aggregationType": "AVG"
},
{
"id": 1151,
"name": "Instantaneous temperature at -50cm (Celcius)",
"description": null,
"unit": "Celcius",
"aggregationType": "AVG"
},
{
"id": 1152,
"name": "Mean temperature at -50cm",
"description": null,
"unit": "Celcius",
"aggregationType": "AVG"
},
{
"id": 1901,
"name": "Dew point temperature",
"description": null,
"unit": "Celcius",
"aggregationType": "AVG"
},
{
"id": 2001,
"name": "Precipitation",
"description": null,
"unit": "mm",
"aggregationType": "SUM"
},
{
"id": 3001,
"name": "Instantaneous RH at 2m (%)",
"description": null,
"unit": "%",
"aggregationType": "AVG"
},
{
"id": 3002,
"name": "Mean RH at 2m",
"description": null,
"unit": "%",
"aggregationType": "AVG"
},
{
"id": 3003,
"name": "Minimum RH at 2m",
"description": null,
"unit": "%",
"aggregationType": "MIN"
},
{
"id": 3004,
"name": "Maximum RH at 2m",
"description": null,
"unit": "%",
"aggregationType": "MAX"
},
{
"id": 3021,
"name": "Instantaneous RH in canopy",
"description": null,
"unit": "%",
"aggregationType": "AVG"
},
{
"id": 3022,
"name": "Mean RH in canopy",
"description": null,
"unit": "%",
"aggregationType": "AVG"
},
{
"id": 3023,
"name": "Minimum RH in canopy",
"description": null,
"unit": "%",
"aggregationType": "MIN"
},
{
"id": 3024,
"name": "Maximum RH in canopy",
"description": null,
"unit": "%",
"aggregationType": "MAX"
},
{
"id": 3101,
"name": "Leaf wetness in 2m (minutes/hour)",
"description": null,
"unit": "minutes/hour",
"aggregationType": "SUM"
},
{
"id": 3102,
"name": "Leaf wetness in canopy",
"description": null,
"unit": "minutes/hour",
"aggregationType": "SUM"
},
{
"id": 3103,
"name": "Leaf wetness in grass",
"description": null,
"unit": "minutes/hour",
"aggregationType": "SUM"
},
{
"id": 4001,
"name": "Wind direction at 2m (degrees 0-360)",
"description": null,
"unit": "degrees",
"aggregationType": "AVG"
},
{
"id": 4002,
"name": "Instantaneous wind speed at 2m",
"description": null,
"unit": "m/s",
"aggregationType": "AVG"
},
{
"id": 4003,
"name": "Mean wind speed at 2m",
"description": null,
"unit": "m/s",
"aggregationType": "AVG"
},
{
"id": 4004,
"name": "Max wind speed at 2m",
"description": null,
"unit": "m/s",
"aggregationType": "MAX"
},
{
"id": 4005,
"name": "Min wind speed at 2m",
"description": null,
"unit": "m/s",
"aggregationType": "MIN"
},
{
"id": 4011,
"name": "Wind direction at 10m (degrees 0-360)",
"description": null,
"unit": "degrees",
"aggregationType": "AVG"
},
{
"id": 4012,
"name": "Instantaneous wind speed at 10m",
"description": null,
"unit": "m/s",
"aggregationType": "AVG"
},
{
"id": 4013,
"name": "Mean wind speed at 10m",
"description": null,
"unit": "m/s",
"aggregationType": "AVG"
},
{
"id": 4014,
"name": "Max wind speed at 10m",
"description": null,
"unit": "m/s",
"aggregationType": "MAX"
},
{
"id": 4015,
"name": "Min wind speed at 10m",
"description": null,
"unit": "m/s",
"aggregationType": "MIN"
},
{
"id": 5001,
"name": "Solar radiation (Q0) (W/sqm)",
"description": null,
"unit": "W/sqm",
"aggregationType": "SUM"
}
]
Response Explanation
.....
Get metadata about one specific weather data source
From the list of weather datasources in step 1
, we will select one of the weather data sources, inspect its metadata and use this weather datasource to query weather data for our desired location.
Let’s select the no.met.locationforecast
data source and inspect it.
We will send a request to this end point:
https://test.madiphs.org/weather/rest/weatherdatasource/no.met.locationforecast
Response
{
"id": "no.met.locationforecast",
"name": "Met Norway Locationforecast",
"description": "9-day forecasts for the entire planet. 2.5 km resolution in the Nordic-Baltic region, 9km elsewhere",
"public_URL": "https://api.met.no/weatherapi/locationforecast/1.9/documentation",
"endpoint": "{WEATHER_API_URL}/rest/weatheradapter/yr/",
"authentication_type": "NONE",
"needs_data_control": "false",
"access_type": "location",
"priority": 0,
"temporal": {
"forecast": 9,
"historic": {
"start": null,
"end": null
},
"intervals": [
3600
]
},
"parameters": {
"common": [
1001,
3001,
2001,
4002
],
"optional": null
},
"spatial": {
"countries": null,
"geoJSON": "{\"type\": \"Sphere\"}"
},
"organization": {
"name": "The Norwegian Meteorological Institute",
"country": "Norway",
"address": "Postboks 43 Blindern",
"postal_code": "0371",
"city": "Oslo",
"email": "david.melchior@met.no",
"url": "https://www.met.no/en"
},
"active": true,
"endpointFullPath": "https://test.madiphs.org/weather/rest/weatheradapter/yr/"
}
As of the time of this writing, the no.met.locationforecast
contains 9-day weather forecasts for the entire planet. Now we are going to query weather data using our defined location in step 1
Get weather forecast for your location
We will use the following coordinates to query weather data for our location (Lilongwe, Malawi):
latitude = -14.159339
longitude = 33.776864
Parameters = 1001,3001
We will send a request to this end point:
Response
{
"timeStart": "2024-02-20T07:00:00Z",
"timeEnd": "2024-02-29T12:00:00Z",
"interval": 3600,
"weatherParameters": [
1001,
3001
],
"locationWeatherData": [
{
"longitude": 33.776864,
"latitude": -14.159339,
"altitude": 0,
"amalgamation": [
0,
0
],
"data": [
[
31,
62.5
],
[
32.6,
55.7
],
[
33.4,
52.7
],
[
34.4,
48.7
],
[
34.8,
46.9
],
[
34.9,
46.5
],
[
35.2,
45.6
],
[
35.1,
45.3
],
[
34.4,
46.3
],
[
32.2,
55.4
],
[
30.8,
55.4
],
[
29.9,
52.9
],
[
28.7,
55.4
],
[
27.5,
60.3
],
[
26.2,
65.3
],
[
25.1,
70.6
],
[
24.2,
75.5
],
[
23.9,
77.5
],
[
24,
77.8
],
[
24.1,
79.4
],
[
24.1,
80.9
],
[
23.9,
86.2
],
[
26.2,
83.4
],
[
28.9,
75.8
],
[
31.3,
62.9
],
[
33.1,
51
],
[
34.5,
43.9
],
[
35.5,
41.8
],
[
36.5,
39.5
],
[
36.5,
38.8
],
[
36.6,
38.2
],
[
36.1,
38.8
],
[
35.5,
41.3
],
[
33.2,
51.9
],
[
31.2,
59.8
],
[
30,
66.8
],
[
28.8,
75.5
],
[
28.3,
72.3
],
[
27.5,
70.1
],
[
26.5,
75.1
],
[
25.6,
82
],
[
25.1,
86.6
],
[
24.5,
91
],
[
24.1,
93
],
[
23.9,
93
],
[
24,
89.8
],
[
27.1,
75.3
],
[
30.3,
62.7
],
[
32.2,
56
],
[
33.7,
49.2
],
[
34.9,
42.8
],
[
35.9,
38.8
],
[
36.7,
36.2
],
[
37.2,
33.5
],
[
37.5,
31
],
[
37.4,
29.5
],
[
36.3,
31.2
],
[
32.6,
48.8
],
[
30.4,
56.9
],
[
29.4,
75.6
],
[
28.75,
77.36666666666666
],
[
28.099999999999998,
79.13333333333333
],
[
27.45,
80.9
],
[
26.8,
82.66666666666667
],
[
26.15,
84.43333333333334
],
[
25.5,
86.2
],
[
26.316666666666666,
83
],
[
27.133333333333333,
79.8
],
[
27.95,
76.6
],
[
28.766666666666666,
73.4
],
[
29.583333333333332,
70.2
],
[
30.4,
67
],
[
31.583333333333332,
61.88333333333333
],
[
32.766666666666666,
56.766666666666666
],
[
33.95,
51.65
],
[
35.13333333333333,
46.53333333333333
],
[
36.31666666666666,
41.416666666666664
],
[
37.5,
36.3
],
[
36.233333333333334,
42.36666666666667
],
[
34.96666666666667,
48.43333333333333
],
[
33.7,
54.5
],
[
32.43333333333333,
60.56666666666666
],
[
31.166666666666664,
66.63333333333333
],
[
29.9,
72.7
],
[
29.5,
76.38333333333334
],
[
29.099999999999998,
80.06666666666666
],
[
28.7,
83.75
],
[
28.3,
87.43333333333334
],
[
27.9,
91.11666666666666
],
[
27.5,
94.8
],
[
27.9,
91.93333333333334
],
[
28.3,
89.06666666666666
],
[
28.7,
86.19999999999999
],
[
29.099999999999998,
83.33333333333333
],
[
29.5,
80.46666666666667
],
[
29.9,
77.6
],
[
30.916666666666664,
73.66666666666666
],
[
31.933333333333334,
69.73333333333333
],
[
32.95,
65.8
],
[
33.96666666666667,
61.86666666666667
],
[
34.983333333333334,
57.93333333333334
],
[
36,
54
],
[
34.81666666666666,
59.666666666666664
],
[
33.63333333333333,
65.33333333333333
],
[
32.45,
71
],
[
31.266666666666666,
76.66666666666667
],
[
30.083333333333332,
82.33333333333334
],
[
28.9,
88
],
[
28.583333333333332,
89.48333333333333
],
[
28.266666666666666,
90.96666666666667
],
[
27.95,
92.45
],
[
27.633333333333333,
93.93333333333334
],
[
27.316666666666666,
95.41666666666667
],
[
27,
96.9
],
[
27.65,
93.85000000000001
],
[
28.3,
90.8
],
[
28.95,
87.75
],
[
29.599999999999998,
84.7
],
[
30.25,
81.64999999999999
],
[
30.9,
78.6
],
[
32.06666666666666,
73.33333333333333
],
[
33.233333333333334,
68.06666666666666
],
[
34.4,
62.8
],
[
35.56666666666666,
57.53333333333333
],
[
36.733333333333334,
52.266666666666666
],
[
37.9,
47
],
[
36.449999999999996,
54.53333333333333
],
[
35,
62.06666666666667
],
[
33.55,
69.6
],
[
32.1,
77.13333333333334
],
[
30.65,
84.66666666666667
],
[
29.2,
92.2
],
[
29.05,
92.16666666666667
],
[
28.9,
92.13333333333334
],
[
28.75,
92.1
],
[
28.6,
92.06666666666666
],
[
28.45,
92.03333333333333
],
[
28.3,
92
],
[
28.633333333333333,
90.11666666666667
],
[
28.96666666666667,
88.23333333333333
],
[
29.3,
86.35
],
[
29.633333333333333,
84.46666666666667
],
[
29.96666666666667,
82.58333333333334
],
[
30.3,
80.7
],
[
31.6,
74.51666666666667
],
[
32.9,
68.33333333333334
],
[
34.2,
62.150000000000006
],
[
35.5,
55.96666666666667
],
[
36.8,
49.78333333333333
],
[
38.1,
43.6
],
[
36.53333333333333,
51.16666666666667
],
[
34.96666666666667,
58.733333333333334
],
[
33.4,
66.3
],
[
31.833333333333332,
73.86666666666667
],
[
30.266666666666666,
81.43333333333334
],
[
28.7,
89
],
[
28.316666666666666,
90.65
],
[
27.933333333333334,
92.3
],
[
27.549999999999997,
93.95
],
[
27.166666666666664,
95.60000000000001
],
[
26.78333333333333,
97.25
],
[
26.4,
98.9
],
[
26.816666666666666,
96.36666666666667
],
[
27.23333333333333,
93.83333333333334
],
[
27.65,
91.30000000000001
],
[
28.066666666666666,
88.76666666666667
],
[
28.48333333333333,
86.23333333333333
],
[
28.9,
83.7
],
[
29.083333333333332,
83.48333333333333
],
[
29.266666666666666,
83.26666666666667
],
[
29.45,
83.05000000000001
],
[
29.633333333333333,
82.83333333333334
],
[
29.816666666666666,
82.61666666666667
],
[
30,
82.4
],
[
29.566666666666666,
84.31666666666668
],
[
29.133333333333333,
86.23333333333333
],
[
28.7,
88.15
],
[
28.266666666666666,
90.06666666666668
],
[
27.833333333333332,
91.98333333333333
],
[
27.4,
93.9
],
[
27.23333333333333,
94.13333333333334
],
[
27.066666666666666,
94.36666666666667
],
[
26.9,
94.6
],
[
26.73333333333333,
94.83333333333333
],
[
26.566666666666666,
95.06666666666666
],
[
26.4,
95.3
],
[
26.833333333333332,
93.05
],
[
27.266666666666666,
90.8
],
[
27.7,
88.55
],
[
28.133333333333333,
86.3
],
[
28.566666666666666,
84.05
],
[
29,
81.8
],
[
29.46666666666667,
80.23333333333333
],
[
29.933333333333334,
78.66666666666667
],
[
30.4,
77.1
],
[
30.866666666666667,
75.53333333333333
],
[
31.333333333333336,
73.96666666666667
],
[
31.8,
72.4
],
[
31.1,
74.85000000000001
],
[
30.400000000000002,
77.3
],
[
29.700000000000003,
79.75
],
[
29,
82.2
],
[
28.3,
84.64999999999999
],
[
27.6,
87.1
],
[
27.25,
88.75
],
[
26.900000000000002,
90.39999999999999
],
[
26.55,
92.05
],
[
26.2,
93.7
],
[
25.85,
95.35
],
[
25.5,
97
],
[
26.066666666666666,
94.18333333333334
],
[
26.633333333333333,
91.36666666666666
],
[
27.2,
88.55
],
[
27.766666666666666,
85.73333333333333
],
[
28.333333333333332,
82.91666666666666
],
[
28.9,
80.1
],
[
29.099999999999998,
79.73333333333333
],
[
29.3,
79.36666666666666
],
[
29.5,
79
],
[
29.7,
78.63333333333334
],
[
29.900000000000002,
78.26666666666667
],
[
30.1,
77.9
]
],
"qc": [
1,
1
],
"width": 2,
"length": 222
}
]
}