addy

NZ
AU

addy

NZ
AU

Services

Pricing

Documentation

Contact

FAQ

Login

Integrations

Address & Postcode Widgets
Address Validation with HTML
JavaScript Code Generator
Address Validation with JavaScript
jQuery Autocomplete

Simple Address Validation with HTML

Integration guide to add Addy Solutions' address validation plugin to your website

Run any Addy API live with Addy Swagger UI on us for free with 'demo-api-key' API key

Address Validation Integration


Integration can be completed within minutes by simply updating the HTML on your website.

No programming skills such as jQuery or JavaScript is required.

Add Addy Solutions' postal address checker to your ecommerce website in 4 easy steps:

Step 1 - Create a free account

Sign up for a free account to get your own Addy API Key that will be used for address lookup requests.

Step 2 - Add the address finder plugin reference

Add a reference to the autocomplete validation widget at the bottom of your address form page (above the </body> tag).

1<script src="https://www.addysolutions.com/address-lookup/1.6.2/js/addy.min.js?nzKey=demo-api-key&country=nz&loadcss=true" async defer></script>
Remember to replace demo-api-key with your own API key.

Step 3 - Tag address fields with a class name

Tag each address field with a unique CSS class name that will tell Addy which fields to use for address searching and which fields to populate once an address selection is made.

For example, to turn a text input field into a predictive address search, simply add the addy-line1 class name to your HTML:

1<input type="text" class="addy-line1" id="address1" />

View all of the HTML Markup and CSS tags.

Step 4 - Release to production

Save and deploy your changes.

NZ Address Validation Demo


Try this live address validation demo in JSFiddle using HTML only:

Enable Reverse geocoding to "find addresses near me"


Makes it fast and easy for users to fill in your address form accurately without typing a single character on a keyboard. Simply enable the location feature in Addy, which will use the built in GPS in a user's mobile device to suggest a list of nearby addresses.

As described in the integration section above (Step 2), change the script by adding the "&enableLocation=true" parameter to the script reference:

1<script src="https://www.addysolutions.com/address-lookup/1.6.2/js/addy.min.js?nzKey=demo-api-key&country=nz&loadcss=true&enableLocation=true" async defer></script>
Remember to replace demo-api-key with your own API key.

Configuration Options


Additional configuration options are provided to customise how the address validation widget should behave on your website.

URL Parameters

The example below shows the options that are available as URL parameters:

1<script src="https://www.addysolutions.com/address-lookup/1.6.2/js/addy.min.js?nzKey=demo-api-key&country=nz&callback=initAddy&excludeSpelling=false&excludeWord=false&excludeIp=false&maxItems=10&loadcss=true&enableLocation=true&excludePostBox=false&excludeRural=false&excludeUndeliver=false&excludePostcode=0622-1010&includePostcode=0622-1010&excludeRegion=1-2&includeRegion=3-4&excludeTerritory=1-2-3&includeTerritory=5-6-7&tag=sales&uniqueid=12345" async defer></script>
Remember to replace demo-api-key with your own API key.
URL ParameterDefaultDescription
nzkeyN/AAddy API Key
callbackN/AAn optional callback method name that should be executed when the addycomplete script has loaded
countrynzAddy database to search. Can be either "nz" or "au"
excludePostBoxfalseExclude PO Boxes and Private Bag addresses
excludeRuralfalseExclude rural addresses
excludeUndeliverfalseExclude non-mail delivery addresses
excludeSpellingfalseDisable spelling correction from address matching
excludeWordfalseDisable extra word removal from address matching
excludeIpDisable address sorting based on IP address proximity
excludePostcode

Exclude addresses within certain postcodes, defined in a dash separated list of postcodes

E.g. "1010-0622-7542". See the complete list of postcodes

includePostcode

Only include addresses within certain postcodes, defined in a dash separated list of postcodes

E.g. "1010-0622-7542". See the complete list of postcodes

excludeRegion

Exclude addresses within certain regions, defined in a dash separated list of region codes

E.g. "1-2-6" for Northland, Auckland and Taranaki. See the complete list of region codes

includeRegion

Only include addresses within certain regions, defined in a dash separated list of region codes

E.g. "1-2-6" for Northland, Auckland and Taranaki. See the complete list of region codes

excludeTerritory

Exclude addresses within certain territories, defined in a dash separated list of territory codes

E.g. "22-14" for Kapiti Coast District and Hamilton City. See the complete list of territory codes

includeTerritory

Only include addresses within certain territories, defined in a dash separated list of territory codes

E.g. "22-14" for Kapiti Coast District and Hamilton City. See the complete list of territory codes

tag

Add a logging tag to every request

E.g. A department name such as "Sales"

uniqueid

Add a unique Identifier to every request

E.g. An internal customer ID such as "12345"

maxItems10An optional parameter to specify the maximum number of address items to return
loadcssfalseLoad the default addycomplete.min.css stylesheet
enableLocationfalse

Enable reverse geocoding to return "Addresses near me"

HTML Markup and CSS


The following class names can be used for instructing the address autocomplete widget to add search and autofill functionality to your address fields.

FieldClass NameDescriptionField Type
line1addy-line1Mandatory field used for address searching and populating address line 1text/search
line2addy-line2Field to populate with address line 2text
suburbaddy-suburbField to populate with the suburb nametext
cityaddy-cityField to populate with the city or mail town nametext
postcodeaddy-postcodeField to populate with the 4 digit postal codetext
territoryaddy-territoryField to populate with the district name. See districts of New Zealandtext/select
regionaddy-regionField to populate with the region name. See regions of New Zealandtext/select
idaddy-idField to populate with the unique Addy identifiertext/hidden
dpidaddy-dpidField to populate with the DPID (Unique NZ Post Deposit Identifier)text/hidden
xaddy-xField to populate with the longitude coordinate in WGS84 formattext/hidden
yaddy-yField to populate with the latitude coordinate in WGS84 formattext/hidden

Secondary address fields

Up to 4 address form fields are supported on the same page, such as shipping and billing addresses.

To add additional address fields requires the "addy-2-line1", "addy-3-line1" or "addy-4-line1" pattern as shown below.

FieldAddress Form 2Address Form 3Address Form 4
line1addy-2-line1addy-3-line1addy-4-line1
line2addy-2-line2addy-3-line2addy-4-line2
suburbaddy-2-suburbaddy-3-suburbaddy-4-suburb
cityaddy-2-cityaddy-3-cityaddy-4-city
postcodeaddy-2-postcodeaddy-3-postcodeaddy-4-postcode
territoryaddy-2-territoryaddy-3-territoryaddy-4-territory
regionaddy-2-regionaddy-3-regionaddy-4-region
idaddy-2-idaddy-3-idaddy-4-id
dpidaddy-2-dpidaddy-3-dpidaddy-4-dpid
xaddy-2-xaddy-3-xaddy-4-x
yaddy-2-yaddy-3-yaddy-4-y

Sign up

Full support

Sign up

Full support

Address Services

Address AutocompleteAddress CleansingAddress GeocodingPostcode FinderPricingSign inSign up
© 2024 Addy LimitedTerms & Conditions
Made in Auckland, New Zealand
Looking for Addy Australia?