Locationforecast

NAME

Locationforecast - Weather forecast for a specified place

DESCRIPTION

This service delivers a full weather forecast for one location, that is, a forecast with several parameters for a nine-day period.

JSON format and variables

Version 2.0 defaults to JSON format for data. For an explanation of the various variables, see the Datamodel documentation. The JSON format is described in the General Forecast Format documentation.

XML format

For those who want to continue using their existing clients with a minimum of changes, you can also continue using the old XML format. This must be accessed via the classic method, like this:

    https://api.met.no/weatherapi/locationforecast/2.0/classic?lat=59.93&lon=10.72&altitude=90

Note that the msi parameter is now called altitude in 2.0.

The XML format is considered legacy, and as similar to 1.9 as possible except for additional time periods and the XML Schema URI. Future enhancements will primarily be added to the JSON format.

Also, some elements will be removed when version 1.9 is terminated, including the following elements:

    <temperatureProbability unit="probabilitycode" value="0"/>
    <windProbability unit="probabilitycode" value="0"/>
    <symbolProbability unit="probabilitycode" value="1"/>

Weather icons

Along with the new JSON format we also have a new set of weather icons, in PNG, SVG and PDF formats. They can be downloaded from GitHub.

The filename (minus extension) corresponds to the symbol_code in the JSON format, including variations for day, night and polar day. This means there is no need for calculations or fetching data from the Sunrise service in order to present the correct weather icons. This has also been added to the XML as an attribute code to the symbol element:

    <symbol id="PartlyCloud" number="3" code="partlycloudy_day"></symbol>

Note: There is a typing error in lightssleetshowersandthunder and lightssnowshowersandthunder (extra "s" after "light"). Unfortunately, correcting this would mean breaking existing applications, so it has been postponed to the next version of weathericon/locationforecast.

Wind symbols

Wind direction denote where the wind is coming from, where 0° is north, 90° east, etc. For GUI applications use we suggest using arrows, like these:

0° (north)

90° (east)

180° (south)

270° (west)

UV index

The new format also includes UV radiation forecasts per location, to replace the old graphical UVforecast product. For those wanting UV maps these can be downloaded directly from CAMS.

USAGE

Methods

/complete

JSON forecast with all values. This will shortly be expanded with probabilities, so that each variable will be repeated for a set of percentiles.

/compact

A shorter version with only the most used parameters (if you feel something is missing, please let us know)

/classic

The old XML format, now considered legacy. It matches the output of version 1.9 closely, but includes more time periods. Future new parameters will not be added to this version.

Parameters

lat

latitude in decimal degrees, mandatory

lon

longtitude in decimal degrees, mandatory

altitude

Ground surface height above (or sometimes below) sea level in whole meters (integers). Optional but recommended for precise temperature values. When missing the internal topography model is used for temperature correction, which is rather course and may be incorrect in hilly terrain.

Note that this is the altitude of the ground surface! You cannot use this to ask for atmospheric predictions, e.g. for aviation purposes.

Sample request URLs

    https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=60.10&lon=9.58                             # JSON
    https://api.met.no/weatherapi/locationforecast/2.0/complete?lat=-16.516667&lon=-68.166667&altitude=4150   # El Alto, Bolivia
    https://api.met.no/weatherapi/locationforecast/2.0/classic?lat=60.10&lon=9.58                             # Classic XML

Status

Operational status for the model can be checked like this:

    https://api.met.no/weatherapi/locationforecast/2.0/status

Schema

The XML Schema is available at https://api.met.no/weatherapi/locationforecast/2.0/schema

Schema for the JSON format is included in the OpenAPI spec:

    https://api.met.no/weatherapi/locationforecast/2.0/swagger

AUTHENTICATION

Due to poor adherence to the identification requirements in the Terms of Service, we have implemented more stringent checks on sending a unique identifier in the User-Agent header. Any requests with a prohibited or missing User-Agent will receive a 403 Forbidden error.

