# Australian Address Validator, Parser & Geocoder (G-NAF, NZ) (`geeky_goth_gamer/au-nz-address-parser-geocoder`) Actor

Validate, standardise and geocode Australian addresses with official G-NAF data, and parse New Zealand addresses. Input: messy address text. Output: clean address, parts, postcode, state, latitude/longitude and match level. From $0.001 per address.

- **URL**: https://apify.com/geeky_goth_gamer/au-nz-address-parser-geocoder.md
- **Developed by:** [Chris Day](https://apify.com/geeky_goth_gamer) (community)
- **Categories:** Developer tools, Business, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 address parseds

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

## Australian & NZ Address Parser, Cleaner & Geocoder (G-NAF)

Turn messy Australian and New Zealand addresses into clean, standard parts. Australian addresses are also checked against **G-NAF**, the official national address file, which lets the Actor fix typos, fill in missing postcodes and suburbs, and add latitude and longitude.

```
"33 brisbne st launcestn"   →   33 Brisbane Street, Launceston TAS 7250   (-41.434799, 147.142549)
```

### When an AI agent should use this

Use `geeky_goth_gamer/au-nz-address-parser-geocoder` when:

- You have Australian (or New Zealand) addresses that are messy, abbreviated or missing a postcode or state, and need them standardised.
- You need to check that an Australian address really exists, or get its latitude/longitude (G-NAF).
- You need address parts (unit, number, street, suburb, state, postcode) for a CRM, delivery or form.

Don't use it for:

- Addresses outside Australia and New Zealand.
- Geocoding NZ addresses (they are parsed and formatted only).

**Example input:**

```json
{
  "addresses": [
    "Unit 3, 12 Brisbane St, Launceston TAS 7250",
    "100 collins st melbourne"
  ],
  "geocode": true
}
```

**Output:** One dataset item per address: `formatted`, `components`, `valid`, `issues`, and `geocode` (`latitude`, `longitude`, `matchLevel`, `confidence`, `gnafPid`).

**Cost:** $0.001 per address parsed plus $0.003 when it is geocoded to a G-NAF address or street ($0.004 combined). Junk rows are free.

**Call it from an agent:**

- Apify MCP server: add `https://mcp.apify.com/?tools=geeky_goth_gamer/au-nz-address-parser-geocoder` to your MCP client; the tool is `geeky_goth_gamer--au-nz-address-parser-geocoder`. Or use `call-actor` with `"actor": "geeky_goth_gamer/au-nz-address-parser-geocoder"`.
- Python: `ApifyClient(token).actor("geeky_goth_gamer/au-nz-address-parser-geocoder").call(run_input=...)`, then read `client.dataset(run["defaultDatasetId"]).list_items().items`.
- HTTP: `POST https://api.apify.com/v2/acts/geeky_goth_gamer~au-nz-address-parser-geocoder/run-sync-get-dataset-items?token=YOUR_TOKEN` with the input JSON as the body.

### What it does

- **Parses** unit, level, lot, street number ranges and suffixes (`12-14A`), street name, type and suffix, suburb, state and postcode. It also handles PO Boxes, Locked Bags, GPO Boxes and NZ rural delivery (`RD 2`).
- **Normalises** to Australia Post-style lines (`UNIT 3` / `12 BRISBANE ST` / `LAUNCESTON  TAS 7250`) plus a readable one-line version.
- **Flags problems** in an `issues` list: missing number, postcode or state, a postcode that belongs to another state, a country mix-up, or extra parts.
- **Geocodes and corrects Australian addresses** against the bundled G-NAF index (11.3 million address points). Each result has a match level:
  - `address`: the exact address point.
  - `address-interpolated`: between two neighbouring numbers on the same side of the street.
  - `street`: the street's centre.
  - `locality`: the suburb's centre.
  - `postcode`: the centre of the postcode's addresses.
  - `none`: nothing matched.
- Every correction is listed, for example `Postcode corrected from 2001 to 2000.`
- **New Zealand** addresses are parsed and formatted only; they are **not geocoded** (see Limits).

There are no external API calls and no API keys. Lookups run entirely inside the Actor at about 5–7 ms per address.

### Input

| Field | Meaning |
|---|---|
| `addresses` | Up to 10,000 per run. Each item is a text address or `{"id": "your-ref", "address": "..."}`. |
| `addressesText` | Optional. Addresses pasted one per line. |
| `country` | `auto` (default), `AU` or `NZ`. |
| `geocode` | `true` (default) looks Australian addresses up in G-NAF. |

### Output (one dataset row per input, in input order)

```json
{
  "id": "a1",
  "input": "33 Brisbne St Launcestn",
  "status": "ok",
  "country": "AU",
  "valid": true,
  "issues": ["The state is missing.", "The postcode is missing."],
  "formatted": "33 Brisbane Street, Launceston TAS 7250",
  "formattedLines": ["33 BRISBANE ST", "LAUNCESTON  TAS 7250"],
  "formattedAsEntered": "33 Brisbne Street, Launcestn",
  "components": {"numberFirst": 33, "streetName": "BRISBANE", "streetType": "STREET", "locality": "LAUNCESTON", "state": "TAS", "postcode": "7250", "...": "..."},
  "geocode": {
    "matchLevel": "address", "latitude": -41.434799, "longitude": 147.142549, "confidence": 0.98,
    "gnafPid": "GATAS...",
    "corrections": ["Locality corrected from LAUNCESTN to LAUNCESTON.", "Postcode filled in: 7250.", "Street name corrected from BRISBNE to BRISBANE."]
  },
  "billedEvents": ["address-parsed", "address-geocoded"]
}
```

- `issues` describes the address **as entered**.
- `valid` is true when nothing was missing, or when the full address was found in G-NAF.
- Rows that cannot be parsed have `status: "error"` and a plain-English `error`, and are not charged.

### Pricing (pay per event)

- **Address parsed:** charged for each address where at least two real parts were found. Junk such as `asdf qwer` and rejected rows are free.
- **Address geocoded:** charged only when the result is at `address`, `address-interpolated` or `street` level. Suburb-only and postcode-only fallbacks are free.
- Your *maximum cost per run* is respected exactly: the run stops before an address it could not pay for.

### Accuracy

These figures come from a held-out test of 3,000 random real G-NAF addresses. Each was rewritten the way people type them: abbreviated, lower case, without a postcode, with a unit prefix, or with a typo. 99.9% geocoded to within 50 m of the official point. Hand-typed addresses are messier than this test, so expect somewhat lower rates on real customer data. Every result carries a `matchLevel` and `confidence` so you can filter.

### Limits and honest caveats

- **New Zealand: parse and format only.** The official LINZ address data needs an account and its own licence, so this version does not include it.
- **Mixed AU/NZ lists:** places that exist in both countries (Hamilton, Richmond, Wellington…) are treated as Australian unless the NZ postcode or the word "New Zealand" is present, or you set `country` to `NZ`.
- G-NAF has no PO Box locations, so PO Boxes are geocoded to the suburb only.
- The data is the G-NAF release shown in the run's `ATTRIBUTION` record (currently November 2026). It is refreshed quarterly when the Actor is rebuilt.

### Data licence and attribution (please read)

Incorporates or developed using G-NAF © Geoscape Australia licensed by the Commonwealth of Australia under the [Open Geo-coded National Address File (G-NAF) End User Licence Agreement](https://data.gov.au/dataset/geocoded-national-address-file-g-naf).

**Mail restriction (from the G-NAF licence):** G-NAF must not be used to generate an address, or a compilation of addresses, for sending mail unless you have verified that each address can receive mail by checking it against a secondary source. This Actor cleans and locates addresses **you already hold**. It does not generate address lists, and you are responsible for meeting this condition if you mail to the results.

The attribution and restriction are also written to the run's key-value store as `ATTRIBUTION`.

### Rebuilding the index (maintainers)

1. Download the latest G-NAF GDA2020 release from data.gov.au.
2. Extract the PSV files.
3. Run:

```
pip install duckdb
python tools/build_gnaf_index.py <psv-dir> data/gnaf_index.sqlite "G-NAF <MONTH YEAR> (GDA2020)"
python tools/eval_geocoder.py 3000 99
```

The build takes about 1 minute and 3 GB of RAM, and produces a ~550 MB file.

# Actor input Schema

## `addresses` (type: `array`):

The addresses to process (provide this or addressesText). Up to 10,000 per run. Each item is a free-text address string, e.g. "Unit 3/12 Brisbane St Launceston 7250", or an object {"id": "your-ref", "address": "..."} so results can be joined back to your records.

## `addressesText` (type: `string`):

Optional. Paste addresses here, one per line. They are added after the "Addresses" list.

## `country` (type: `string`):

"auto" detects Australia or New Zealand for each address. Choose AU or NZ if all your addresses are from one country; addresses that look like the other country are flagged in "issues".

## `geocode` (type: `boolean`):

Look each Australian address up in G-NAF to correct it and add latitude/longitude. New Zealand addresses are parsed and formatted only.

## Actor input object example

```json
{
  "addresses": [
    "Unit 3, 12 Brisbane St, Launceston TAS 7250",
    "100 collins st melbourne",
    "Lvl 2/45 Pirie Street Adelaide SA",
    "PO Box 123, Hobart TAS 7001",
    "15 Queen Street, Auckland Central, Auckland 1010"
  ],
  "country": "auto",
  "geocode": true
}
```

# Actor output Schema

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

No description

## `attribution` (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 = {
    "addresses": [
        "Unit 3, 12 Brisbane St, Launceston TAS 7250",
        "100 collins st melbourne",
        "Lvl 2/45 Pirie Street Adelaide SA",
        "PO Box 123, Hobart TAS 7001",
        "15 Queen Street, Auckland Central, Auckland 1010"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("geeky_goth_gamer/au-nz-address-parser-geocoder").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 = { "addresses": [
        "Unit 3, 12 Brisbane St, Launceston TAS 7250",
        "100 collins st melbourne",
        "Lvl 2/45 Pirie Street Adelaide SA",
        "PO Box 123, Hobart TAS 7001",
        "15 Queen Street, Auckland Central, Auckland 1010",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("geeky_goth_gamer/au-nz-address-parser-geocoder").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 '{
  "addresses": [
    "Unit 3, 12 Brisbane St, Launceston TAS 7250",
    "100 collins st melbourne",
    "Lvl 2/45 Pirie Street Adelaide SA",
    "PO Box 123, Hobart TAS 7001",
    "15 Queen Street, Auckland Central, Auckland 1010"
  ]
}' |
apify call geeky_goth_gamer/au-nz-address-parser-geocoder --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,geeky_goth_gamer/au-nz-address-parser-geocoder"
        }
    }
}
```

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/O550eT15TT4Tspevp/builds/G8LwgDhCTRZdByFK9/openapi.json
