# Norway Postal Code Search (`bite-sized-insights/norwegian-postalcode-to-city-name`) Actor

Get location data including city and municipality from Norwegian postal codes (zip codes).

- **URL**: https://apify.com/bite-sized-insights/norwegian-postalcode-to-city-name.md
- **Developed by:** [bite-sized-insights](https://apify.com/bite-sized-insights) (community)
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 items

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

***Get location data including city and municipality from Norwegian postal codes (zip codes).***

Simply provide a list of postal codes and get back structured location data for each one.

No login required. No cookies needed. Pay-per-event pricing.

### Why Choose This Actor?

**"Enrich your data with Norwegian location information in seconds"**

Our Norway Postal Code / Zip Code Search provides:

- **Very Fast Responses**: Parallel processing for large batches
- **Cost-Effective**: Pay only for the postal codes you need: `$2.00 / 1k postal codes`
- **Complete Data**: Get city, municipality code, municipality name, and category

### Quick Start

1. Open the actor on Apify and go to the **Input** tab.
2. Paste the example input below (or edit the prefilled list).
3. Click **Start** and wait for the run to finish.
4. Open the **Output** (dataset) tab to view or export the results as JSON, CSV or Excel.

```json
{
  "postalcodes": ["0001"]
}
```

Example output item:

```json
{
  "postalcode": "0001",
  "city": "OSLO",
  "municipality_code": "0301",
  "municipality_name": "OSLO",
  "category": "P",
  "error": null
}
```

### Usage Examples

#### Resolve a Single Postal Code

```json
{
  "postalcodes": ["0001"]
}
```

#### Resolve Multiple Postal Codes

```json
{
  "postalcodes": ["0001", "5003", "7010"]
}
```

Returns one record per postal code found, with the same fields as the example output item in Quick Start (here three records, for 0001, 5003 and 7010).

### Input Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `postalcodes` | array | Yes | - | List of Norwegian postal codes (zip codes) to resolve (4 digits each). 1-1000 per run; duplicates are ignored, invalid or too many codes fail the run |

### Output Fields

| Field | Type | Description |
|-------|------|-------------|
| `postalcode` | string | 4-digit Norwegian postal code |
| `city` | string | City/place name |
| `municipality_code` | string | 4-digit municipality code |
| `municipality_name` | string | Municipality name |
| `category` | string | Category code (see below) |
| `error` | null/string | Error message if lookup failed |

#### Category Codes

| Code | Description |
|------|-------------|
| `P` | PO Box (Postboks) |
| `B` | Business address (Bedrift) |
| `G` | Street address (Gate/vei) |
| `S` | Service postal code |

### Free plan

Free-plan users get 5 runs in total. Each free run processes only the first 10 codes in your input (the rest is ignored without an error) and returns at most 10 results.

### Pricing

| Cost | Description |
|------|-------------|
| $0.0001 / start | Charged per actor run |
| $2.00 / 1,000 postal codes | Charged per postal code returned |

### API Integration

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

run = client.actor("bite-sized-insights/norwegian-postalcode-to-city-name").call(
    run_input={
        "postalcodes": ["0001", "5003", "7010", "9990"]
    }
)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(f"{item['postalcode']}: {item['city']}, {item['municipality_name']}")
```

#### JavaScript

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const run = await client.actor('bite-sized-insights/norwegian-postalcode-to-city-name').call({
    postalcodes: ['0001', '5003', '7010']
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach(item => {
    console.log(`${item.postalcode}: ${item.city}, ${item.municipality_name}`);
});
```

### Use Cases

- **Data Enrichment**: Add location data to customer records using postal codes or zip codes
- **Address Validation**: Verify Norwegian postal codes (zip codes) exist
- **Geographic Analysis**: Map postal codes to municipalities
- **Logistics**: Determine delivery regions from zip codes

### Going global?

Looking for postal code data in other countries? Check out our other actors:

- [US ZIP Code Search](https://apify.com/bite-sized-insights/us-zip-codes) - US ZIP codes (5-digit)
- [India PIN Code Search](https://apify.com/bite-sized-insights/indian-pincode-postalcode-zip-code-to-city-state) - Indian PIN codes (6-digit)
- [France Postal Code Search](https://apify.com/bite-sized-insights/france-zip-codes) - French postal codes (5-digit)

### Notes

- Postal codes (zip codes) must be provided as strings (e.g., "0001" not 1)
- Norwegian postal codes are 4 digits (0001-9991)
- Invalid or non-existent postal codes will not appear in results
- Results are returned in no particular order
- Large requests are automatically split into batches and processed in parallel

***

**Need help?** Open an issue on the actor's repository or contact support through Apify Console.

# Actor input Schema

## `postalcodes` (type: `array`):

List of Norwegian postal codes (4 digits each, 1-1000 per run).

## Actor input object example

```json
{
  "postalcodes": [
    "0001",
    "5003",
    "7010",
    "4001",
    "9008",
    "3201"
  ]
}
```

# Actor output Schema

## `results` (type: `string`):

Norwegian postal code location data including city, municipality, and postal code category

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "postalcodes": [
        "0001",
        "5003",
        "7010",
        "4001",
        "9008",
        "3201"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("bite-sized-insights/norwegian-postalcode-to-city-name").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "postalcodes": [
        "0001",
        "5003",
        "7010",
        "4001",
        "9008",
        "3201",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("bite-sized-insights/norwegian-postalcode-to-city-name").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "postalcodes": [
    "0001",
    "5003",
    "7010",
    "4001",
    "9008",
    "3201"
  ]
}' |
apify call bite-sized-insights/norwegian-postalcode-to-city-name --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bite-sized-insights/norwegian-postalcode-to-city-name"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/DyMUnXVzY5htsbPyH/builds/UNFfnb2nm60fVytTr/openapi.json
