Meteotest Logo
Weather and Solar 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 two main end points:
  • /forecast
  • /measurements
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/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:
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/forecast" | json_pp
    
Response:
{
    "issuetime": "2022-10-24T21:30:33Z",
    "timeseries": {
        "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_critical_temperature_outside": 35.0,
        "hdd_critical_temperature_inside": 20.0,
        "hdd_critical_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,
        "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/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 ICON1 model for Switzerland, set

&source=icon1-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 "azimuth=180" \
    --data "time_from=-24hours" \
    --data "time_to=now" \
    --data "source=solarsat" \
    "https://api.meteotest.ch/api/v1/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 "azimuth=180" \
    --data "time_from=now" \
    --data-urlencode "time_to=+3hours" \
    --data "source=cloudmove" \
    "https://api.meteotest.ch/api/v1/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 "azimuth=180" \
    --data "time_from=now" \
    --data-urlencode "time_to=+72hours" \
    "https://api.meteotest.ch/api/v1/forecast"
            

API Docs

/forecast and /measurements

The /forecast and /measurements endpoints provide the following GET arguments:

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

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
altitude

(number)

altitude in meters

Example: 543

Number range: -100 ... 10000
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:

NUMBERseconds|minutes|hours

Valid examples:
  • 1seconds
  • 30seconds
  • 150seconds
  • 1minutes
  • 10minutes
  • 1hours
  • 12hours
  • 24hours
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

Example: 180

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

(number)

☀️ Inclination of the installed panels.

0° = horizontal, 90° = vertical.

Example: 30

Number range: 0 ... 90
Default: 30
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, i.e., 0°, 30°, 60°, ..., 300°, 330°.
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
hdd_critical_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_critical_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_critical_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

Meta data (parameters, data sources)

Meta data of the API, i.e., the list of available parameters and data sources, can be queried with the following end points:
https://api.meteotest.ch/api/v1/parameters
    
Response:
{
    "parameters": [
        {
            "description": "Air temperature",
            "shortname": "tt",
            "unit": {
                "uid": "celsius",
                "string": "°C",
                "description": "°C"
            }
        },
        {
            "description": "dew point temperature",
            "shortname": "td",
            "unit": {
                "uid": "celsius",
                "string": "°C",
                "description": "°C",
            },
        },
        [...]
    ]
}
            
https://api.meteotest.ch/api/v1/sources
    
Response:
{
    "sources": {
        "forecast": [
            {
                "name": "mos-mix",
                "description": "Model Output Statistics (MOS). [...]"
                "bounding_boxes": [{"lower_left": {"lat": -90.0, "lon": -180.0}}],
                "timerange": "NOW -30 days ... NOW +216 hours",
                "title": "MOS MIX"
                "parameters": [
                    {
                        "description": "Global radiation (on the horizontal plane)",
                        "shortname": "gh",
                        "unit": {
                            "description": "W/m²",
                            "string": "W/m²",
                            "uid": "W_per_m2"
                        }
                    },
                    [...]
                ]
            },
            [...]
        ],
        "measurements": [
            [...]
        ]
    }
}
            

List of 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
tcc Total cloud coverage (100% = overcast) %
hdd Heating degree days °C
cdd Cooling degree days °C
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.

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

shortname description unit
gh Global radiation (on the horizontal plane) W/m²
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/effective energy output kWh
description: Kilowatt-hours
tt Air temperature °C

List of Forecast 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: NOW -30 days ... NOW +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/effective energy output [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:

ICON 1km, Switzerland

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

Usage: &source=icon1-switzerland

Frequency: 1 hours

Temporal range: NOW -2 hours ... NOW +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/effective energy output [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:

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: NOW -3 hours ... NOW +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/effective energy output [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) [%]
  • 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: NOW -3 hours ... NOW +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:

List of 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: 1999-01-01 ... NOW +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/effective energy output [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]
  • sy: Weather symbol [weather_symbol]
  • 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: 2018-01-01 ... NOW +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, Switzerland

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

Usage: &source=radar-switzerland

Frequency: 5 minutes

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

Available Parameters:

  • rr: Precipitation rate [mm/h]

Bounding box(es):