-
Station Observations: Weather Station Identifiers | Find Station | Missing Data/Data Gaps |
Available weather station parameters | Example queries | Stations across an area
Weather Station Data
Station Observations
The NCM Weather API provides a wide selection of weather station data around the globe. This also includes buoy measurement data.
In order to query data from weather stations, the source has to be set to mix-obs
.
api-mm.ncm.gov.sa/validdatetime/parameters/station_id/format?source=mix-obs&optionals
Weather Station Identifiers
There are two possibilities to specify the desired station_id. Either coordinates or specific NCM station codes can be used. If you choose coordinates, the data from the nearest station is retrieved. You can also combine multiple stations from the same or different origin with each other using the+
Identifier | Description | Example |
---|---|---|
Station ID | id_<sation_id> |
id_164 is the Al Dariyah station in Riyadh |
Find Station
It is possible to get a list of available weather stations from which you can select the desired station identifiers. Several conditions can be specified in order to filter the list of stations. The output is a sorted list of stations matching the specified conditions. The output format is CSV.
api-mm.ncm.gov.sa/find_station?<conditions>Available conditions:
Identifier | Description | Example |
---|---|---|
location |
Coordinates: location=<lat>,<lon> , or bounding box location=<lat_max>,<lon_min>_<lat_min>,<lon_max> |
location=47.3,9.3 , location=47.3,9.3_40,10 , location=germany |
elevation |
in meters ASL: elevation=<elevation> |
elevation=2500 |
parameters |
specify all parameters of interest: parameters=<comma separated parameter list> |
parameters=t_2m:C,wind_speed_10m:ms |
startdate |
find all stations that record data at least since this date: startdate=<iso timestamp> |
startdate=2017-10-01T00Z (find all stations that are active since this date or before) |
enddate |
find all stations that record data at least until this date: enddate=<iso timestamp> |
enddate=2017-11-01T00Z (find all stations that are active until this date or later) |
-
Query for all stations on the globe no matter which parameters are measured:
https://api-mm.ncm.gov.sa/find_station -
Query for all stations in Germany that measure precipitation at a height of approximately 300 m above sea level. The vertical offset from the selected height is given in a separate column Vertical Distance in the output:
https://api-mm.ncm.gov.sa/find_station?location=germany¶meters=precip_1h:mm&elevation=300 -
Find stations for a coordinate that measure temperature since Jan 1st, 2018 or earlier. The horizontal offset from the selected coordinate is given in meter in a separate column Horizontal Distance in the output:
https://api-mm.ncm.gov.sa/find_station?location=50.705502,10.467007¶meters=t_2m:C&startdate=2018-01-01T00:00:00Z
Station Category;Station Type;ID Hash;WMO ID;Alternative IDs;Name;Location Lat,Lon;Elevation;Start Date;End Date;Horizontal Distance;Vertical Distance;Effective Distance
SYNOP;SYNA;21627491;;345;Raqei - Border Guard;29.0667,46.6272;290m;2023-12-13T09:23:00Z;2025-03-22T10:58:00Z;-999;-999;-999
SYNOP;SYNA;22914726;;48;Wadi Alfora;23.4246,39.7118;699m;2023-12-11T15:40:00Z;2025-06-23T06:24:00Z;-999;-999;-999
SYNOP;SYNA;74084147;;36;Mataar Municipality;21.5994,39.2544;21m;2023-12-11T15:40:00Z;2025-06-23T06:24:00Z;-999;-999;-999
SYNOP;SYNA;78979023;;244;Tabuk AirPort;28.3731,36.6006;767.11m;2023-12-11T15:40:00Z;2025-06-23T06:27:00Z;-999;-999;-999
SYNOP;SYNA;83134259;;328;Alwoul;23.3087,46.471;662m;2024-02-13T11:26:00Z;2025-06-23T06:24:00Z;-999;-999;-999
SYNOP;SYNA;85066812;;99;Wadi Ben Hishbl;18.604,42.6677;2012m;2023-12-11T15:40:00Z;2025-06-23T06:24:00Z;-999;-999;-999
SYNOP;SYNA;96830676;;195;Al Neriah;27.4553,48.4712;70m;2023-12-11T15:40:00Z;2025-06-23T06:24:00Z;-999;-999;-999
SYNOP;SYNA;101055195;;155;Al Namas;19.1699,42.2335;2181m;2023-12-11T15:40:00Z;2025-06-23T06:24:00Z;-999;-999;-999
...
Alternative IDs corresponds to the NCM Station IDs.
Missing Data/Data Gaps
It is possible to specify the treatment of missing station values. Therefore, the optionon_invalid
has to be added to the query.
Identifier | Description |
---|---|
fail |
Send an error message as soon as data is missing (default) |
fill_with_invalid |
Replace invalid and missing data by -999. |
Available weather station parameters
The weather parameters that can be queried, depend on the parameters that are recorded at the desired weather station. For a general overview of available weather station parameters, please see: available weather station parameters.
Example queries
-
Query for the station observations for temperature and wind speed for Riyadh via Station ID:
https://api-mm.ncm.gov.sa/2025-07-16T00Z--2025-07-17T00Z:PT1H/t_2m:C,wind_speed_10m:ms/id_164/html?source=mix-obs&on_invalid=fill_with_invalid -
By using the
sign you can combine both stations into one query with csv as output format:+
https://api-mm.ncm.gov.sa/2025-07-16T00Z--2025-07-17T00Z:PT1H/t_2m:C,wind_speed_10m:ms/id_164+id_328/csv?source=mix-obs&on_invalid=fill_with_invalid
Stations across an area
By using a GetFeature
-Request, it is possible to query station data within a specified bounding box. The request is constructed as follows:
https://api-mm.ncm.gov.sa/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=<feature_type>&TIME=<validdatetime>&BBOX=<min_lon,min_lat,max_lon,max_lat>&PARAMETERS=<parameters>
Currently, only one station feature type is available: stations_mix-obs
, which contains most of our combined observational data.
Parameter | Description | Example |
---|---|---|
TIME | A single point in time (UTC) as specified in the section Date/Time Description. TIME always refers to validdatetime. The response depends on the feature type, see the examples below. | TIME=2018-04-12T12:45Z |
BBOX | A bounding box specified by maximal and minimal latitude and longitude formatted according to BBOX=<min_lon,min_lat,max_lon,max_lat> (please note the order). The response will only contain features that are located within this area. If left unspecified, all available features will be returned. | BBOX=5.8,47.9,10.7,45.7 |
PARAMETERS | The parameters that you wish to query formatted as a comma-separated list as specified here. The DescribeFeatureType contains all the relevant parameters provided by the station type. For technical reasons the name of the XML node will have the colons (: ) replaced with an underscore (_ ), e.g. t_2m:C will end up as t_2m_C . For WFS purposes only you may also use this format in the queries. | t_2m:C,dew_point_2m:C or t_2m_C,dew_point_2m_C |
The response will be XML. More details on GetFeature
-Requests can be found here.
-
Query for station measurements of 2m temperature on April 12th 2018, at 13:00 UTC inside a bounding box around Switzerland:
https://api-mm.ncm.gov.sa/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=stations_mix-obs&TIME=2018-04-12T13:00Z&BBOX=5.77,45.74,10.65,47.89&PARAMETERS=t_2m:C