# German Postal Code Filter for Company CSVs (`kiquise/german-postcode-service-area-checker`) Actor

Check existing company CSVs against your German service-area postal codes.

- **URL**: https://apify.com/kiquise/german-postcode-service-area-checker.md
- **Developed by:** [Stefan Groll](https://apify.com/kiquise) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 csv row checkeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## German Postal Code Filter for Company CSVs

Check an existing CSV against the German postal codes your business serves. Each output row has the original data record number (excluding the header), the postcode and a status. The check tests format and membership in your list. It does not verify address validity or look up missing postal codes.

Download `MATCHED.csv` from the run's default key-value store under **Storage**. It contains the original columns in their input order and only rows with an allowed postcode. The CSV uses the separator selected in the input. If nothing matches, it contains only the header. Import the postal code column as text in your CRM or spreadsheet.

### First private run in Apify

1. Extract this archive and open a terminal in the extracted folder. With Node.js 22+ and npm, run `npx --package=apify-cli apify login`, then `npx --package=apify-cli apify push`. Use your Apify account to authorize the CLI. This deploys the source to an Actor named `german-postcode-service-area-checker`.
2. Wait for the build to succeed. In the private Actor’s Input tab, use the prefilled example and select Start. Expect five output rows with statuses in_area, in_area, outside_area, missing_postcode and invalid_postcode_format.
3. Replace the allowed codes with 01067, 20095 and run again. Records 2 and 3 should switch status.

### Pay per event

In the Actor's monetization settings configure the custom event name `service-area-report` and disable the automatic start event if it is present. One event covers one valid report of up to 1000 rows. The code computes the report before charging and checks that the budget covers the event before writing the output. Run a private billing test before publishing. A hypothetical starting price is USD 0.50 per report.

Treat postal codes as text throughout. A leading zero removed by spreadsheet software cannot be recovered reliably.

# Actor input Schema

## `csv` (type: `string`):

Paste comma- or semicolon-separated CSV with a header and at most 1000 data rows.

## `allowedPostalCodes` (type: `string`):

Enter five-digit German postal codes separated by commas, spaces or newlines. Keep leading zeros.

## `postalCodeColumn` (type: `string`):

Exact header of the postcode column, for example postalCode or PLZ.

## `separator` (type: `string`):

Select the delimiter used by the export.

## Actor input object example

```json
{
  "csv": "company,postalCode\nFirma A,01067\nFirma B,10115\nFirma C,20095\nFirma D,\nFirma E,12A45",
  "allowedPostalCodes": "01067, 10115",
  "postalCodeColumn": "postalCode",
  "separator": ","
}
```

# Actor output Schema

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

No description

## `matchedCsv` (type: `string`):

No description

# 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 = {
    "csv": `company,postalCode
Firma A,01067
Firma B,10115
Firma C,20095
Firma D,
Firma E,12A45`,
    "allowedPostalCodes": "01067, 10115"
};

// Run the Actor and wait for it to finish
const run = await client.actor("kiquise/german-postcode-service-area-checker").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 = {
    "csv": """company,postalCode
Firma A,01067
Firma B,10115
Firma C,20095
Firma D,
Firma E,12A45""",
    "allowedPostalCodes": "01067, 10115",
}

# Run the Actor and wait for it to finish
run = client.actor("kiquise/german-postcode-service-area-checker").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 '{
  "csv": "company,postalCode\\nFirma A,01067\\nFirma B,10115\\nFirma C,20095\\nFirma D,\\nFirma E,12A45",
  "allowedPostalCodes": "01067, 10115"
}' |
apify call kiquise/german-postcode-service-area-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kiquise/german-postcode-service-area-checker"
        }
    }
}
```

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/p4TuhOh6thxqy1VK1/builds/0WKP8eJbytZSkCi9W/openapi.json
