Skip to main content

states

Public: no authentication required.

Get states/provinces for a country

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

query States($countryCode: String!) {
states(countryCode: $countryCode) {
code
name
capital
}
}

Variables:

{
"countryCode": "string"
}

Response:

{
"data": {
"states": [
{
"code": "string",
"name": "string",
"capital": "string"
}
]
}
}
states(
countryCode: String!
): [StateListItem!]!

Arguments​

states.countryCode ● String! non-null scalar​

The two-letter ISO country code.

Type​

StateListItem object​

A state or region to pick from.