Frost v1 (work in progress)
DISCLAIMER: This version of Frost is still work in progress. MET Norway does not guarantee that the service will always behave 100% according to documentation or expectations.


API Response

The response to the API request is given in the JSON format.

Example of an API Response from frost.met.no v1

When we ask for air temperature observations (incobs=true), at Blindern (Oslo) in the time interval 2022-10-20 08:00:00 - 2022-10-20 09:00:00 UTC, we receive the following response in JSON (the response is somewhat shortened to simplify the example):
    
    "data": {
        "tstype": "met.no/filter",
        "tseries": [
            {
                "header": {
                    "id": {
                        "level": 10,
                        "parameterid": 211,
                        "sensor": 0,
                        "stationid": 18700
                    },
                    "extra": {
                        "element": {
                            "description": "Air temperature (default 2 m above ground), present value",
                            "id": "air_temperature",
                            "name": "Air temperature",
                            "unit": "degC"
                        },
                        "station": {
                            "location": [
                                {
                                    "from": "1941-01-01T00:00:00Z",
                                    "to": "9999-01-01T00:00:00Z",
                                    "value": {
                                        "elevation(masl/hs)": "94",
                                        "latitude": "59.942300",
                                        "longitude": "10.720000"
                                    }
                                }
                            ],
                            "shortname": "Oslo (Blindern)"
                        },
                        "timeseries": {
                            "geometry": {
                                "level": {
                                    "unit": "m",
                                    "value": "10"
                                }
                            },
                            "quality": {
                                "exposure": [
                                    ...
                                ],
                                "performance": [
                                    ...
                                ]
                            },
                            "timeoffset": "PT0H",
                            "timeresolution": "PT1H"
                        }
                    }
                },
                "observations": [
                    {
                        "time": "2022-10-20T08:00:00Z",
                        "body": {
                            "data": "2.9000001",
                            "qualitycode": "2"
                        }
                    },
                    ...
                ]
            },
            ...
        ]
    }
    

Explanation of API Response

header: Contains information about the observation data and the measurement equipment (metadata)
  • id: Contains information that identifies a time series in a unique way
  • level:
  • parameterid: The identification key (a number) corresponding to an elementid
  • sensor:
  • stationid: internal MET Norway weather station id number
extra: Additional useful information about the time series
  • element: Information about the elementid
    • description: Text description of elementid
    • id: The elementid name
    • name: elementid text name
    • unit: The measurement unit of the elementid
  • station: Information about the meteorological station
    • location: Information about the location of the station
      • elevation: Height above mean sea level
      • latitude: The latitude of the station
      • longitude: The longitude of the station
    • shortname: Station name (in short form)
  • timeseries: Information about the time series
    • geometry: Where is the measuring instrument situated at the station
      • level: Vertical position
        • unit: The measurement unit of the height
        • value: The height above ground of the measuring instrument
    • quality: Information about the quality of the station (placement, representativity of the area, quality of the instruments)
      • exposure: the representativity of the placement
        • from: Quality data is valid from
        • to: Quality data is valid to
        • value: The quality value
      • performance: the quality of the sensor
        • from: Quality data is valid from
        • to: Quality data is valid to
        • value: The quality value
    • timeoffset: (No longer relevant for Frost v1) Observation time relative to midnight, see text on Meteorological concepts
    • timeresolution: How often this weather parameter is measured (the period of the measurement)
observations: The actual weather observation data
  • time: Time of observation/measurement
  • body:
    • data: The actual measurement
    • corrected: The corrected measurement (a correction may happen if there is a known instrument/station error)
    • qualitycode: The quality of this particular measurement (see more information below)

Example of an API Response from havvarsel-frost.met.no