Examples of banned User-Agents include:

  • okhttp
  • Dalvik
  • fhttp
  • Java

HISTORICAL FORECASTS

While we only serve current forecasts via the API, you can find historical forecast model data in NetCDF format on https://thredds.met.no/thredds/metno.html.

Due to licensing issues we can only distribute model data for the Nordic and Arctic regions. For global model data, please contact ECMWF.

CHANGELOG

Probabilities added: 2021-05-10

As a replacement for the deprecated Probabilityforecast product (to be removed on 2021-07-01), we have added some new variables to the complete.json forecast:

    air_temperature_percentile_10
    air_temperature_percentile_90
    wind_speed_percentile_10
    wind_speed_percentile_90

Version 0.9 EOL: 2021-03-01

After having been deprecated for 9 months, version 0.9 will finally be removed on March 1st, 2021.

XML updated with new symbol codes: 2020-12-14

Since Weathericon/1.1 is deprecated, we have added an attribute code to the symbol element, corresponding to the filename in Weathericon/2.0.

Version 2.0 out of beta: 2020-06-17

  • Version 1.9 will probably be available until 1 Dec 2020. Please follow our mailing list for more details.

Version 2.0 : 2020-06-10

  • Removed "/" endpoint, must now use complete/compact/classic

Version 2.0 : 2020-04-02

  • Beta period nearing completion.
  • XML is now split into different "classic" method.
  • Stricter controls on User-Agent header to avoid throttling.

Version 2.0 : 2020-01-17

  • Beta version of new locationforecast based on FORTI instead of WDB

Version 1.9 : 2014-05-20

  • New version 1.9. Old version, 1.8, will expire on 2014-09-09
  • new weather symbols are added for finer scale representation of the weather situation, see https://api.met.no/weatherapi/weathericon/1.1/documentation .
  • weather symbol ids changed to CamelCase
  • "celcius" unit name corrected to "celsius"

Phase out version 1.5 : 2011-08-16

  • version 1.5 of locationforecast will expire at 2011-10-01. Note that log entry below stating that version 1.5 will be available until version 1.9 is released is no longer correct.

Version 1.8 : 2010-06-10

  • New attributes for the precipitation element: minvalue, maxvalue and probability. Note that these attributes will only be available for locations in a limited area in Europe.
  • 1.8 is meant as a transitional version, you may use 1.5 until we release version 1.9.
  • Version 1.7 will be available until 2010-10-01.

Version 1.7 : 2010-03-03

  • Precipitation and symbol values for the first time intervals have been missing in all earlier versions. This has now been corrected.
  • 1.7 is meant as a transitional version, you may use 1.5 until we release version 1.8.
  • Version 1.6 will be available until 2010-09-01.

Version 1.6 : 2009-01-15

  • 1.6 is meant as a transitional version, meaning that you may use 1.5 until we release version 1.8.
  • probability elements added.
  • fewer elements available for EC-data.

Version 1.5 : 2008-05-30

  • new element, humidity, added to location.
  • version 1.4 will expire 2008-11-01.

Version 1.4 : 2007-12-03

  • changes in <model> element: Added attribute termin, replaced attribute timespan with the attributes from and to.
  • version 1.3 will be available up to and including 2008-03-01.

Version 1.3 : 2007-09-12

  • New version, 1.3, available.
  • v1.3 includes element <meta>, with info about the forecast models.
  • v1.2 will be available up to and including 2007-11-15.

Version 1.2 : 2007-06-15

  • New version, 1.2, available.
  • Version 1.1 will be available up to and including 2007-10-02.
  • Added xml-elements: fog and low/middle/high - clouds.
  • Value of xml-element 'temperature' now originates from a different model-parameter.

Version 1.1 : 2007-04-25

  • Locationforecast has now limited access
  • Locationforecast is might return the XML as plain xml or zipped.

Version 1.0 : 2007-05-15

  • Initial release version
 

Changelog