Next.js developer in Gothenburg

Next.js for businesses in Gothenburg, delivered remotely by one developer.

Next.js developer

My place in the WordPress community

  • I have had a wordpress.org account since 2006.
  • I contributed to WordPress core for versions 7.0 and 7.1.
  • I maintain 30 plugins on wordpress.org.
  • I organise and speak at WordCamps.
  • I have attended every WordCamp Europe from 2017 to 2026.
  • Local WordPress meetup: WordPress Göteborg Meetup

My WordPress.org profile

A Swedish customer types an organisation number and expects the company name, the form and the business description to appear. Bolagsverket, the Swedish Companies Registration Office, provides an API for that. I write the Next.js side of such an integration from Gdynia, with decisions kept in email. Which data your product may use for which purpose is for you and your adviser to decide.

Gothenburg city court building, Goteborgs radhus

The Goteborgs radhus in central Gothenburg. Picture by Arild Vagen, CC BY-SA 4.0, Wikimedia Commons.

#What are the high-value datasets at Bolagsverket?

Bolagsverket describes high-value datasets as company information that must be available to everyone to use free of charge. They come from Bolagsverket and Statistics Sweden (SCB), through an API or downloadable files. The page says the EU regulation entered into force on 9 February 2023 and that the Swedish government was granted an exception with a two-year transition period for several authorities, Bolagsverket and SCB among them. From 3 February 2025 the data is free of charge.

The relevant statement for a developer is this one: the API costs nothing and needs no agreement. A paid API with more detailed information exists next to it, and the page notes that the EU decision does not change fees for other APIs and services that distribute company information.

Bolagsverket points out that data is free when fetched through an API or a designated file. The ordinary e-service for buying certificates and documents works as before.

#What data does the API return?

When you send an organisation number, the API page says you can get, for example, the company name and number, what business the company runs (business description and SNI codes) and its digitally filed annual reports.

The detailed list on the page includes:

Field groupSource
Identity designation (organisation number)Bolagsverket and SCB
All organisation names, including special business namesBolagsverket and SCB
Organisation form, de-registration date and reasonBolagsverket
Ongoing winding-up or restructuring, with code, text and dateBolagsverket
Legal form, active organisation status, SNI codesSCB
Advertising block (reklamsparr) as yes or noSCB
Postal address, registration and formation dates, business descriptionBolagsverket and SCB

The page says data from Bolagsverket is used when it exists at both authorities, and data from SCB when Bolagsverket has none. An organisation can also exist only at SCB, for example a private person without a registered name or an association that has not registered a business.

The page lists which organisation forms are covered, with codes such as AB, KB, HB, BRF, EK and E for sole proprietorships. A sole trader appears only when the person has a registered sole proprietorship at Bolagsverket.

#Which annual reports can I fetch?

The API has a document list operation. For an organisation number it returns the documents linked to the company: a document ID, the file format, the end of the reporting period and the registration time. The document ID goes to a separate endpoint, which returns a zip file with the document.

Only digitally filed annual reports are included. The page says there is no obligation to file digitally, and the API covers what Bolagsverket supports digitally: annual reports for aktiebolag under K2 and K3, group accounts under K3, and reports in the ESEF taxonomy. A company that files on paper has no document in this API. An app that promises “the latest annual report for every Swedish company” would be wrong for those companies, so the empty state needs real copy.

#How do I get access?

The access page describes three steps:

  1. Submit the customer notification form.
  2. Receive API keys, a client_id and a client_secret, for the test and production environments, by email and SMS to the contact details you gave.
  3. Test in the test environment, then connect to production.

The form asks for a working email address, which must not be a noreply address, and a mobile number. On 13 May 2026 Bolagsverket published a notice on that page about high demand on API support and said that response and handling times can be longer than usual. Plan for that when a launch date depends on the keys.

#What are the technical limits?

From the API page:

  • The API is a REST service over HTTP and JSON, calls must be encrypted with HTTPS, and authorisation uses OAuth 2.
  • Performance allows each user 60 queries per minute.
  • A detailed description is in the developer portal, which runs on WSO2. When I tried to open the portal for this page without a login, the automated request was refused. So the token endpoint and the exact grant type are details I take from the portal during a project, not from memory.
  • The test environment contains test companies for checking the responses of each operation.
  • Bolagsverket has a page on how API changes are handled and a page on service levels. The service level page lists service hours as all days, 00 to 24, with incident priorities and response times.

