Loading...

Knowledge Base

Get the List of States for a Country Using the API

When you want to retrieve the list of states for a specific country. This article explains the required parameters and API request format for fetching state IDs and state names using the country code.

Getting the List of States for a Specific Country

Description

Gets the list of States for a specified Country.

Parameters

NameData TypeRequired / OptionalDescription
auth-useridIntegerRequiredAuthentication Parameter
api-keyStringRequiredAuthentication Parameter
country-codeStringRequiredCountry Code as per ISO 3166-1 alpha-2

HTTP Method

GET

Example Test URL Request

https://test.httpapi.com/api/country/state-list.xml?auth-userid=0&api-key=key&country-code=nn

Response

Returns the list of States for the Specified Country with the below details:

  • State ID

  • State Name