Array of states

Lists US state codes usable for state-level geo-targeting. That feature is not available yet: until it launches, a request that includes a state is rejected as a validation error. States exist only for the US; any other country value yields an empty array.

get/v1/states

Request

  • Base URL: https://api.answerline.dev
  • URL: https://api.answerline.dev/v1/states
  • Auth: HTTP bearer

Query parameters

countrystring required

Country as an ISO 3166-1 alpha-2 code. Results are available only for "US".

Response

States that are supported

codestring required

Two-letter state abbreviation as defined by USPS

namestring required

State name written out in full

Example response

[
  {
    "code": "AL",
    "name": "Alabama"
  },
  {
    "code": "AK",
    "name": "Alaska"
  },
  {
    "code": "AZ",
    "name": "Arizona"
  },
  {
    "code": "CA",
    "name": "California"
  },
  {
    "code": "DC",
    "name": "District of Columbia"
  },
  {
    "code": "NY",
    "name": "New York"
  },
  {
    "code": "TX",
    "name": "Texas"
  }
]

Changes

No recorded changes to this operation across all 1 revision of this API.