Geo-coordinates (latitude and longitude) in WGS-84 decimal format. It is possible to query a single point, a point list, a line, or a rectangle. In source mix-obs you can also use an identifier instead of coordinates to specify a station.
a) Start point + duration
You need to define the beginning and the duration of the desired period. A period of date elements always starts with the duration designator P and is followed by the desired period (years (Y), months (M) and days (D)). For periods of time elements the time designator T follows (hours (H), minutes (M) and seconds (S)). The result is a list of ascending time steps beginning with the defined starting point and ending with the last time step of the defined period.
Additionally, you have to specify the spacing of the time period - depending on your needs you may want hourly time steps or just daily steps? The spacing is also denoted with P or PT within the command. Example: __replace__0T13:00:00ZP5D:PT12Hhttps://api.meteomatics.com/__replace__0T13:00:00ZP5D:PT12H/t_2m:C/47.4245,9.3767/csv?model=mix
The definition of the period starts with P and means that the time period starts on the 28th of May 2017 at 13 UTC and lasts 5 days until the 2nd of June 2017 at 13 UTC. After PT follows the spacing of the time period. In this case the time period is divided into steps of 12 hours. The example link fetches temperature data for a given location for the specified time steps.
There are several shortcuts available for easier access to recent data. If you use such a shortcut in a command it will expand to full date/time notation. There are two kinds of shortcuts:
a) Shortcuts including date and time
In order to represent the current date and time you can use now. This command will expand to YYYY-MM-DDThh:mm:ssZ. The shortcut now can be shifted by hours (H), minutes (M) and seconds (S). For example, now+2H, now+30M and now+60S.
This example fetches precipitation data for the current time until 5 hours ahead with a step size of one hour.
b) Shortcuts including date only: additional specification of time required
The shortcuts yesterday, today, tomorrow will expand to YYYY-MM-DD. These shortcuts can be shifted by years (Y), months (M) and days (D). For example, yesterday-1Y, today-3M. tomorrow+2D. Note that you have to add a time specification to these shortcuts. The shortcuts can also be used in a list of time points: yesterdayT18Z,todayT18Z,tomorrowT18Z.
This example fetches relative humidity data from yesterday with a step size of 3 hours.
If you query parameters, which are averaged or accumulated over a certain time interval, you have to note that all time intervals are right-bounded. This means that a parameter like precip_3h:mm yields the accumulated precipitation sum over the previous 3 hours. So, the value at 18 UTC represents the precipitation sum from 15 UTC until 18 UTC.
The following table shows a summary of all described possibilities:
Single point UTC
2015-01-20T18Z - 20th January 2015, 18:00 UTC
Single point local time
2015-01-20T14:35+01:00 - 20th January 2015, 14:35 CET (UTC+01:00) All time stamps in output are in UTC. Please see Local time (Time zones)
Time Period (fixed length)
2017-05-28T13:00:00ZP10D:PT1H (a period of 10 days with a step size of 1 hour)
Options for duration and step:
1D: 1 day
1W: 1 week
1M: 1 month
1Y: 1 year
T1H: 1 hour
T1M: 1 minute
T1S: 1 second
and combinations of the previous, e.g. 1DT1H
Time Period (fixed end)
2017-05-28T13:00:00Z--2017-05-30T13:00:00Z:P1D (a period between two dates with step size of 1 day
Comma-separated list of sorted time points and/or periods
<isodate or period>,<isodate or period>,...,<isodate or period>
When working with latitudes and longitudes, please note that their representation in the response will contain at most 6 digits after the decimal point. This allows to represent coordinates with sub-m precision, which significantly exceeds the resolution of most data sources.
An example showing the temperature along the train line from St. Gallen via Wil and Winterthur to Zurich with 10 sample points between each two stations:
https://api.meteomatics.com/__replace__0T12:00:00Z/t_2m:C/47.42,9.37_47.46,9.04:10+47.51,8.78:10+47.39,8.57:10/csv Please note that following requests require the area requests option:
Point lists containing more than 10 coordinates
Polylines with more than 10 segments
Countries and regions
The API features a broad list of country shortcuts.
Don't hesitate to contact us if you require another country or region.
This is a short description of available output formats. Please refer to the API-Response section for details.