v1 REST JSON 42,000+ Records
Get API Key →

ZIP Code API

Complete US ZIP code database with city, state, county, and precise coordinates. Lookup, radius search, full-text search, and state/city exploration — all from a single REST API.

Base URL https://apibarn.com/v1/zipcode
Auth x-api-key
Records 42,000+ US ZIP codes
Coverage All 50 states
Quick start
curl https://apibarn.com/v1/zipcode/api/zip/90210 \
  -H "x-api-key: YOUR_API_KEY"

What's Included

ZIP Code Lookup

Instant lookup for any US ZIP code. Returns city, state, county, FIPS code, and precise latitude/longitude coordinates.

Radius Search

Find all ZIP codes within a given radius (in miles) of a starting ZIP. Powered by haversine distance for accurate geodesic calculations.

Full-Text Search

Search across city name, county, and state simultaneously. Supports pagination so large result sets stay fast.

State Explorer

List all 50 US states with ZIP code counts, or pull every ZIP for a specific state — perfect for populating dropdowns and maps.

City ZIPs

Retrieve all ZIP codes for a given city name, optionally restricted to a single state to handle common city names unambiguously.

GeoNames Data Source

Sourced from the authoritative GeoNames US ZIP code dataset. Bootstrapped automatically on service start; no manual data imports needed.

Quick Start

Up and Running
in 60 Seconds

Pass your API key as a header and make your first request.

curl
# Look up ZIP code 90210
curl https://apibarn.com/v1/zipcode/api/zip/90210 \
  -H "x-api-key: YOUR_API_KEY"

# Find ZIP codes within 10 miles of 10001 (NYC)
curl "https://apibarn.com/v1/zipcode/api/zip/10001/nearby?radiusMiles=10&limit=20" \
  -H "x-api-key: YOUR_API_KEY"
More Examples →