US Address Validation API

Rule-based US address validation for form and negative testing: USPS-style standardisation, ZIP format and ZIP-to-state area checks, a sample ZIP lookup and per-field 422 errors.

Base URL: https://funapi.dev/api/address/v1 · 3 endpoints · OpenAPI 3.1 spec and Postman collection available. New here? Read the getting started guide.

validation

validate and standardise

lookup

ZIPs and states

The US Address Validation API checks addresses the way a checkout form needs: it standardises the street line with USPS-style abbreviations, normalises city, state and ZIP+4, flags a ZIP whose USPS area does not contain the state, and returns per-field 422 errors for missing or malformed input. It is rule-based practice validation, not a USPS service, which keeps it deterministic and free.

What you can practise here

Example request and response

GET https://funapi.dev/api/address/v1/states — The 50 states and DC with their codes. No token, no signup:

curl -i https://funapi.dev/api/address/v1/states

Response: 200 OK

{
  "data": [
    {
      "code": "AL",
      "name": "Alabama"
    },
    {
      "code": "AK",
      "name": "Alaska"
    },
    {
      "code": "AZ",
      "name": "Arizona"
    },
    {
      "code": "AR",
      "name": "Arkansas"
    },
    {
      "code": "CA",
      "name": "California"
    },
    {
      "code": "CO",
      "name": "Colorado"
    },
    {
      "code": "CT",
      "name": "Connecticut"
    },
    {
      "code": "DE",
      "name": "Delaware"
    },
    {
      "code": "DC",
      "name": "District of Columbia"
    },
    {
      "code": "FL",
      "name": "Florida"
    },
    {
      "code": "GA",
      "name": "Georgia"
    },
    {
      "code": "HI",
      "name": "Hawaii"
    },
    {
      "code": "ID",
      "name": "Idaho"
    },
    {
      "code": "IL",
      "name": "Illinois"
    },
    {
      "code": "IN",
      "name": "Indiana"
    },
    {
      "code": "IA",
      "name": "Iowa"
    },
    {
      "code": "KS",
      "name": "Kansas"
    },
    {
      "code": "KY",
      "name": "Kentucky"
    },
    {
      "code": "LA",

(truncated — the full response comes back when you run it)

Open and run this endpoint

All 55 mock REST APIs

Use this response elsewhere

Last updated