Getting started
What you need
Section titled “What you need”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.
1. Mint a token
Section titled “1. Mint a token”Exchange your client_id and client_secret for a bearer token:
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.
2. Make your first call
Section titled “2. Make your first call”Look up a company by its organisation number:
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.
What’s next
Section titled “What’s next”- Authentication and delegation — the full scope model, and a reusable client helper.
- Subject ID — the stable identifier every lookup and event carries.
- Using the MCP server — the same data, reachable as MCP tools instead of REST.
- API reference — every route, interactive, generated from the API itself.
- Getting access — how credentials are issued, and where to send requests.