Meteotest Logo
Weather and Climate API
Forecasts. Measurements. Historic data.
Projected typical years based on IPCC climate scenarios.
Special parameters for ☀️ power grid management, power trading, monitoring and operation of PV plants, building automation, and facility management.

Getting Started

The API has only three end points:
  • /forecast,
  • /measurements, and
  • /climate.
As an example, for a forecast of the parameters temperature (tt), rain (rr), and total cloud cover (tcc), the URL looks as follows:
https://api.meteotest.ch/api/v1.0/forecast
?lat=46.9534
&lon=7.4237
&parameters=tt,rr,tcc
&time_from=now
&time_to=+24hours
    
Access token.
To access the API, you need a valid access token that you'll have to send as part of the HTTP header (see example below). Soon, you'll be able to manage subscriptions on this website. In the meantime, if you're interested in a demo or real subscription, send us an email: office@meteotest.ch.
Here's a working example using cURL (using Python to pretty-print the result):
curl -G --header "Authorization: Bearer INSERT-YOUR-TOKEN" \
    --data "lat=46.9534" \
    --data "lon=7.4237" \
    --data "parameters=tt,rr,tcc" \
    --data "time_from=now" \
    --data-urlencode "time_to=+6hours" \
    "https://api.meteotest.ch/api/v1.0/forecast" | python3 -m json.tool
    
Response:
{
    "issuetime": "2022-10-24T21:30:33Z",
    "payload": {
        "frequency": "1hours",
        "index": [
            "2022-10-24T22:00:00Z",
            "2022-10-24T23:00:00Z",
            "2022-10-25T00:00:00Z",
            "2022-10-25T01:00:00Z",
            "2022-10-25T02:00:00Z",
            "2022-10-25T03:00:00Z"
        ],
        "values": {
            "rr": [
                0.0,
                0.0,
                0.0,
                0.0,
                0.0,
                0.0
            ],
            "tcc": [
                75.0,
                75.0,
                75.0,
                75.0,
                75.0,
                87.5
            ],
            "tt": [
                12.5,
                12.2,
                11.9,
                11.6,
                11.4,
                11.2
            ]
        },
        "lat": 46.9534,
        "lon": 7.4237,
        "step_type": {
            "rr": "AVERAGE",
            "tcc": "AVERAGE",
            "tt": "AVERAGE"
        }
    },
    "request": {
        "azimuth": 180,
        "cdd_temperature_outside": 35.0,
        "hdd_temperature_inside": 20.0,
        "hdd_temperature_outside": 12.0,
        "horizon": null,
        "inclination": 30,
        "installed_capacity": null,
        "lat": 46.9534,
        "lon": 7.4237,
        "parameters": [
            {
                "description": "Precipitation rate",
                "shortname": "rr",
                "unit": {
                    "description": "mm/h",
                    "string": "mm/h",
                    "uid": "mm_per_h"
                }
            },
            {
                "description": "Total cloud coverage (100% = overcast)",
                "shortname": "tcc",
                "unit": {
                    "description": "%",
                    "string": "%",
                    "uid": "percent"
                }
            },
            {
                "description": "Air temperature",
                "shortname": "tt",
                "unit": {
                    "description": "\u00b0C",
                    "string": "\u00b0C",
                    "uid": "celsius"
                }
            }
        ],
        "resample_to": null,
        "solar_tracker_horizontal": null,
        "solar_tracker_vertical": null,
        "source": null,
        "time_from": "2022-10-24T21:30:33Z",
        "time_to": "2022-10-25T03:30:33Z"
    }
}

            

If you're interested in measurements rather than forecasts, use the same URL arguments with end point /measurements. Example:

curl -G --header "Authorization: Bearer INSERT-YOUR-TOKEN" \
    --data "lat=46.9534" \
    --data "lon=7.4237" \
    --data "parameters=tt,rr,ff" \
    --data "time_from=2022-09-01T00:00:00Z" \
    --data "time_to=2022-10-01T00:00:00Z" \
    "https://api.meteotest.ch/api/v1.0/measurements"
    

The API automatically selects the weather model (or data source for measurements) that best suits the requested location and parameters. You can query a particular weather model or data source by using the source URL argument. As an example, to query the Cosmo1 model for Switzerland, set

