GET/v1/postal/us/{zip}
City, state, county and coordinates for a US ZIP code
ZIP+4 is accepted; the +4 is ignored.
PARAMETERS
- zippath · stringREQUIRED
- ZIP codee.g. 10001
REQUEST
curl "https://api.apialmanac.com/v1/postal/us/10001" \ -H "X-API-Key: YOUR_KEY"
import requests
r = requests.get("https://api.apialmanac.com/v1/postal/us/10001", headers={"X-API-Key": "YOUR_KEY"})
print(r.status_code, r.headers.get("X-Gw-Remaining"))
print(r.json())
const r = await fetch("https://api.apialmanac.com/v1/postal/us/10001", {
headers: { "X-API-Key": "YOUR_KEY" }
});
console.log(r.status, r.headers.get("X-Gw-Remaining"));
console.log(await r.json());
RESPONSE
200OK
{
"postal_code": "10001",
"country": "US",
"city": "New York",
"state": "New York",
"state_code": "NY",
"county": "New York",
"lat": 40.7484,
"lon": -73.9967,
"attribution": "Postal code data © GeoNames (geonames.org), CC BY 4.0"
}