Skip to content

Getting started

A client_id and client_secret. Ask Gungner for them — credentials are issued on request (see Getting access). The examples below use YOUR_ORGNR as a placeholder for the Swedish organisation number you want to look up.

Exchange your client_id and client_secret for a bearer token:

Terminal window
curl -s -X POST https://api.gungner.ai/oauth/token \
-H 'content-type: application/json' \
-d '{
"grant_type": "client_credentials",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET"
}'

This returns:

{ "access_token": "…", "token_type": "Bearer", "expires_in": 600 }

Use access_token as a bearer token on every call below. See Authentication and delegation for the full scope model and a reusable token-fetching helper.

Look up a company by its organisation number:

Terminal window
curl -s https://api.gungner.ai/v1/companies/YOUR_ORGNR \
-H "authorization: Bearer YOUR_ACCESS_TOKEN"

Or in TypeScript:

const tokenResponse = await fetch('https://api.gungner.ai/oauth/token', {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({
grant_type: 'client_credentials',
client_id: process.env.GUNGNER_CLIENT_ID,
client_secret: process.env.GUNGNER_CLIENT_SECRET,
}),
});
const { access_token } = await tokenResponse.json();
const response = await fetch(`https://api.gungner.ai/v1/companies/${process.env.GUNGNER_ORGNR}`, {
headers: { authorization: `Bearer ${access_token}` },
}).then((r) => r.json());
// The response is an envelope, { stale, data } — the company profile itself is `data`.
console.log(response.data.name, response.data.status);

You’ll get back { stale, data }: stale: true means the value was served from cache past its revalidation window, and data is the company profile itself — name, legal form, status, registered address, plus an evidence block on each field group recording where the data came from and when.

Company lookup covers Sweden today. Lithuania is planned — see Country coverage for what’s live versus planned, by country.