<!-- Markdown copy of https://gridpin.dev/address-validation for agents. The page there is the canonical one. -->
Title: Address validation without an API: check that an address exists, offline
Source: https://gridpin.dev/address-validation

# Address validation on your own machine

Address validation asks one question: does this address exist as written? GridPin answers it from the open address data of the country, without sending the address anywhere. It does not tell you whether mail is delivered there.

[Clean and compare](https://gridpin.dev/guides-task-clean-audit) [Command line](https://gridpin.dev/guides-where-command-line) [Server, Docker](https://gridpin.dev/guides-where-server) [Python](https://gridpin.dev/guides-where-python) [Retail, e-commerce](https://gridpin.dev/guides-who-retail-ecommerce) [Utilities](https://gridpin.dev/guides-who-utilities)

## One address

```
$ gridpin exists spain.bin "Calle Gran Via 9999, Madrid"
{"exists":"no","reason":"number_not_on_street"}
```

The street is real and the number is not on it. The reason is part of the answer, so a form can say what to fix.

## A whole list

```
$ gridpin batch spain.bin form.csv form_out.csv --with exists
$ cut -d, -f1,2,13,14 form_out.csv   # id, address, gp_exists, gp_exists_reason (see /docs#exists)
```

Two columns are added to every row: `gp_exists` and `gp_exists_reason`. Sort by the reason to see what is wrong with the list: missing towns, numbers that are not on the street, streets the data does not know. The columns and a worked list: [does the address exist](https://gridpin.dev/docs#exists); cleaning the list afterwards: [a customer address list in an afternoon](https://gridpin.dev/clean-customer-addresses).

## One command from Python

```
$ pip install offline-address-check
$ offline-address-check "8 rue de Rivoli, Paris" --country fr
yes	house_found	8 Rue de Rivoli, 75004 Paris 4e Arrondissement
```

The exit code is 0 for `yes` and 1 otherwise, so a script can branch on it. A line without a town or a postcode is never `yes`: the same street name may exist in another town.

## Behind a web form

The local server answers the same question at `/v1/exists`, so a checkout or a sign-up form can check an address before it is saved, without a third party seeing it. Ready-made for [WooCommerce](https://gridpin.dev/woocommerce-address-autocomplete); suggestions while typing: [address autocomplete](https://gridpin.dev/address-autocomplete-self-hosted).

## Validation, verification, deliverability

| The word | The question | Answered here? |
|---|---|---|
| Address validation | Does the address exist as written? | Yes: street, house number and postcode against the country's address data |
| Address standardization | How is it spelled officially? | Yes: the answer carries the spelling the data holds |
| Address verification, deliverability (USPS DPV, CASS) | Is mail delivered there? Is the flat real? Is it vacant? | No: that lives in postal data, not in open address data |
| Proof of address | Does this person live there? | No: GridPin holds no names |

Services that sell address verification usually mean the third row. If you need a delivery guarantee, you need postal data. If you need to know that the address is real before it enters your database, this is enough: [what GridPin checks, and what it does not](https://gridpin.dev/what-we-check-and-what-we-dont).

## Limits

- Houses, not flats or floors.
- A house built after the data was published is not there; each file names its build date.
- Only [the countries of the release](https://gridpin.dev/countries).

## More

- [Utility billing: clean the service addresses](https://gridpin.dev/utility-billing-addresses)
- [Store listings: one address everywhere](https://gridpin.dev/store-listings-addresses)
- [Find duplicate addresses in a customer list](https://gridpin.dev/find-duplicate-addresses)
- [Audit an address database before migration](https://gridpin.dev/audit-address-database)
- [What changed between two address files](https://gridpin.dev/what-changed-in-addresses)
- [Clean a customer address list in an afternoon](https://gridpin.dev/clean-customer-addresses)
- [All guides and countries](https://gridpin.dev/guides)
- [Documentation](https://gridpin.dev/docs)
