Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Register your application

To use the BarentsWatch API application developers must register their applications with BarentsWatch. Please see: (Norwegain / English)

Please see for information in Norwegian about how to obtain an API user or send an e-mail to 

The API supports Open ID Connect flows like client credentials, authorization code, and device code. Self registered clients only supports client_credentials. You must contact BarentsWatch to set up other types of clients.

The OpenID discovery document is here: (production).


You need ClientID and ClientSecret from self-registration on MyPage/Minside, or obtained from BarentsWatch.

Request and use an access token using client_credentials

Obtain your access token

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

  • URL must be
  • Header-parameter 'content-type' must be 'application/x-www-form-urlencoded'
  • Parameter 'grant_type' must be 'client_credentials'
  • Parameter 'client_id' must be provided - use full ID which is often on the form
  • Parameter 'client_secret' must be provided
  • Parameter scope must be 'api'

Example request using curl:

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d "client_id=YOUR_CLIENT_ID&scope=api&client_secret=YOUR_CLIENT_SECRET&grant_type=client_credentials"

Example success response:


For more information see

Use your access token to access API

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

-- Header --

GET /bwapi/v1/geodata/waveforecast/available/?modelname=folda&fairwayid=1 HTTP/1.1
User-Agent: My Application Name
Content-Type: application/x-www-form-urlencoded
Content-Length: nn
Authorization: bearer MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3

Verifying token

To verify that the token works as expected, you can make a GET request to

This endpoint requires authentication, and will return http status code 401 when there is something wrong with the token. If you get 200, the request with token was successful.

More information

These external websites might be useful for developers:

  • No labels