Authentication
Warning:
The OAuth Client/Secret authentication will be shut off on July 1st, 2025.
Get an API key (or OAuth2 Client)
To use the KG Platform API, you need an API key (or an OAuth2 Client).
The API key (or client credentials) of the GNTB KG will give you read access to all available data. The email address to contact the GNTB is open-data@germany.travel. Please provide your company name and the name and email address of a contact person.
Use API key for API access
Once you have an API key, you can authenticate by
- replacing in the API calls the subdomain "app" with "proxy"
- use the x-api-key header
Example
An API call to fetch the user's details using API-key authentication
NOTE: for using the API key the subdomain is proxy.opendatagermany.io, instead of app.opendatagermany.io
curl -H "x-api-key: $API_KEY" https://proxy.opendatagermany.io/api/cam/users/me
Legacy method: OAuth client (deprecated as of July 1st, 2025)
The legay method, fetching a token with an OAuth Client and Secret, will be deprecated as of July 1st, 2025. The method is listed here for completeness.
Use the OAuth2 client for API access
In the OAuth2 client, you will see a client_id and client_secret information which can be used to generate a JWT token. This JWT access token can be used for further requests to KG Platform API until it expires.
Curl examples for how to generate JWT token and send requests to KG Platform API
Generate a JWT access token:
curl -s https://auth.opendatagermany.io/.com/auth/realms/onlim/protocol/openid-connect/token -d client_id=$YOUR_CLIENT_ID -d client_secret=$YOUR_CLIENT_SECRET -d grant_type=client_credentials -H content-type:application/x-www-form-urlencoded
Make a request against KG Platform API, for example:
curl -H "Authorization: Bearer $ACCESS_TOKEN" https://app.opendatagermany.io/api/cam/users/me
Example:
Given the following API call to fetch the user's details:
curl -H "Authorization: Bearer $ACCESS_TOKEN" https://app.opendatagermany.io/api/cam/users/me
Updated 1 day ago