ApiCountries

/alpha/[code]

This endpoint retrieves detailed information about a country based on its ISO 3166-1 alpha-2 or alpha-3 code, including data such as names, capital cities, population, regions, languages, currencies, flags, and more.

Usage - Searching for Israel alpha code IL or ISR

You can use alpha2Code

GET/alpha/IL


curl -X GET "https://www.apicountries.com/alpha/IL"

OR alpha3Code

GET/alpha/ISR


curl -X GET "https://www.apicountries.com/alpha/ISR"

This endpoint returns a country.

Response

[
    {
        "name": "Israel",
        "topLevelDomain": [
            ".il"
        ],
        "alpha2Code": "IL",
        "alpha3Code": "ISR",
        "callingCodes": [
            "972"
        ],
        "capital": "Jerusalem",
        "altSpellings": [
            "IL",
            "State of Israel",
            "Medīnat Yisrā'el"
        ],
        "subregion": "Western Asia",
        "region": "Asia",
        "population": 9216900,
        "latlng": [
            31.5,
            34.75
        ],
        "demonym": "Israeli",
        "area": 20770,
        "gini": 39,
        "timezones": [],
        "borders": [
            "EGY",
            "JOR",
            "LBN",
            "SYR"
        ],
        "nativeName": "יִשְׂרָאֵל",
        "numericCode": "376",
        "flags": {
            "svg": "https://flagcdn.com/il.svg",
            "png": "https://flagcdn.com/w320/il.png"
        },
        "currencies": [
            {
                "code": "ILS",
                "name": "Israeli new shekel",
                "symbol": "₪"
            }
        ],
        "languages": [
            {
                "iso639_1": "he",
                "iso639_2": "heb",
                "name": "Hebrew (modern)",
                "nativeName": "עברית"
            },
            {
                "iso639_1": "ar",
                "iso639_2": "ara",
                "name": "Arabic",
                "nativeName": "العربية"
            }
        ],
        "translations": {
            "br": "Israel",
            "pt": "Israel",
            "nl": "Israël",
            "hr": "Izrael",
            "fa": "اسرائیل",
            "de": "Israel",
            "es": "Israel",
            "fr": "Israël",
            "ja": "イスラエル",
            "it": "Israele",
            "hu": "Izrael"
        },
        "flag": "https://flagcdn.com/il.svg",
        "cioc": "ISR",
        "independent": true
    }
]

Types

/**
 * Information about a country.
 */
export interface Country {
  /**
   * Name of the country.
   */
  name: string;
  /**
   * Top level domain(s) of the country.
   */
  topLevelDomain: string[];
  /**
   * Alpha-2 code of the country.
   */
  alpha2Code: string;
  /**
   * Alpha-3 code of the country.
   */
  alpha3Code: string;
  /**
   * Calling code(s) of the country.
   */
  callingCodes: string[];
  /**
   * Capital city of the country.
   */
  capital: string;
  /**
   * Alternative spellings of the country name.
   */
  altSpellings: string[];
  /**
   * Subregion of the country.
   */
  subregion: string;
  /**
   * Region of the country.
   */
  region: string;
  /**
   * Population of the country.
   */
  population: number;
  /**
   * Latitude and longitude of the country.
   */
  latlng: number[];
  /**
   * Demonym for the country's people.
   */
  demonym: string;
  /**
   * Area of the country in square kilometers.
   */
  area: number;
  /**
   * Timezone(s) of the country.
   */
  timezones: string[];
  /**
   * Bordering countries.
   */
  borders: string[];
  /**
   * Native name of the country.
   */
  nativeName: string;
  /**
   * Numeric code of the country.
   */
  numericCode: string;
  /**
   * Flags of the country.
   */
  flags: {
    /**
     * SVG format flag URL.
     */
    svg: string;
    /**
     * PNG format flag URL.
     */
    png: string;
  };
  /**
   * Currencies used in the country.
   */
  currencies: {
    /**
     * Currency code.
     */
    code: string;
    /**
     * Currency name.
     */
    name: string;
    /**
     * Currency symbol.
     */
    symbol: string;
  }[];
  /**
   * Languages spoken in the country.
   */
  languages: {
    /**
     * ISO 639-1 language code.
     */
    iso639_1: string;
    /**
     * ISO 639-2 language code.
     */
    iso639_2: string;
    /**
     * Language name.
     */
    name: string;
    /**
     * Native name of the language.
     */
    nativeName: string;
  }[];
  /**
   * Translations of the country name.
   */
  translations: {
    [key: string]: string;
  };
  /**
   * URL of the country's flag.
   */
  flag: string;
  /**
   * Regional blocs the country is part of.
   */
  regionalBlocs: {
    /**
     * Acronym of the regional bloc.
     */
    acronym: string;
    /**
     * Name of the regional bloc.
     */
    name: string;
  }[];
  /**
   * Country code for the International Olympic Committee.
   */
  cioc: string;
  /**
   * Whether the country is independent.
   */
  independent: boolean;
}

Status Code

Status codeDescription
200Success
400Bad request
404Not found
429Rate limit exceeded

Last updated on

On this page

Star us on Github