States API
All 50 US States
FIPS Codes
Read-Only Reference

US state metadata. One lookup away.

Names, abbreviations, FIPS codes, capitals, regions, timezones, admission dates, and population for every US state. Search the list or look up by code.

50 · states covered8 · fields per state3 · lookup stylesJSON · responses

Look up any state.

This calls the live States API. Pull the full list, search by name, or fetch a single state by abbreviation.

Request builder
Three lookup styles, one dataset.
GET /us-states/CA

Any two-letter abbreviation works in production.

Every state, eight fields
stateName, abbreviation, fipsCode, capital, region, timezones, admittedOn, and population. FIPS lookups are also available at /fips/:code.
Output preview
Live response from the API, plus the exact request to reproduce it.
stateabbrfipscapitalregionpopulation
Loading live response...

Why States API

Stop hard-coding state tables.

Complete state reference

All 50 US states with name, abbreviation, FIPS code, capital, region, timezones, admission date, and population.

FIPS code lookups

Resolve census and government datasets with GET /fips/:code. Single-digit codes are auto-padded, so 6 and 06 both return California.

Name search

Filter the list with a q parameter: /us-states?q=new returns New Hampshire, New Jersey, New Mexico, and New York in one call.

Region and timezone data

Group states by census region or map users to timezones without maintaining your own lookup table.

Population figures

Census population values ready for per-capita math, market sizing, and choropleth maps.

Read-only and stable

Reference data that changes rarely and an API surface that never mutates. Cache aggressively; responses are consistent between calls.

/api/v1/us-states

Endpoints, at a glance.

One list endpoint with search, plus direct lookups by abbreviation or FIPS code. All read-only GETs.
GET/api/v1/us-states

List and search states

Returns all 50 states, or a filtered list with the optional q search parameter.

PRIMARY
GET/api/v1/us-states/:abbr

Lookup by abbreviation

Single state by two-letter code, e.g. /us-states/CA returns California.

GET/api/v1/us-states/fips/:fipscode

Lookup by FIPS code

Single state by FIPS code. Codes are auto-padded to two digits, so 6 resolves to 06.

GET/health

Service health

Status, version, timestamp, and uptime for monitoring.

GET/metrics

Prometheus metrics

Request counts and latency histograms in Prometheus exposition format.

ParameterTypeRequiredDescription
qstringnoSearch term for the list endpoint. Matches state names, e.g. ?q=new.
abbrpathfor /us-states/:abbrTwo-letter state abbreviation, case-insensitive.
fipscodepathfor /fips/:fipscodeOne- or two-digit FIPS code; auto-padded to two digits.

Error reference

Simple errors for a simple API.

Failed lookups return a plain error message and a correlationId for tracing.

404State Not Found

No state matches the requested abbreviation, e.g. /us-states/ZZ. Check the two-letter code.

404FIPS Not Found

No state matches the requested FIPS code, e.g. /fips/99. Valid codes run from 01 to 56.

404Unknown Route

The path is not one of /us-states, /us-states/:abbr, or /us-states/fips/:fipscode.

401Authentication Error

Missing or invalid API key at the gateway. Send x-api-key or api_key with every request.

500Internal Error

Unexpected runtime failure. The response includes details and a correlationId for tracing.

Example error response

{
  "error": "FIPS code 99 not found",
  "correlationId": "1780011610881-z0qs7cw52"
}

FAQ

API questions developers ask first.

What data does the States API return for each state?

Eight fields per state: stateName, abbreviation, fipsCode, capital, region, timezones, admittedOn (admission date), and population. The same shape is returned by list, search, abbreviation, and FIPS lookups.

How do FIPS code lookups work?

GET /fips/:fipscode accepts one- or two-digit codes and auto-pads them, so /fips/6 and /fips/06 both return California. Unknown codes return a 404 with an explanatory error.

Can I search states by name?

Yes. Add q to the list endpoint: /us-states?q=new returns every state whose name matches, such as New Hampshire, New Jersey, New Mexico, and New York.

Is the data safe to cache?

Yes. The API is read-only reference data that changes rarely (population updates with census revisions), so aggressive client-side caching is appropriate.

How do I authenticate requests?

Send your Datpaq API key as an x-api-key header or an api_key query parameter. Keys are created in the Datpaq dashboard and a free tier is included.

Every US state, ready to query.

Abbreviations, FIPS codes, capitals, regions, timezones, and population from one read-only endpoint. No CSV to import, no table to maintain.