List Regions in Country

Why List Regions In a Country?

If you would like to find specific regions within a country for geo-targeting purposes, the Kevel API enables you to return a list of regions within a country. Using the List Regions in Country API endpoint and passing the CountryCode as part of the request, you can view all regions within a country that are currently supported.

API Syntax

When using the List Regions in Country API endpoint, it is important to understand the syntax required to make the request. Because the Kevel API is a RESTful API, there is a specific request format that must be followed to ensure the endpoint can process the request. The format is:

GET https://api.kevel.co/v1/country/{CountryCode}/regions?version=2

Where:

CountryCode

Type: string
Required: Yes
Description: The 2-3 character string that denotes the country you want to target

Returns regions in the United States (country code "US")

curl -X GET -H "X-Adzerk-ApiKey:$ADZERK_API_KEY" "https://api.kevel.co/v1/country/US/regions"
{
  'us:pa': {
    countryCode: 'US',
    metros: {
      '501': {
        name: 'New York, NY',
        code: '501',
        regionCodes: [ 'NY', 'PA', 'CT', 'NJ' ]
      },
      '502': {
        name: 'Binghamton, NY',
        code: '502',
        regionCodes: [ 'NY', 'PA' ]
      },
      '504': {
        name: 'Philadelphia, PA',
        code: '504',
        regionCodes: [ 'PA', 'DE', 'MD', 'NJ' ]
      },
      '508': {
        name: 'Pittsburgh, PA',
        code: '508',
        regionCodes: [ 'PA', 'MD', 'WV' ]
      },
      '511': {
        name: 'Washington, DC (Hagerstown, MD)',
        code: '511',
        regionCodes: [ 'VA', 'PA', 'DC', 'MD', 'WV' ]
      },
      '514': { name: 'Buffalo, NY', code: '514', regionCodes: [ 'NY', 'PA' ] },
      '516': { name: 'Erie, PA', code: '516', regionCodes: [ 'NY', 'PA' ] },
      '536': {
        name: 'Youngstown, OH',
        code: '536',
        regionCodes: [ 'PA', 'OH' ]
      },
      '554': {
        name: 'Wheeling, WV-Steubenville, OH',
        code: '554',
        regionCodes: [ 'PA', 'WV', 'OH' ]
      },
      '565': { name: 'Elmira, NY', code: '565', regionCodes: [ 'NY', 'PA' ] },
      '566': {
        name: 'Harrisburg-Lancaster-Lebanon-York, PA',
        code: '566',
        regionCodes: [ 'PA', 'MD' ]
      },
      '574': {
        name: 'Johnstown-Altoona, PA',
        code: '574',
        regionCodes: [ 'PA' ]
      },
      '577': {
        name: 'Wilkes Barre-Scranton, PA',
        code: '577',
        regionCodes: [ 'NY', 'PA' ]
      }
    },
    name: 'Pennsylvania',
    code: 'PA'
  }
}