How to use Luna API

Luna API is a REST-service.


For major changes to the api, we will add a new version number to the url, e.g /api/v2/. For smaller changes to the api, we will provide a beta service which includes those changes, before merging the changes into the production version.

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. Some errors will respons 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.


To be able to receive data via Luna API, you have to have an agreement on delivery of weather services from Luna.

Luna API uses OpenID connect to authenticate users. The authentication is a two-step process. First generate an access token by passing the client ID and client secret to the endpoint and then use the access token to get the data from Luna API.

Example using curl:

Step 1, generate an access token:

curl -d 'grant_type=client_credentials&client_id=<client_id>&client_secret=<client_secret>' ''

Step 2, use the access token to get data:

curl -H 'Authorization: Bearer <access token>' '<ID>/json'