zipcodestack-rs
Idiomatic Rust client for the zipcodestack.com API. Website: zipcodestack
Features
- Status endpoint: check API health and quota
- Zip/postal code search
- Distance between two zip codes (miles or kilometers)
- Flexible authentication via header or query parameter
Installation
Add to your Cargo.toml:
[]
= { = "." }
= { = "1", = ["full"] }
Usage
use ;
async
Authentication
According to the official docs, you can authenticate via HTTP headers or GET parameters. This client supports both:
- Header:
apikey: <API_KEY>(default) - Query param:
?apikey=<API_KEY>
You can switch using the builder:
let client = builder
.with_auth_method
.build;
Endpoints
- Status:
GET /status - Search:
GET /search?zip_code=90210&country=US - Distance:
GET /distance?from=90210&to=10001&unit=miles
Links
License
MIT