Skip to content

AddressVerify-io/addressverify-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AddressVerify Go SDK

Official Go client for the AddressVerify API — validate U.S. residential addresses, classify home types, and get estimated property values in real time.

Go Reference CI license

  • 🏠 Address validation — confirm an address is a real, deliverable U.S. residence
  • 🏷️ Home-type classificationSINGLE_FAMILY, MULTI_FAMILY, APARTMENT, CONDO, TOWNHOUSE, MANUFACTURED, LOT
  • 💰 Property values — estimated home value, plus optional expanded property data
  • 🪶 Zero dependencies — standard library only

Installation

go get github.com/AddressVerify-io/addressverify-go

Get an API key

Create a free account at app.addressverify.io and copy your API key from the dashboard. The free tier includes 100 calls/month.

Quick start

package main

import (
	"context"
	"fmt"
	"log"
	"os"

	addressverify "github.com/AddressVerify-io/addressverify-go"
)

func main() {
	client := addressverify.NewClient(os.Getenv("ADDRESSVERIFY_API_KEY"))

	// Single-line address
	res, err := client.Verify(context.Background(), "123 Main St, New York, NY 10001")
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(res.AddressValid) // true
	fmt.Println(res.HomeType)     // SINGLE_FAMILY
	fmt.Println(res.HomeValue)    // 273900
}

Multi-line address

res, err := client.VerifyParts(ctx, addressverify.Address{
	Street: "20 Marie St",
	City:   "Iberia",
	State:  "MO",
	Zip:    "65486",
})

Expanded property data

Pass addressverify.WithExpanded() to receive parsed address components, property details, tax assessment, and listing data (available on all plans at no extra cost):

res, err := client.Verify(ctx, "20 Marie St, Iberia, MO 65486", addressverify.WithExpanded())
if err != nil {
	log.Fatal(err)
}

if res.PropertyInfo != nil {
	fmt.Println(res.PropertyInfo.Bedrooms) // 4
}

Error handling

Non-2xx responses return an *APIError with the HTTP status and parsed body:

res, err := client.Verify(ctx, "not a real address")
if err != nil {
	var apiErr *addressverify.APIError
	if errors.As(err, &apiErr) {
		fmt.Println(apiErr.StatusCode) // e.g. 422
		fmt.Println(apiErr.Message)    // API error message
	}
}
Status Meaning
400 Bad Request — invalid or missing parameters
401 Unauthorized — invalid API key
422 Invalid address (e.g. missing street number)
429 Too Many Requests — rate limit exceeded

Configuration

client := addressverify.NewClient(
	"YOUR_API_KEY",
	addressverify.WithBaseURL("https://api.addressverify.io"), // optional
	addressverify.WithHTTPClient(&http.Client{Timeout: 5 * time.Second}), // optional
)

Every request takes a context.Context, so cancellation and timeouts work as usual.

Roadmap

  • Home Verify (homeowner + person & property lookup, …/isHomeOwner/homeOwner) — coming to the SDK. Already available on the REST API.

Links

License

MIT © AddressVerify

About

Official Go SDK for the AddressVerify API — validate residential addresses, classify home types, and get property values.

Topics

Resources

License

Stars

26 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages