Timezones lookup by zip
Exacttimezones_lookup_by_zipDeterministic and authoritative — the canonical answer for this input.
Map a US 5-digit ZIP code (or ZIP+4 with or without dash) to its IANA timezone. Returns iana, current UTC offset (DST-aware), and is_dst_now. Centroid-based: each ZIP resolves to the tz polygon containing its Geonames centroid. Accepts short forms with lost leading zeros ('1001' → '01001') for ZIPs that round-trip through integer columns. Returns is_valid=False with why_invalid for unknown or malformed input. US-only. Processing multiple inputs? Use `timezones_lookup_by_zip_batch` to do up to 1000 in one call.
Parameters
zipstringrequired5-digit US ZIP or ZIP+4 (e.g. '12345' or '12345-6789').
Call it
curl -X POST https://api.snipget.ai/v1/timezones/lookup-by-zip \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"zip":"10001"}'The Batch tab sends up to 1000 inputs in one call via /v1/timezones/lookup-by-zip/batch.
FAQ
Why use this instead of guessing from the ZIP?
It maps a US ZIP code to its IANA timezone using a maintained table built from Geonames centroids, then adds the current UTC offset and daylight-saving flag. That is far more reliable than having a model guess the zone from a number.
What ZIP formats does it accept?
A 5-digit ZIP (10001), a ZIP+4 with or without the dash (90001-1234 or 900011234), and short forms that lost a leading zero when stored as a number (1001 is read as 01001). It uses the first five digits to find the zone.
What does it NOT do?
US ZIPs only, no other countries. It returns the timezone, not a full address, city, or state. The lookup is centroid-based, so a ZIP that straddles a timezone boundary resolves to whichever side its center point falls on, and the answer is always a single zone.
Is the result reliable?
The ZIP-to-zone mapping is exact, meaning deterministic and authoritative from the maintained table, so the same ZIP always returns the same zone. The offset and is_dst_now reflect the moment of the call, since daylight saving moves the live offset.
What happens with an unknown or malformed ZIP?
An unknown ZIP (like 99999) or a malformed one returns is_valid false with a why_invalid note and confidence 0. It does not throw an error, so you can surface the reason to the user.