AddressZen Go SDK

go.addresszen.com/sdk calls the AddressZen API from Go 1.26 or later, with a typed method for each operation and no dependencies beyond the standard library.

go get go.addresszen.com/sdk
main.gogo
package main

import (
	"context"
	"fmt"
	"log"

	addresszen "go.addresszen.com/sdk"
)

func main() {
	client := addresszen.NewClient("ak_test")
	res, err := client.AddressVerify(context.Background(), addresszen.AddressVerifyBody{
		Query: "1010 Cauthen Ln, Alamogordo, NM 88310",
	}, nil)
	if err != nil {
		log.Fatal(err)
	}
	if m := res.Result.AsUsaVerifyMatch(); m != nil {
		fmt.Printf("%s, %s, %s %s\n", m.AddressLineOne, m.City, m.State, m.ZipCode)
	}
}

The package name is addresszen; import it under that name, as above. Each API operation is one method on the client, named from its operation ID, such as AddressVerify() or FindAddress(). Every method takes a context.Context first and returns a typed response and an error.

Features​

Every operation in the API has a method. The ones most integrations need have a guide:

Place search and saved configs are on the endpoint pages, one per method.

Why the SDK​

  • Standard library only. Requests go through net/http. Pass your own *http.Client for timeouts, proxies or tracing. There is nothing else to install or keep patched.
  • Generated from the OpenAPI spec. Every response is a struct. Every dataset's native record has its own type, from UspsAddress to MoisAddress.
  • Responses never fail on shape. A field the API adds, a value outside a known set or a dataset the SDK has not seen yet decodes without error. See responses.
  • No hidden retries. A billable lookup repeats only when your code repeats it.

Coding agents​

  • Agent skill. npx skills add addresszen/skills installs the azn-go-sdk skill, built from these pages.
  • Endpoints. Every operation, grouped by API area, with its signature, parameters, response type and a tested example.
  • Markdown pages. Add .md to any page URL for plain markdown, such as /docs/sdks/go/errors.md.
  • llms.txt. An index of every page on this site.
  • OpenAPI spec. The API contract the SDK is generated from.

Authenticate​

Pass your API key to NewClient(). Key, licensee and configuration operations also need a Management Key, passed with WithManagementKey(). Keep the Management Key on your server. See setup.

Errors​

An HTTP error returns *addresszen.APIError with the HTTP status and the API error code and message. Match it with errors.AsType. A failed connection returns the net/http error, wrapped. See error handling.