States of every country request - demo

All demos can be found in our download file. Please download the examples to see the API in action.

Download our example jQuery code, it comes with JavaScript and PHP libraries that make connecting to our API a breeze. Your API key can be found in your air-port-codes.com account and is necessary to be granted access privileges.

Demo 1: Select field selected with your country

This uses our countries endpoint and once you select a country it populates the state/province select field. Notice it also updates the district type text in the label depending on what type of district is associated with the selected country. It can also pre-populate to the users location as you see in the example below.

For any country that has regions (United Kingdom, )

Demo 2: Retrieve states object for a specific country

This shows you what the json response from the endpoint will be.

Response Object.