---
updatedAt: 2025-09-18T22:00:21.000Z
agentTools:
  projectIndex: https://dev.kevel.com/llms.txt
---

# 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:

* `GET` - the type of API request being made.
* `https://api.kevel.co` - the URL for the request.
* `v1` - the API version.
* `countries` - the API endpoint being called.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "management-api-2",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.kevel.co"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "name": "X-Adzerk-ApiKey",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/v1/countries": {
      "get": {
        "summary": "List Countries",
        "description": "",
        "operationId": "list-geo-codes",
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "[\n  {\n    regions: {\n      'us:pa': {\n        countryCode: 'US',\n        metros: [Object],\n        name: 'Pennsylvania',\n        code: 'PA'\n      },\n      'us:ak': { countryCode: 'US', metros: [Object], name: 'Alaska', code: 'AK' },\n      'us:or': { countryCode: 'US', metros: [Object], name: 'Oregon', code: 'OR' },\n      'us:ky': {\n        countryCode: 'US',\n        metros: [Object],\n        name: 'Kentucky',\n        code: 'KY'\n      },\n      'us:mi': {\n        countryCode: 'US',\n        metros: [Object],\n        name: 'Michigan',\n        code: 'MI'\n      },\n      'us:wa': {\n        countryCode: 'US',\n        metros: [Object],\n        name: 'Washington',\n        code: 'WA'\n      },\n\n...."
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/countries\""
            },
            {
              "language": "javascript",
              "code": "const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listCountries() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let countries = await client.run(\"geoTargeting\", \"listCountries\");\n\n  // Print out the entire response tree\n  console.dir(countries, {depth: null});\n\n  // Print mapping of country codes to names\n  let codesAndNames = countries.map(c => [c.code, c.name])\n  console.log(codesAndNames);\n}\n\nlistCountries();"
            },
            {
              "language": "ruby",
              "code": "require \"adzerk\"\n\ndef list_countries()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.flights.countries()\nend\nlist_countries()"
            }
          ],
          "samples-languages": [
            "curl",
            "javascript",
            "ruby"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [
      {
        "key": "X-Adzerk-Sdk-Version",
        "value": "Readme.io:ManagementAPI2"
      }
    ],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```