List states

Overview

Get the states or regions in a country.

Use this after the user picks a country.

You'll need the country.

Returns states with their codes, sorted by name. Use a state's value as state_code in List cities.

Prerequisites

Base URL

EnvironmentURL
Productionhttps://production-api.shoutaboutus.com
Developmenthttps://development-api.shoutaboutus.com

Endpoint

GET /api/v1/address/states

Authentication

Public (no token)

  • Anyone gets the same global list. A Partner or Account token may be sent, but none is needed.

Rate limit

100 requests per minute, counted per client IP address. See Rate limits.

Request parameters

ParameterInTypeRequiredDescription
country_codequerystringYesThe country's ISO code, for example US. Must be a known country code.

Request body

None.

Request payload

None.

Response body

The payload is inside data.data: one entry per state.

FieldTypeDescription
data.data[].valuestringThe state's code, for example CA. Use it as state_code.
data.data[].labelstringThe state's name.

Response payload

{
  "data": {
    "data": [
      {
        "value": "AL",
        "label": "Alabama"
      },
      {
        "value": "AK",
        "label": "Alaska"
      },
      {
        "value": "AS",
        "label": "American Samoa"
      },
      {
        "value": "AZ",
        "label": "Arizona"
      }
    ]
  }
}

Examples

Success payload

See Response payload (shortened; country_code=US returns every state and territory).

Error payload

422 country_code missing

{
  "message": "The country code field is required.",
  "errors": {
    "country_code": [
      "The country code field is required."
    ]
  }
}

422 Unknown country

{
  "message": "The selected country code is invalid.",
  "errors": {
    "country_code": [
      "The selected country code is invalid."
    ]
  }
}

429 Too many requests

{
  "message": "Too Many Attempts."
}
StatusMeaning
200The country's states.
422country_code is missing or unknown.
429More than 100 requests in a minute from your IP address.
500Unexpected server error.

Example request

curl --request GET \
  --url "https://production-api.shoutaboutus.com/api/v1/address/states?country_code=US" \
  --header 'Accept: application/json'

Did this page help you?