When we ask for water temperature observations (incobs=true), at buoy 1-34071 in the time interval 2020-07-29T16:00:00 - 2020-07-31T23:00:00 UTC, we receive the following response in JSON:
  
    {
  "data": {
    "tstype": "badevann",
    "tseries": [
      {
        "header": {
          "id": {
            "buoyid": "1-34071",
            "parameter": "temperature",
            "source": "yr.no"
          },
          "extra": {
            "name": "Kuvauen",
            "pos": {
              "lat": "10.83966",
              "lon": "59.09197"
            }
          }
        },
        "observations": [
          {
            "time": "2020-07-29T16:00:00Z",
            "body": {
              "value": "17.0"
            }
          },
          {
            "time": "2020-07-31T12:29:00Z",
            "body": {
              "value": "19.5"
            }
          },
          {
            "time": "2020-08-01T08:44:00Z",
            "body": {
              "value": "18.5"
            }
          }
        ]
      }
    ]
  }
}
  

Explanation of API Response

header: Contains information about the observation data and the measurement equipment (metadata)
  • buoyid: The buoy id number
  • parameter: The weather parameter measured
  • source:The source of the buoy data (often the organization submitting and/or owning the buoy(s)
extra: Additional useful information about the time series
  • name: The name of the buoy (set by the organization submitting the data)
  • pos: Information about the location of the buoy
    • lat: The latitude of the buoy
    • lon: The longitude of the buoy
observations: The actual weather observation data
  • time: Time of observation/measurement
  • body:
    • value: The actual measurement

Get the response on CSV format

The short version:

When you have made a request URL (or made a script to request data), you can add the hdrcsv and obscsv parameters to your request to get the result in the CSV hybrid format. hdrcsv defines the header, and obscsv defines the main CSV part.

The part you add to a URL:

  
    &hdrcsv={"id":{"stationid":""}},{"id":{"sensor":""}},{"id":{"level":""}},{"extra":{"element":{"id":""}}}&obscsv={"time":""},{"body":{"data":""}}
  

The explanation:

The output format of the response is by default JSON, however you can specify a hybrid CSV format using the parameters: hdrcsv and obscsv.
The hybrid CSV format will consist of a header on top of comma separated columns of data. If you ask for observations from more than one stationid or elementid, you will get a header/columns combination for each of the time series (try the example below to test it!).

You can use hdrcsv to define what the header should contain, and obscsv to specify what columns to include.

For example one can define that we want the stationid, sensor, level, and the elementid (from the "extra" metadata section) in the header:
  
hdrcsv={"id":{"stationid":""}},{"id":{"sensor":""}},{"id":{"level":""}},{"extra":{"element":{"id":""}}}
  
And the minimum one might need in the observation part is time and the data:
  
obscsv={"time":""},{"body":{"data":""}}
  

To put it all togehter, try this example url:
NB! If you use Firefox browser and it shows you a SyntaxError JSON error, you may have to click on the Raw Data option at the top of the browser window!

https://frost-beta.met.no/api/v1/obs/met.no/filter/get?incobs=true&elementids=air_temperature,wind_speed&stationids=18700&time=2021-01-01T00:00:00Z/2021-01-01T04:00:00Z&hdrcsv={"id":{"stationid":""}},{"id":{"sensor":""}},{"id":{"level":""}},{"extra":{"element":{"id":""}}}&obscsv={"time":""},{"body":{"data":""}}

What to do:

In other words, when you have made a request URL you can add the part with the hdrcsv and obscsv parameters at the end of your URL to get the result in the CSV hybrid format!
The part you add:

  
    &hdrcsv={"id":{"stationid":""}},{"id":{"sensor":""}},{"id":{"level":""}},{"extra":{"element":{"id":""}}}&obscsv={"time":""},{"body":{"data":""}}
  

Error handling

We use regular 4xx and 5xx http status codes, as close as possible to the HTTP specification. Some errors will have a message of what went wrong in it. You will get an error message if there are no data matching your request but this does not mean there is anything wrong with your request in itself, only that you will have to change your search criteria. Some errors will respond with JSON. Do not encode those JSON error responses, as they might change without proper versioning as described above.

There might be cases where the service can give a successfull response, but the response object is missing some data. In that case, we will include one or more warning messages in the object.