&source=cosmo1-switzerland
            

Tutorial for Solar ☀️ Applications

The API provides several parameters relevant for the monitoring and operation of PV plants. See parameters for a complete list of available parameters, the most important of which are

For operations, the API provides satellite-based radiation data with a temporal resolution of 15 minutes. To query radiation data for the past 24 hours:
curl -G --header "Authorization: Bearer INSERT-YOUR-TOKEN" \
    --data "lat=46.9534" \
    --data "lon=7.4237" \
    --data "parameters=gh,gk,e" \
    --data "inclination=30" \
    --data "inclination=180" \
    --data "time_from=-24hours" \
    --data "time_to=now" \
    --data "source=solarsat" \
    "https://api.meteotest.ch/api/v1.0/measurements"
            

When you plot the response using your favourite programming language, it would look something like this:

The API also provides satellite-based radiation nowcasting with a temporal resolution of 15 minutes. To query radiation data for the next 3 hours:

curl -G --header "Authorization: Bearer INSERT-YOUR-TOKEN" \
    --data "lat=46.9534" \
    --data "lon=7.4237" \
    --data "parameters=gh,gk,e" \
    --data "inclination=30" \
    --data "inclination=180" \
    --data "time_from=now" \
    --data-urlencode "time_to=+3hours" \
    --data "source=cloudmove" \
    "https://api.meteotest.ch/api/v1.0/forecast"
            

The default forecast with hourly resolution, i.e., the forecast you get when you don't specify a particular source=, also provides the solar parameters. To query radiation data for the next 72 hours:

curl -G --header "Authorization: Bearer INSERT-YOUR-TOKEN" \
    --data "lat=46.9534" \
    --data "lon=7.4237" \
    --data "parameters=gh,gk,e" \
    --data "inclination=30" \
    --data "inclination=180" \
    --data "time_from=now" \
    --data-urlencode "time_to=+72hours" \
    "https://api.meteotest.ch/api/v1.0/forecast"
            

URL Fields

Fields with a ☀️ are relevant only if you request one (or several) of the following parameters:
gk, dh, bh, dni, gh_max, e, e_total

Fields with a 🌎 are relevant for /climate end points only.

Name Description
lat
* required

(number)

query point, latitude

Example: 47.545

Number range: -90 ... 90
lon
* required

(number)

query point, longitude

Example: 7.54

Number range: -180 ... 180
parameters
* required

(string)

Comma-separated list of parameters.

The following parameters are available: tt, ff, fx, dd, qff, rh, rr, sy, tcc, gh, gk, bh, dh, dni, e, e_total, hdd, cdd, gh_max.

Example: tt,rr,gh

time_from
* required

(string)

Start time of request. Either
  • RFC3339 UTC (YYYY-MM-DDThh:mm:ssZ),
  • the string "now", or
  • a relative date/time string (relative with respect to the current time).
Examples of relative date/time strings (note that you have to url-encode the plus sign):
  • now
  • +72hours
  • -24hours
  • +90minutes
  • -30minutes
  • +7days
  • -3days

Example: 2020-01-01T00:00:00Z

time_to
* required

(string)

End time of request.

See time_from for details.

Example: 2020-01-01T00:00:00Z

resample_to

(string)

Desired temporal resolution of response.

Format:

NUMBERminute(s)|hour(s)|day(s)|month(s)|year(s)

Valid examples:
  • 1minute
  • 1minutes
  • 10minutes
  • 1hour
  • 12hours
  • 1day
  • 1year
If omitted, the returned time series will have the original temporal resolution of the underlying data set.

Example: 30minutes

azimuth

(number)

☀️ Azimuth of solar panel.

Conventions:

  • 0° = oriented towards the north
  • 90° = oriented towards the east
  • 180° = oriented towards the south
  • 270° = oriented towards the west

See "solar-tracker-horizontal" if your solar panel has got tracking.

Example: 180

Number range: 0 ... 360
Default: 180
inclination

(number)

☀️ Inclination of the installed panels.

0° = horizontal, 90° = vertical.

See solar-tracker-vertical if your solar panel has got tracking.

Example: 30

Number range: 0 ... 90
Default: 30
solar-tracker-horizontal

