API Authentication

API authentication

API authentication

Most products available via the EUMETView APIs are open to all users. However, some require authentication which requires users to generate a time-limited API token, which must be used in the API call to download any products. In order to generate temporary tokens, users must register for an account. More information on account registrations can be found on the registering for an account page.

Once you have registered you should be able to access the Data Services WebUI by following the appropriate link on the New Pilot Data Services page of the EUMETSAT website. This will lead you to the landing page shown below.

Figure: The EUMETView WebUI landing page.

The drop down user menu in the top right (see the figure above) will give an option to get the user API keys. Select this option, and you will presented with the following page.

Figure: API Keys

By default, all of the keys will be hidden. Clicking the show hidden keys button will reveal them.

Your consumer key and consumer secret are specific to you. Once you have them, you can generate an API token in one of three ways.

  • The most simple way is to generate a new key on the website, by clicking the Refresh token button above. Given the time limitations around the token, this method is not practical for regular use.

  • The second method is to generate a new token by running the following curl command from the command line:

1 curl -k -d "grant_type=client_credentials" -H "Authorization: Basic Base64(consumer-key:consumer-secret)" https://api.eumetsat.int/token

In order to use this method, your key and secret must be converted to a Base64 key combination, which replaces Base64(consumer-key:consumer-secret). The show hidden keys button will do this for you. Alternatively, you can encode this yourself by using https://www.base64encode.org/

If you are using https://www.base64encode.org/ to generate a Base64 key combination you should enter consumer-key:consumer-secret exactly as shown.

  • The third method is to generate an API token using the Python requests module. Python-based examples of how to use the EUMETView APIs can be found in a series of supporting Jupyter notebooks that will be made available shortly.

The API token inherits the access permissions granted to the user when setting up the account, and so determines which products are available for access.