The frost.met.no API is intended to provide free access to MET Norway's archive of historical weather and climate data, in addition to station history information. This page contains useful reference documentation related to usage of the API. Contact us if you have more detailed questions about the application you are looking to build.

  1. Getting Started.
  2. API Version
  3. Authentication
  4. Authorization
  5. Weather and Climate Element Identifiers
  6. Calculation Method
  7. Time Specification
  8. Geometry Specification
  9. Search Filter
  10. JSON Filter
  11. Resources, Schema, Parameters, Verbs
  12. Hypermedia
  13. CORS
  14. Localization
  15. Mailing List


Getting Started

This API is primarily for developers who need to develop scripts or applications that use MET Norway's archive of historical weather and climate data. The API is easy to use; all you need is an e-mail address.

To get started using the frost.met.no API:

  1. Request your client credentials.
  2. Play with and learn more about the resources available in API Reference (copy your client_id(username) into the appropriate form).
  3. Begin developing your application. All calls must be authenticated with your client_id(username). To authorize access to confidential resources and data, you require an access token acquired through the OAuth2 client credentials grant (as well as permission to access those resources). Note that the vast majority of data on this service is open, so the authorization flow is only rarely required.

Store your client_id(username) and client_secret(password) securely. The client_id is used to identify your application. There are currently no hard data retrieval limits on use of the API (these may come later), but client_ids which place undue strain on the server infrastructure during this period will be deleted without prior warning.



API Version

The frost.met.no API is currently in alpha. As such, it should not be used for production tasks.



Authentication

The frost.met.no API requires all requests to include a client_id(username) to authenticate. You pass the client_id to the API using basic authentication. Using curl, this can be done as follows:

curl -i --user YOUR-CLIENT-ID: "https://frost.met.no/tests/secureHello"
  

Note the punctuation after the client_id, to indicate an empty password field.

In the API Reference, you can paste the client_id into the form, in order to authenticate calls. Alternatively, if you try to access a resource call without authenticating, the browser will usually pop-up a credentials dialog where you can enter the client_id.



Authorization

The authorization feature is currently not implemented. Only free data is available.



Weather and Climate Element Identifiers

See an overview of the available element identifiers (IDs) in the Table of Weather and Climate Elements (experimental!). The IDs are defined for use in Frost API and are, as far as possible, based on CF standard names and structured as a Calculation Method.



Calculation Method

A calculation method defines in detail how a particular element is derived, typically by combining statistical functions in different ways.

The following combinations are currently available:

CombinationExample
<base name>air_temperature
<method>(<base name>)from_direction_of_peak(sea_surface_primary_wave)
<method>(<base name> <period>) best_estimate_sum(precipitation_amount P1M)
<method>(<inner method>(<base name> < inner period>) <period>)mean(max(wind_speed P1D) P1M)
<method>(<inner method>(<base name> < inner period>) <period> <threshold>) integral_of_excess(mean(air_temperature P1D) P1M 17.0)

where the components are defined as follows:

ComponentDescription
base nameThe primary quantity. Normally this is a basic physical quantity. It is normally in accordance with the CF standard name table or CF guidelines for construction of standard names.
methodThe main method (function), applied either directly to the primary quantity or indirectly via an inner method.
inner methodThe inner method (function), applied directly to the primary quantity and used as argument to the main method.
periodThe period over which the main method is applied. This is an ISO 8601 duration such as P1D (one day) or P1M (one month).
inner periodThe period over which the inner method is applied. Also an ISO 8601 duration.
thresholdA threshold applicable to the main method.


A more detailed description of the various calculation methods is available directly from the elements endpoint.

Methods and time periods correspond to cell methods and time bounds in the CF convention.



Time Specification

Our time specification is based on ISO-8601, extended with repeating intervals which do not exist in the ISO standard.

It is important to note that intervals follow standard inclusive/exclusive semantics; i.e., [0,1) representing a value that is equal to or greater than 0, and less than 1.

As per the ISO standard, repeating time points are repeated immediately after each other. So, for example:

R4/2005-07-01T00:00/2005-07-01T06:00

Represents the four consecutive time intervals:

2005-07-01T00:00/2005-07-01T06:00

2005-07-01T06:00/2005-07-01T12:00

2005-07-01T12:00/2005-07-01T18:00

2005-07-01T18:00/2005-07-02T00:00

For repeating intervals, we add a duration that represents the time between the start points of the interval. So for example:

R4/2005-07-01T00:00/2005-07-01T06:00/P1D

Represents the four time intervals (separated by a duration of 1 day):

2005-07-01T00:00/2005-07-01T06:00

2005-07-02T00:00/2005-07-02T06:00

2005-07-03T00:00/2005-07-03T06:00

2005-07-04T00:00/2005-07-04T06:00



Geometry Specification

The place (geographic location) of a data item is the position of the item on the earth in a 2D space. In frost.met.no Frost API, the geographic location is specified using longitude and latitude in a WGS84 coordinate system. The geographic dimension is specified using a geometry object and can be either a point or a polygon.

Geometry objects in the JSON format are specified in the GeoJson format, as specified in IETF RFC 7946. When querying, however, we specify the geometry using Well-known text (WKT). WKT is a text markup language for representing vector geometry in a spatial reference system. The current standard definition is in the ISO/IEC 13249-3:2016 standard. In addition to the geometry object, one can also specify an interpolation function to refine/expand the query.

Using WKT, we can specify the following distinct locations:

Geometry specification
Specification Description
POINT (30 10) Retrieve the exact point given by the geometry object with longitude 30 and latitude 10 in WGS84 projection.
POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10)) Retrieve the points contained within the geometry object given by the coordinates. Note that, currently polygons with holes are not supported by the Frost API.
nearest(POINT (30 10)) Retrieve the point in the data set that is nearest to the geometry object given by the point.


Search Filter

The standard search filter is case-insensitive and supports asterisks ('*') to represent zero or more characters.

For example, 'f*n*d' matches 'Finland'.



JSON Filter

A JSON filter is a special type of JSON object that consists of zero or more key-value pairs: "<key1>": "<value1>", "<key2>": "<value2>", ... The braces around the object may be omitted, like in this case. Each value is a comma-separated list of search filters.

For example, the request

    https://frost.met.no/elements/v0.jsonld?sensorLevels="values":"2","levelTypes":"height_above_ground"

matches elements with sensor level type height_above_ground and sensor level value 2.

Resources

The frost.met.no API provides a RESTful API centered around resources. These resources can be acted upon using the standard HTTP verbs. Descriptions of the available resources can be found in the API Reference.

HTTP Verbs

The frost.met.no API attempts to use appropriate HTTP verbs to perform actions on resources.

Verb Description
GET use to retrieve data
POST use to load data to the API (requires Authorization)
PUT use to update data in the API (requires Authorization)
DELETE not permitted at this time


Hypermedia

The API currently supports Hypermedia through swagger, via the reference endpoint.

https://frost.met.no/reference

Cross Origin Resource Sharing

Currently not enabled.



Localization

Currently not enabled.



Mailing List

The following mailing list can be used for posting questions about usage of the API and for receiving important announcements:

http://lists.met.no/mailman/listinfo/datametno-users