(string)

☀️ Compute radiation parameters for a panel that minimizes the angle of incident on the horizontal axis.

coming in 2023/Q1...

If this argument is set, then argument azimuth is ignored.

Format:
MIN_ANGLE...MAX_ANGLE (degrees)

Example: -90...90

solar-tracker-vertical

(string)

☀️ Compute radiation parameters for a panel that minimizes the angle of incident on the vertical axis.

coming in 2023/Q1...

If this argument is set, then argument inclination is ignored.

Format:
MIN_ANGLE...MAX_ANGLE (degrees)

Example: -90...90

horizon

(string)

☀️ 12 integer values (elevation angle in degrees) that descibre the 360° horizon of location.

The horizon is taken into account when computing special solar parameters.

The 12 numbers are in the order north → east → south → west → north.
For example, 20,20,20,0,0,0,0,0,0,0,0,20 corresponds to a 20° horizon in the north and in the east.

Example: 0,0,0,0,0,0,0,0,20,20,20,0

installed_capacity

(number)

☀️ Installed capacity of solar panel in kW, i.e., kWp (kilowatt peak).

This argument is mandatory for parameter e_total and is being ignored for any other parameters.

Example: 500

Number range: 0 ... 1000000000
performance_ratio

(number)

☀️ Performance ratio of solar power plant.

coming in 2022/Q4...

The performance ratio describes the relationship between the actual and theoretical energy outputs of the PV plant.

This argument is taken into account for parameters e and e_total.

Example: 0.8

Number range: 0 ... 1
Default: 0.8
hdd-temperature-inside

(number)

Heating degree days: Critical inside temperatur in degrees celsius.

This argument is only relevant if you request parameter hdd.

Example: 19

Number range: 0 ... 50
Default: 20
hdd-temperature-outside

(number)

Heating degree days: Critical outside temperatur in degrees celsius.

This argument is only relevant if you request parameter hdd.

Example: 5

Number range: -30 ... 30
Default: 12
cdd-temperature-outside

(number)

Cooling degree days: Critical outside temperatur in degrees celsius.

This argument is only relevant if you request parameter cdd.

Example: 35

Number range: 20 ... 60
Default: 35
source

(string)

Query forecast or measurements from a specific weather model or measurements source, respectively. See the documentation for more details.

Example: mos-mix

scenario

(string)

🌎 Climate scenario. Possible values:
  • rcp19
  • rcp26
  • rcp34
  • rcp45
  • rcp6
  • rcp7
  • rcp85

Example: rcp19

Weather Parameters

shortname description unit
tt Air temperature °C
td dew point temperature °C
rr Precipitation rate mm/h
rh Relative humidity %
gh Global radiation (on the horizontal plane) W/m²
ff Wind speed km/h
dd Wind direction °

description: angle in degrees
fx Wind gusts km/h
qff Mean sea level pressure hPa

description: hectopascal
sy Weather symbol weather_symbol

description: Meteotest weather symbol code. 1: sunny, 2: light coverage, 3: strong coverage, 4: completely covered, 5: heat thunderstorms, 6: heavy precipitation, 7: snow fall, 8: fog, 9: sleet, 10: rain shower, 11: light precipitation, 12: snow shower, 13: front thunderstorms, 14: low stratus, 15: sleet shower.
tcc Total cloud coverage (100% = overcast) %
hdd Heating degree days °C
cdd Cooling degree days °C

For solar ☀️ industry applications, the following parameters are provided:

shortname description unit
gk Global radiation on the inclined plane W/m²
dh Diffuse radiation on the horizontal plane W/m²
bh Direct radiation on the horizontal plane W/m²
dni Direct normal irradiation W/m²
gh_max Clear sky radiation W/m²
e Energy output per kWp installed Wh/kWp
description: Wh per kW peak installed
e_total Total energy output, given the installed capacity kWh
description: Kilowatt-hours

End Points

URL description
https://api.meteotest.ch/api/v1.0/forecast This end point returns forecasts for any location on earth. The best weather models for the given location, time range, and parameters are chosen automatically.

Example:

https://api.meteotest.ch/api/v1.0/forecast
?lat=46.9534
&lon=7.4237
&parameters=tt,rr,tcc
&time_from=now
&time_to=+24hours
                    
