Page tree

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


Table of Contents

Intended audience

This page is intended for software developers who would like to access our API in order to build their own applications based on data gathered and combined by Barentswatch. 

Prerequisites, licencing and crediting

To use the BarentsWatch API you have to register your application with BarentsWatch. Please seeThis link contains information about the data Barentswatch gathers and provides access to via our APIs (Norwegian) 

Information about how to obtain an API user: Please see requirements for using the Barentswatch API can be found here: (Norwegian) or send an e-mail to .

If you have any questions or problems connecting (after reading the rest of this page), contact us at 

How to connect to the Barentswatch API.

The BarentsWatch API supports Open ID Connect flows (client credentials, authorization code, and device code). You will need to register a client with us in order to access the APIs. The OpenID discovery document is here:

Registering a Client

In order to access the Barentswatch API you need an Api Client. You can register your own client API Client connected to your user. To to so you must first create a user and log in at Here you can self register clients for use with your application.

Self registered clients only supports Open ID Connect's client_credentials flow. You If you need to use something other than credentials flow, you will have to contact BarentsWatch ( to set up other types of clients.

The OpenID discovery document is here: (production).

How to request an access token


Obtaining an Access Token

Once you have a client (either from self-registration on MyPage/Minside, or obtained from BarentsWatch.


) you can use the clients ClientID and ClientSecret to obtain an Access Token. The Access Token is used for granting access to endpoints providing data. 

An application can obtain a token for use with the BarentsWatch API by posting a token request via HTTPS to

  • URL must be
  • Header 'content-type' must be 'application/x-www-form-urlencoded'
  • Body must have four key-value pairs, separated by ampersand (&):
    • Key 'grant_type' must have value 'client_credentials'
    • Key 'client_id' must have your full client ID as value, which is often written like this: If your client does not url-encode automatically, you must url-encode it like this:
    • Key 'client_secret' must have a client secret you have created, as value.
    • Key 'scope' must have value 'api'

Note that the client_id, client_secret, scope (and grant_type) need to be sent in the body – not as headers!

Example request, using curl:


More information:

Example request/


response, using postman:

Image Added

Using your access token to access the API

This is an example request to the BarentsWatch API to get available forecast times for a particular fairway.



Using your registered client to access the OpenAPI documentation

You can log in to the OpenAPI-documentation with your own client.

  • Go to
  • Click 'Authorize'
  • Below the headline "oauth2 (OAuth2, clientCredentials)":
    • Replace client_id with your own client_id. It has to be URL-encoded like this: You can copy your URL-encoded client_id from by expanding My clients/Mine klienter in MyPage/Minside.
    • Enter your client_secret
    • Select 'api' scope (tick the box)
  • Click 'Authorize', and then 'Close'