Zippopotam.us API: Search postal codes
Finds postal codes, place names and coordinates for a town and state or region in a country covered by Zippopotam.us.
Unofficial. Not affiliated with or endorsed by Zippopotam.us.
Inputs
Values from the run on Oct 23, 2026, shown under Output.
- Town, required
town Town to search, for example Beverly Hills.
Beverly Hills
- State, required
state State or region name or abbreviation, for example California or CA.
California
- Country optional
country Country name or two-letter country code, for example United States or US. Defaults to United States.
United States (default)
Input as JSON
{ "town": "Beverly Hills", "state": "California"}Output
{ "postal_codes": [ { "town": "Beverly Hills", "state": "California", "country": "United States", "latitude": 33.7866, "longitude": -118.2987, "page_link": "https://zippopotam.us/us/90209" , "place_name": "Beverly Hills", "postal_code": "90209" }, { "town": "Beverly Hills", "state": "California", "country": "United States", "latitude": 34.0901, "longitude": -118.4065, "page_link": "https://zippopotam.us/us/90210" , "place_name": "Beverly Hills", "postal_code": "90210" }, { "town": "Beverly Hills", "state": "California", "country": "United States", "latitude": 34.0652, "longitude": -118.383, "page_link": "https://zippopotam.us/us/90211" , "place_name": "Beverly Hills", "postal_code": "90211" } ]}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"zippopotam.us/search_postal_codes","input":{"town":"Beverly Hills","state":"California"}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "zippopotam.us/search_postal_codes" , "input": { "town": "Beverly Hills", "state": "California" }})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "zippopotam.us/search_postal_codes" , "input": { "town": "Beverly Hills", "state": "California" } }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run zippopotam.us/search_postal_codes# with {"town":"Beverly Hills","state":"California"}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "type": "object", "required": [ "town", "state" ], "properties": { "town": { "type": "string", "description": "Town to search, for example Beverly Hills." }, "state": { "type": "string", "description": "State or region name or abbreviation, for example California or CA." }, "country": { "type": "string", "default": "United States", "description": "Country name or two-letter country code, for example United States or US. Defaults to United States." } }}Output schema
{ "type": "object", "required": [ "postal_codes" ], "properties": { "postal_codes": { "type": "array", "items": { "type": "object", "required": [ "country", "state", "town", "postal_code", "place_name", "latitude", "longitude", "page_link" ], "properties": { "town": { "type": "string", "description": "Town searched." }, "state": { "type": "string", "description": "State or region name." }, "country": { "type": "string", "description": "Country name." }, "latitude": { "type": [ "number", "null" ], "description": "Latitude, if available." }, "longitude": { "type": [ "number", "null" ], "description": "Longitude, if available." }, "page_link": { "type": "string", "description": "Link to the postal code details." }, "place_name": { "type": "string", "description": "Place name associated with the postal code." }, "postal_code": { "type": "string", "description": "Postal code." } }, "additionalProperties": false }, "description": "Postal codes in ascending order; empty if none match." } }, "additionalProperties": false}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
zippopotam.us/search_postal_codes- Returns
- postal codes, place names, coordinates, detail links
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method zippopotam.us/search_postal_codes with the inputs above.
Ask your agent
- What postal codes are used in Austin, Texas?
- Find the zip codes and coordinates for Boulder in CO.
- I need the postal codes for Kingston in Ontario, Canada.
- Look up place names and lat/long for Springfield, Illinois, US.
- Which zip codes cover Santa Fe, New Mexico?
See more
All Zippopotam.us methodsLooks up the places, regions and coordinates for a postal code in a supported country on Zippopotam.us.
zippopotam.us/get_postal_codeMatches a US street address and returns its city or place, county, state, ZIP code, census tract, congressional and state legislative districts, coordinates and FIPS codes. Districts follow the Census Geocoder's current geography vintage and may differ from sitting representation.
census.gov/get_address_detailsFinds Indian post offices matching a place name, with PIN codes, branch types, delivery statuses, districts and states. Optionally narrows by state or district.
postalpincode.in/search_pin_codesLooks up a UK postcode on Postcodes.io, including its location, administrative areas and whether it is still in use. Retired postcodes return location and retirement year only.
postcodes.io/get_postcodeFinds the current House representative and both senators for a US ZIP code or street address, with office contacts and photos. A ZIP covering several districts returns every possible representative until an address identifies one.
house.gov/get_my_representativesFinds named places or kinds of places in a city or area, in search order, using OpenStreetMap Nominatim. Results may be fewer than requested. Data © OpenStreetMap contributors (ODbL).
openstreetmap.org/search_placesFinds map coordinates and address details for an address or place on OpenStreetMap, optionally restricted to a country.
openstreetmap.org/get_coordinatesFinds the AutoZone stores nearest a US ZIP code, city or street address, with contact details, opening hours, whether each is open now, distance and store page links.
autozone.com/search_stores