https://api.meteotest.ch/api/v1.0/measurements

This end point returns measurement data for any location on earth. The best data sources for the given location, time range, and parameters are chosen automatically.

Example:

https://api.meteotest.ch/api/v1.0/measurements
?lat=46.9534
&lon=7.4237
&parameters=tt,rr,tcc
&time_from=2022-01-01T00:00Z
&time_to=2022-01-31T23:00Z
                    
https://api.meteotest.ch/api/v1.0/climate

coming in 2023 Q3...

Weather Models

MOS MIX

Model Output Statistics (MOS). The forecast is based on the global weather forecasting models IFS (ECMWF) and GFS. The output of these global models is then statistically optimised using measurement data from weather stations. MOS MIX provides forecasts with high accuracy specifically for your location. Note that, in the context of our former product suite solarwebservices.ch, MOS MIX was called "SolarForecast" ☀️. Updated on an hourly basis.

Usage: &source=mos-mix

Frequency: 1 hours

Temporal range: -72 hours ... +216 hours

Available parameters:

  • ☀️ bh: Direct radiation on the horizontal plane [W/m²]
  • cdd: Cooling degree days [°C]
  • dd: Wind direction [°]
  • ☀️ dh: Diffuse radiation on the horizontal plane [W/m²]
  • ☀️ dni: Direct normal irradiation [W/m²]
  • ☀️ e: Energy output per kWp installed [Wh/kWp]
  • ☀️ e_total: Total energy output, given the installed capacity [kWh]
  • ff: Wind speed [km/h]
  • fx: Wind gusts [km/h]
  • gh: Global radiation (on the horizontal plane) [W/m²]
  • ☀️ gh_max: Clear sky radiation [W/m²]
  • ☀️ gk: Global radiation on the inclined plane [W/m²]
  • hdd: Heating degree days [°C]
  • qff: Mean sea level pressure [hPa]
  • rh: Relative humidity [%]
  • rr: Precipitation rate [mm/h]
  • sy: Weather symbol [weather_symbol]
  • tcc: Total cloud coverage (100% = overcast) [%]
  • td: dew point temperature [°C]
  • tt: Air temperature [°C]

Bounding box:

Cosmo 1km, Switzerland

Latest generation weather model with a spatial resolution of 1km. Run by MeteoSuisse. Updated every 3 hours.

Usage: &source=cosmo1-switzerland

Frequency: 1 hours

Temporal range: -2 hours ... +30 hours

Available parameters:

  • ☀️ bh: Direct radiation on the horizontal plane [W/m²]
  • cdd: Cooling degree days [°C]
  • dd: Wind direction [°]
  • ☀️ dh: Diffuse radiation on the horizontal plane [W/m²]
  • ☀️ dni: Direct normal irradiation [W/m²]
  • ☀️ e: Energy output per kWp installed [Wh/kWp]
  • ☀️ e_total: Total energy output, given the installed capacity [kWh]
  • ff: Wind speed [km/h]
  • fx: Wind gusts [km/h]
  • gh: Global radiation (on the horizontal plane) [W/m²]
  • ☀️ gh_max: Clear sky radiation [W/m²]
  • ☀️ gk: Global radiation on the inclined plane [W/m²]
  • hdd: Heating degree days [°C]
  • qff: Mean sea level pressure [hPa]
  • rh: Relative humidity [%]
  • rr: Precipitation rate [mm/h]
  • tcc: Total cloud coverage (100% = overcast) [%]
  • td: dew point temperature [°C]
  • tt: Air temperature [°C]

Bounding box:

Global Forecast System

The Global Forecast System run by the United States' National Weather Service. Updated every 3 hours.

Usage: &source=gfs

Frequency: 3 hours

Temporal range: -3 hours ... +192 hours