The sixty queries per minute apply to each user, and the page does not say what counts as a user. Ask Bolagsverket if you plan to share one set of keys across several products.

#How does this fit into a Next.js app?

The keys are a client secret. In Next.js, environment variables without the NEXT_PUBLIC_ prefix are available only in the Node.js environment, according to the docs, so the secret and the token live there and never reach a browser bundle. The call goes through a Route Handler, defined in a route.ts file in the app directory.

The Next.js docs also say that fetch on the server can set its own caching. next.revalidate takes a seconds value, and cache: 'no-store' fetches on every request. For company data this gives a clear split:

  • the OAuth 2 access token is cached on the server until shortly before it expires, so a lookup does not need a token call each time
  • company data gets a short revalidate window, long enough to stop a form from hitting the API on every keystroke
  • the annual report zip is not cached by the app, and is streamed to the user or handed to a processing job

A sketch of the lookup endpoint:

// app/api/company/[orgnr]/route.ts
import { getAccessToken } from "@/lib/bolagsverket-token";

export async function GET(
  _req: Request,
  ctx: { params: Promise<{ orgnr: string }> }
) {
  const { orgnr } = await ctx.params;
  if (!/^\d{10}$/.test(orgnr)) {
    return Response.json({ error: "invalid" }, { status: 400 });
  }

  const token = await getAccessToken(); // server-only, cached until near expiry
  const res = await fetch(`${process.env.BOLAGSVERKET_API_URL}/organisationer`, {
    method: "POST",
    headers: {
      Authorization: `Bearer ${token}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ identitetsbeteckning: orgnr }),
    cache: "no-store",
  });

  if (res.status === 429) {
    return Response.json({ error: "busy" }, { status: 503 });
  }
  return Response.json(await res.json());
}

The path, the body field and the token helper are placeholders. The real operation names come from the developer portal and I confirm them there before building. The point of the sketch is the shape: validate the number on the server, keep the token on the server, treat a rate limit as a normal state.

#Which limits does the 60 per minute set on the design?

A lookup form that fires on each keystroke breaks it within seconds. The usual design is a single lookup on submit, with the organisation number checked for format before the call. Anything that loops over a list of customers needs a queue that spends the budget evenly, and a shared counter if the app runs on several server instances. A counter in memory on each instance would allow more than the page permits.

Bolagsverket also offers a file download of the high-value datasets for all organisations. For a nightly sync of a large customer list a file is a different tool from an API call, and I would check the downloadable files page before building a queue.

#What about personal data and advertising?

The page says the data may be used freely, commercial or not, as long as the use does not break laws on personal data protection or secrecy. It adds that licences and conditions, which can include a source credit and correct reproduction, should be checked per dataset.

Two details matter in the interface. The data includes an advertising block flag registered at SCB, shown as yes or no. A product that uses the data for outbound marketing has a reason to read that field and act on it. And sole proprietorships are identifiable people, so how a stored extract is kept and for how long is a data protection question for your adviser.

#How does a Bolagsverket integration project run?

  1. You send the use case: who looks up which company, from which screen and how often.
  2. I write down the call pattern against the 60 per minute limit, the empty states for companies without digital reports and the points your adviser needs to rule on.
  3. While Bolagsverket handles the registration, I build against the test environment on a staging deployment.
  4. After your written approval of staging, the production keys go in and the feature goes live.

I need the contact person for the Bolagsverket registration, the expected daily volume and the fields the interface shows. The wider list of Next.js work I take on is on the Next.js developer page.

#Swedish company data in a Gothenburg product

If your Gothenburg product needs company names, SNI codes or filed annual reports from Bolagsverket, send the use case through the contact form: the screen that triggers the lookup, the expected volume and whether you need documents. You get a first written estimate for the token handling and the lookup screen at no charge. Which data you may use, and how long you may keep it, is for you and your adviser to decide.

See also in Sweden

Need this service: Next.js developer in Gothenburg?

Describe your project by e-mail. I reply within 24 hours.

Describe your project

Explore other WordPress services and knowledge base