WebCam Observations API icon

WebCam Observations API

(0 reviews)
The WebCam API allows access to web camera imagery from web cameras located at airports, aerodromes and other locations around the country.

home

The WebCam API provides the capability to obtain lists of web cam identifiers, lists of links to web cam imagery and web cam images themselves.

Web camera imagery is received every 4 minutes from the network of Automatic Weather Stations. The web camera images are searcable and available for up to 24 hours from the time the image was received.

Supported calls

Seven API calls are currently supported:

https://api.metservice.com/observations/nz/webcam

This API call will return a list of web cam identifiers and other metadata for which an image has been received in the last 60 minutes.

https://api.metservice.com/observations/nz/webcam/<webcamId>/latest

This API call will retrieve a link to the last image received for the given webcamId in the last 60 minutes.

https://api.metservice.com/observations/nz/webcam/<webcamId>/last/<minutes>/minutes

This API call will retrieve a list of images for the given webcamId with an image timestamp within the preceding number of minutes.

https://api.metservice.com/observations/nz/webcam/aerodrome

This API call will return a list of web cam identifiers and other metadata, at airports or aerodromes, for which an image has been received in the last 60 minutes.

https://api.metservice.com/observations/nz/webcam/aerodrome/<aerodrome>

This API call will return a list of web cam identifiers and other metadata, at the specified airport or aerodrome, for which an image has been received in the last 60 minutes.

https://api.metservice.com/observations/nz/webcam/other

This API call will return a list of web cam identifiers and other metadata, not at an airport or aerodrome, for which an image has been received in the last 60 minutes.

https://api.metservice.com/observations/nz/webcam/image/<imagePath>

This API call will return the webcam image specified by the imagePath.

For more information about the supported calls refer to the individual endpoint overviews in the Specification section in the left hand column.

URI Parameters
ParameterExampleDescription
webcamIdnzwn_cam0The unique identifier for the web camera. Use the /wbcam API call to retrieve a list of identifiers for which observations have been received in the last 60 minutes.
minutes60The number of minutes back in time from now that a data query should search.
Valid Value Range:
1-1440
aerodromenzwnThe ICAO location code for a given airport or aerodrome.
imagePathnzwb_cam0/202112240100.jpgThe path to the actual image in the web camera image store.
Call Status Codes
StatusDescriptionMeaning
200OKThe request was successful. The requested data is returned in the body of the message.
400Bad RequestEither the request was malformed or the parameters were incorrect.
401UnauthorizedA valid apikey or bearer token was not supplied or authentication failed based upon apikey or bearer token provided. The supplied apikey is not authorised to access data for the supplied stationId.
500Internal Server ErrorSome unexpected error has occurred.
Response Data

The response data will be returned in json except for when an image is requested.

The data in the results array of the response will be either:

  • a list of webcam identifiers with associated metadata or
  • a list of links to webcam images with the associated timestamp (in UTC) for that image.

Webcam List Result:

    "results": [
        {
            "webcamId": "nzqn_cam0",
            "name": "Queenstown Airport",
            "orientation": "SouthWest",
            "latitude": -45.018,
            "longitude": 168.740,
            "elevation": 357
        },
....
FieldDescription
webcamIdThe unique identifier for this web camera.
nameA shortname or description indicting the location for this web camera.
orientationA textual cardinal desription of the direction the web camera is facing.
latitudeThe decimal latitude point where web camera is located.
latitudeThe decimal longitude point where web camera is located.
elevationThe approximate elevation above mean sea level of this web camera.

Image List Result:

    "results": [
        {
            "imageTimestamp": "2022-01-04T19:48:00Z",
            "fileLocation": "https://api.metservice.com/observations/nz/webcam/image/metservice-airport-webcam-images-2-api/nzqn_cam0/202201041948.jpg"
        },
....
FieldDescription
imageTimestampThe timestamp of the time at which the image was taken in ISO 8601 format.
fileLocationA API link to use to retrieve the actual image for the given Image Timestamp.

Example Calls

curl --location --request GET 'https://api.metservice.com/observations/nz/webcam' --header 'Authorization: Bearer <your bearer token goes here>'

curl --location --request GET 'https://api.metservice.com/observations/nz/wecam/nzri_cam0/latest -header 'Authorization: Bearer <your bearer token goes here>'

curl --location --request GET 'https://api.metservice.com/observations/nz/webcam/nzwb_cam1/last/30/minutes' --header 'apikey: <your apikey goes here>'

curl --location --request GET 'https://api.metservice.com/observations/nz/webcam/aerodrome' --header 'apikey: <your apikey goes here>'

curl --location --request GET 'https://api.metservice.com/observations/nz/webcam/aerodrome/nzqn' --header 'apikey: <your apikey goes here>'

curl --location --request GET 'https://api.metservice.com/observations/nz/webcam/other' --header 'apikey: <your apikey goes here>'

curl --location --request GET 'https://api.metservice.com/observations/nz/webcam/image/metservice-airport-webcam-images-2-api/nzwb_cam0/202112240100.jpg' --header 'Authorization: Bearer <your bearer token goes here>'

Security

The API is currently secured in two ways:

Authentication
  • by provision of an API Key provided on an HTTP header of type "apikey".API Key authentication is performed against the Gateway Developer Portal database using standard gateway assertions. An API Key is assigned when an Application is configured within the Gateway Developer Portal for the API customer. The API customers Application must have this API assigned to it for use.
  • by provision of a Bearer token provided on an HTTP header of type "Authorization"Bearer token authentication is performed by validating and decoding against a JWKS (JSON Web Key Set). Currently an OKTA and MetConnect JWKS are supported. The bearer token will have been assigned when the API user or application authenticated against another Authentication service.

Reviews