List Countries

Why List Countries

When you want to create geo-targeting settings for a flight, it is helpful to know the different geographical areas and associated codes for each of these countries so you can properly set up geo-targeting for the specific regions and areas you want to target. The Kevel API enables you to retrieve a complete list of all countries (and codes) that you can use in geo-targeting. When you make an API request to this endpoint, a list of all geographical areas and codes for counties will be returned as a JSON object (~400KB).

API Syntax

When using the List Countries 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/countries

Where:

``200 200

json


ShellJavaScriptRuby


xxxxxxxxxx

curl -X GET -H "X-Adzerk-ApiKey:$ADZERK_API_KEY" "https://api.kevel.co/v1/countries"

xxxxxxxxxx

[
  { 
    regions: {
      'us:pa': {
        countryCode: 'US',
        metros: [Object],
        name: 'Pennsylvania',
        code: 'PA'
      },
      'us:ak': { countryCode: 'US', metros: [Object], name: 'Alaska', code: 'AK' },
      'us:or': { countryCode: 'US', metros: [Object], name: 'Oregon', code: 'OR' },
      'us:ky': {
        countryCode: 'US',
        metros: [Object],
        name: 'Kentucky',
        code: 'KY'
      },
      'us:mi': {
        countryCode: 'US',
        metros: [Object],
        name: 'Michigan',
        code: 'MI'
      },
      'us:wa': {
        countryCode: 'US',
        metros: [Object],
        name: 'Washington',
        code: 'WA'
      }
    }
  }
]

Updated 10 months ago

* * *