Available parameters:

  • ☀️ bh: Direct radiation on the horizontal plane [W/m²]
  • cdd: Cooling degree days [°C]
  • dd: Wind direction [°]
  • ☀️ dh: Diffuse radiation on the horizontal plane [W/m²]
  • ☀️ dni: Direct normal irradiation [W/m²]
  • ☀️ e: Energy output per kWp installed [Wh/kWp]
  • ☀️ e_total: Total energy output, given the installed capacity [kWh]
  • ff: Wind speed [km/h]
  • fx: Wind gusts [km/h]
  • gh: Global radiation (on the horizontal plane) [W/m²]
  • ☀️ gh_max: Clear sky radiation [W/m²]
  • ☀️ gk: Global radiation on the inclined plane [W/m²]
  • hdd: Heating degree days [°C]
  • qff: Mean sea level pressure [hPa]
  • rh: Relative humidity [%]
  • rr: Precipitation rate [mm/h]
  • tcc: Total cloud coverage (100% = overcast) [%]
  • tt: Air temperature [°C]

Bounding box:

CloudMove nowcasting system

Our shortest-term forecasting system CloudMove is based on a novel forecasting concept: using wind fields from weather models, the currently measured cloudiness is propagated into the future to forecast the radiation for (almost) any location in the world. Updated every 15 minutes.

Usage: &source=cloudmove

Frequencies: 10 minutes , 15 minutes

Temporal range: -0 minutes ... +6 hours

Available parameters:

  • ☀️ bh: Direct radiation on the horizontal plane [W/m²]
  • ☀️ dh: Diffuse radiation on the horizontal plane [W/m²]
  • ☀️ dni: Direct normal irradiation [W/m²]
  • gh: Global radiation (on the horizontal plane) [W/m²]
  • ☀️ gh_max: Clear sky radiation [W/m²]
  • ☀️ gk: Global radiation on the inclined plane [W/m²]

Bounding box:

Data Sources for Measurements

SwissMetNet – measurement network for Switzerland

Measurements interpolated from 160 stations run by MeteoSwiss.

Usage: &source=swissmetnet

Frequency: 1 hours

Temporal range: -365 days ... +0 minutes

Available Parameters:

  • ☀️ bh: Direct radiation on the horizontal plane [W/m²]
  • cdd: Cooling degree days [°C]
  • dd: Wind direction [°]
  • ☀️ dh: Diffuse radiation on the horizontal plane [W/m²]
  • ☀️ dni: Direct normal irradiation [W/m²]
  • ☀️ e: Energy output per kWp installed [Wh/kWp]
  • ☀️ e_total: Total energy output, given the installed capacity [kWh]
  • ff: Wind speed [km/h]
  • fx: Wind gusts [km/h]
  • gh: Global radiation (on the horizontal plane) [W/m²]
  • ☀️ gh_max: Clear sky radiation [W/m²]
  • ☀️ gk: Global radiation on the inclined plane [W/m²]
  • hdd: Heating degree days [°C]
  • qff: Mean sea level pressure [hPa]
  • rr: Precipitation rate [mm/h]
  • td: dew point temperature [°C]
  • tt: Air temperature [°C]

Bounding box(es):

SolarSat, satellite-based radiation data

SolarSat provides radiation data, independent of measurement instruments, for (almost) any location in the world.

Usage: &source=solarsat

Frequencies: 10 minutes , 15 minutes

Temporal range: -168 hours ... +0 minutes

Available Parameters:

  • ☀️ bh: Direct radiation on the horizontal plane [W/m²]
  • ☀️ dh: Diffuse radiation on the horizontal plane [W/m²]
  • ☀️ dni: Direct normal irradiation [W/m²]
  • gh: Global radiation (on the horizontal plane) [W/m²]
  • ☀️ gh_max: Clear sky radiation [W/m²]
  • ☀️ gk: Global radiation on the inclined plane [W/m²]

Bounding box(es):

Precipitation radar, Swtzerland

Near real-time precipitation data based on Swiss radar stations.

Usage: &source=radar-switzerland

Frequency: 5 minutes

Temporal range: -30 days ... +0 minutes

Available Parameters:

  • rr: Precipitation rate [mm/h]

Bounding box(es):

Uploading your own measurements

coming in November 2022...

FAQ

Are you planning on offering additional output formats such as xml or csv?

No, not at the moment. We would like to keep the API simple and, hence, just stick to JSON. However, we are working on a feature that allows you to view API responses in the browser, in the form of tables and charts.

Are you interested in a customized API end point? Or do you need help processing the data? Let us know: office@meteotest.ch.