---
title: "Postal code API: Norway and 123 more countries | APIFor"
description: "Look up a postcode and get the place name, region and coordinates. Norway has 5,132 postcodes in our snapshot, 124 countries in total. Data from GeoNames, CC BY 4.0."
canonical: "https://apifor.dev/guides/postal-code-api/"
---

**All guides All docs**

- [Guides](https://apifor.dev/guides/)
- postal code API Norway

# Postal code API: Norway and 123 more countries

GET /v1/postal-codes?country=NO&postal_code=0150 returns the place name, county and coordinates for a Norwegian postcode, and the same call works for 124 countries. The data is GeoNames (CC BY 4.0), and each request costs 1 credit.

Last checked 1 Dec 2026. Service: [Postal codes dataset](https://apifor.dev/postal-codes/). Reference: [endpoint docs](https://apifor.dev/docs/reference/postal-codes/).

## Norwegian postcodes

Norway uses four-digit postcodes. Our snapshot holds 5,132 of them, each with `place_name`, the county in `admin1_name`, and `lat` and `lng`. Keep the leading zero: Oslo codes start at 0001, so store postcodes as strings, never as integers.

To go the other way, from a town to its postcodes, search by name: `GET /v1/postal-codes?country=NO&q=Bergen`. Results are paged, 50 by default and up to 200 per page.

## Request

Send your key in the `x-api-key` header. New accounts get 1,000 free requests after email verification; [the quickstart](https://apifor.dev/docs/quickstart/) takes about a minute.

GET curl

```bash
curl 'https://api.apifor.dev/v1/postal-codes?country=NO&postal_code=0150' \
  -H 'x-api-key: YOUR_API_KEY'
```

Python

```
import os
import requests

r = requests.get(
    "https://api.apifor.dev/v1/postal-codes",
    params={
        "country": "NO",
        "postal_code": "0150",
    },
    headers={"x-api-key": os.environ["APIFOR_API_KEY"]},
    timeout=30,
)
r.raise_for_status()
print(r.json()["data"])
```

JavaScript

```
const res = await fetch("https://api.apifor.dev/v1/postal-codes?country=NO&postal_code=0150", {
  headers: { "x-api-key": process.env.APIFOR_API_KEY },
});
const { data } = await res.json();
console.log(data);
```

## Response

The OpenAPI example shows the row shape with Andorra's AD100. Norwegian rows in our snapshot include 0001, 0010 and 0015, all Oslo, Oslo County. The full spec is at [api.apifor.dev/v1/openapi.json](https://api.apifor.dev/v1/openapi.json).

200 OK

```json
{
  "success": true,
  "data": [
    {
      "id": 1,
      "country_code": "AD",
      "postal_code": "AD100",
      "place_name": "Canillo",
      "admin1_name": "Canillo",
      "admin1_code": "02",
      "admin2_name": null,
      "admin2_code": null,
      "admin3_name": null,
      "admin3_code": null,
      "lat": 42.5833,
      "lng": 1.6667,
      "accuracy": 6
    }
  ]
}
```

## Other countries

The dataset has 1,836,750 postal codes across 124 countries. The largest are India (155,570), Japan (146,883) and Mexico (144,655); Germany has 23,296, the UK 27,450 and the US 41,490. Each country page, such as [postal codes in Norway](https://apifor.dev/postal-codes/norway/), shows its count and sample rows.

Coverage depth differs by country. Some national postal operators publish full lists and some publish only outward codes. The UK rows, for example, follow what GeoNames publishes under its licence, so check the country page before you build an address form on it.

## What people build with it

Auto-filling the town after a user types a postcode, validating that a postcode exists before shipping, and placing customers on a map at postcode level. For street-level addresses you need a geocoder; this dataset stops at the postcode.

## Check that a postcode exists

Call `GET /v1/postal-codes?country=NO&postal_code=0150` and look at `data`. An empty list means the code is not in the dataset, which for Norway usually means a typo. Check the format first in your own code (four digits for Norway) to save a call on obvious mistakes.

Several rows can share one postcode in some countries, for example when a code covers more than one village. Show the user the choices instead of picking the first row.

## Errors, limits and cost

A missing or wrong key returns 401, bad parameters return 400 with an `error.code`, and an unknown id returns 404. Rate limits are per key: a limited request gets 429 with a `Retry-After` header in seconds, so wait that long and retry. Calls that fail before any work starts are refunded. Details are in [errors](https://apifor.dev/docs/errors/) and [rate limits](https://apifor.dev/docs/rate-limits/).

This request costs 1 credit. Pricing is prepaid: 1,000 free requests once after email verification, then packs from $5 for 5,000 requests to $149 for 400,000. Credits never expire and there is no subscription. See [pricing](https://apifor.dev/pricing/).

## From an AI assistant

The same data is available as a tool on the APIFor MCP server at `https://mcp.apifor.dev/mcp`. Add it as a remote server in any client that supports remote MCP, sign in with OAuth or send your API key as a Bearer token, and ask in plain language. MCP calls use the same key and credits as REST. Setup steps are on the [MCP page](https://apifor.dev/docs/mcp/).

## Alternatives

- [GeoNames postal code downloads](https://download.geonames.org/export/zip/): Free per-country text files, including NO.zip, under CC BY 4.0. You host and update them yourself.
- [Zippopotam.us](https://api.zippopotam.us/no/0150): A free JSON lookup by country and postcode. On 1 Dec 2026, /no/0150 returned Oslo with coordinates.

Facts about other services come from their own pages or a test call on 1 Dec 2026. Prices and limits change, so confirm them there.

## Source and licence

GeoNames (https://www.geonames.org), CC BY 4.0. GeoNames says commercial use is allowed and asks for credit with a link.

Every APIFor response carries the same attribution in `meta.attribution`. All sources are listed on [sources and licences](https://apifor.dev/sources/).

## FAQ

### Is there a free postal code API for Norway?

APIFor gives 1,000 free requests once, enough for most prototypes. GeoNames publishes the underlying Norwegian file for free if you would rather host it yourself.

### Does the API return street addresses?

No. Rows are at postcode level: place name, administrative areas and coordinates.

### How do I search by town name?

Pass q with the name and country with the two-letter code, for example country=NO&q=Bergen.

## Related

- [Postal codes dataset](https://apifor.dev/postal-codes/)
- [Endpoint reference](https://apifor.dev/docs/reference/postal-codes/)
- [Postal codes in Norway](https://apifor.dev/postal-codes/norway/)
- [Cities dataset](https://apifor.dev/cities/)
- [Administrative boundaries API](https://apifor.dev/services/boundaries/)
- [All guides](https://apifor.dev/guides/)

[Get a free API key](https://app.apifor.dev/register) [Use it from an AI client (MCP)](https://apifor.dev/docs/mcp/)
