API Response

The response to the API request is 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": "ranked",
        "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": [
                                    ...
                                ]
                            }
                        }
                    }
                },
                "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: Height of measurement above ground level in meters
  • parameterid: The identification key (a number) corresponding to an elementid
  • sensor: Which sensor did the measurement
  • 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 at the station is the measuring instrument situated
      • 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 for the area of the station 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 (more information on the request webpage)

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

When we ask for water temperature observations (incobs=true) from 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 (this number is not necessarily unique!)
  • 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

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.