Go client for the zipcodestack.com
API.
- Website zipcodestack.com
- Docs:
https://zipcodestack.com/docs/
go get github.com/everapihq/zipcodestack-go
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)
}
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)
- Base URL defaults to
https://api.zipcodestack.com/v1
. - All methods return
map[string]any
representing the JSON response body.
MIT