Skip to content

everapihq/zipcodestack-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

zipcodestack-go

Go client for the zipcodestack.com API.

Install

go get github.com/everapihq/zipcodestack-go

Quickstart

package main

import (
    "fmt"
    zc "github.com/everapihq/zipcodestack-go"
)

func main() {
    client := zc.New("YOUR_API_KEY")

    status, _ := client.Status()
    fmt.Println(status)

    // Search
    res, _ := client.Search(map[string]any{
        "postal_code": "10001",
        "country":     "US",
    })
    fmt.Println(res)

    // Distance
    dist, _ := client.Distance(map[string]any{
        "from": "10001",
        "to":   "94105",
        "unit": "mi",
    })
    fmt.Println(dist)
}

Authentication

The client sends your API key using the apikey header by default. If you prefer query parameter authentication, enable it:

client := zc.New("YOUR_API_KEY")
client.SetAuthInQuery(true)

Notes

  • Base URL defaults to https://api.zipcodestack.com/v1.
  • All methods return map[string]any representing the JSON response body.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages