# Zip Codes Lookup API

> Zip Codes Lookup finds all postal codes within a US city or resolves a five-digit ZIP code to its city and state. Every ZIP also returns its primary county. Paid plans add the county and state FIPS codes, every county a ZIP crosses with its land share, the IANA time zone, geographic coordinates and the distance from the ZIP to a second ZIP.

**Endpoint:** `GET https://api.apiverve.com/v1/zipcodes`  
**Category:** Geography  
**Cost:** 2 credits per call  
**Canonical page:** https://apiverve.com/marketplace/zipcodes

## Overview

A US zip code lookup API: get the city and state from a zip code, or list every ZIP code in a city. Zip Codes Lookup works by querying a database of US zip codes and returns the matches as JSON with each ZIP's primary county, with county FIPS codes, time zone, latitude, longitude and ZIP-to-ZIP distance on paid plans.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl "https://api.apiverve.com/v1/zipcodes?zip=64082&distanceTo=64106" \
  -H "x-api-key: YOUR_API_KEY"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `zip` | string | Yes | The US ZIP code to look up. ZIP+4 (64082-1234) and ZIPs that lost their leading zero in a spreadsheet (2134 for 02134) are accepted. length 3-10 |
| `distanceTo` | string | No | A second US ZIP code; adds a distance object with the straight-line distance between the two ZIP centroids. length 3-10. Premium field |

## Response fields

- `zipcode` — string · The ZIP code for the requested location
- `state_abbr` — string · Two-letter state abbreviation code
- `latitude` — string · Geographic latitude coordinate of the location · (premium)
- `longitude` — string · Geographic longitude coordinate of the location · (premium)
- `city` — string · City name associated with the ZIP code
- `state` — string · Full state name corresponding to the abbreviation
- `timezone` — string · IANA time zone of the ZIP code's location (e.g., America/Chicago) · (premium)
- `county` — string · Primary county of the ZIP code: the county holding the largest share of its land (e.g., Travis County)
- `countyFips` — string · Five-digit FIPS code of the primary county (state + county, e.g., 48453) · (premium)
- `stateFips` — string · Two-digit FIPS code of the ZIP code's state (e.g., 48) · (premium)
  - `counties.0.name` — string · County name · (premium)
  - `counties.0.fips` — string · Five-digit county FIPS code · (premium)
  - `counties.0.landShare` — number · Fraction (0-1) of the ZIP code's land area inside this county · (premium)
- `distance` — object · Distance to the ZIP given in distanceTo (only when distanceTo is set) · (premium)
  - `distance.zipcode` — string · The ZIP code given in distanceTo · (premium)
  - `distance.city` — string · City name of the distanceTo ZIP code · (premium)
  - `distance.state_abbr` — string · Two-letter state abbreviation of the distanceTo ZIP code · (premium)
  - `distance.miles` — number · Straight-line distance between the two ZIP centroids in miles · (premium)
  - `distance.kilometers` — number · Straight-line distance between the two ZIP centroids in kilometers · (premium)

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "zipcode": "64082",
    "state_abbr": "MO",
    "latitude": "38.850243",
    "longitude": "-94.39570",
    "city": "Lees Summit",
    "state": "Missouri",
    "timezone": "America/Chicago",
    "county": "Jackson County",
    "countyFips": "29095",
    "stateFips": "29",
    "counties": [
      {
        "name": "Jackson County",
        "fips": "29095",
        "landShare": 0.9077
      },
      {
        "name": "Cass County",
        "fips": "29037",
        "landShare": 0.0923
      }
    ],
    "distance": {
      "zipcode": "64106",
      "city": "Kansas City",
      "state_abbr": "MO",
      "miles": 19.94,
      "kilometers": 32.09
    }
  }
}
```

## Use cases

- **Checkout Address Autofill** — Fill in city and state names automatically when an online shopper types their five-digit postal code during checkout.
- **Delivery Zone Assignment** — Dispatch software queries a target city and state to collect every valid postal code before assigning regional courier routes.
- **Territory Sales Mapping** — When sorting sales leads, CRM systems look up postal codes to group prospects under the correct state and municipal account reps.
- **Shipping Address Verification** — To prevent delivery exceptions, order management systems check customer-entered postal codes against returned state codes before processing fulfillment.

## SDKs

- **npm** — `npm install @apiverve/zipcodes` (https://www.npmjs.com/package/@apiverve/zipcodes)
- **PyPI** — `pip install apiverve-zipcodes` (https://pypi.org/project/apiverve-zipcodes/)
- **NuGet** — `dotnet add package APIVerve.API.ZipCodesLookup` (https://www.nuget.org/packages/APIVerve.API.ZipCodesLookup)
- **Source** — https://github.com/apiverve/zipcodes-api

## More

- Full reference: https://docs.apiverve.com/ref/zipcodes
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
