Next.js Danish address API · App Router + server-side key

Integrate Danish address autocomplete into Next.js 14+ with App Router: a Route Handler proxies the API key server-side, a Client Component renders typeahead. P95 < 30 ms from Danish infrastructure.

Status: Live — requires API key (free, no credit card)

What you get

Route Handler proxy

Call Danadresse server-side in a Route Handler — the API key is never exposed to the browser.

Server Components

Fetch and render address data in an async Server Component — zero JS to the client for static lookups.

TypeScript + @danadresse/client

npm install @danadresse/client — full TypeScript support, Promise-based, zero dependencies.

Example

// app/api/autocomplete/route.ts
export async function GET(req: Request) {
  const q = new URL(req.url).searchParams.get('q') ?? ''
  const r = await fetch(
    `https://api.danadresse.dk/autocomplete?q=${q}`,
    { headers: { 'X-Api-Key': process.env.DANADRESSE_KEY! } }
  )
  return Response.json(await r.json())
}

How it's used

E-commerce checkout

Next.js + Stripe + Danadresse autocomplete — validated address directly in the payment flow.

SaaS onboarding

Registration with server-side address validation — clean data from day one.

Vercel Edge Functions

Deploy the Route Handler as an Edge Function — sub-10ms latency close to your users.

Drop-in DAWA-compatible

The slug /nextjs-adresse-api follows DAWA's conventions — same paths, same JSON shape, same UUIDs. See the migration guide for the full picture.

See also

Free API (1,000 calls/mo) WooCommerce autocomplete Shopify address API Checkout autocomplete Estate agent bundle

Ready to integrate?

Free key, no credit card, 1,000 calls/month.

Start free →    Read the API docs →