# Country Lookup API

> Country Lookup matches any country name or ISO code to its official names, ISO 3166 codes, capitals, region, languages, and flag emoji. Paid plans add coordinates and major cities, and with details=true demonyms, land area and UN membership.

**Endpoint:** `GET https://api.apiverve.com/v1/countrylookup`  
**Category:** Geography  
**Cost:** 2 credits per call  
**Canonical page:** https://apiverve.com/marketplace/countrylookup

## Overview

Pass a common country name, alternate spelling, or ISO 3166 code in the query. It also works as a lightweight country flag API, since every record carries the country's flag emoji, and paid plans add each country's native name. The service searches a dataset of 250 countries, returning matching records with capitals, domain extensions, region groupings, and mapped official languages. On paid plans, setting details to true adds the English and French demonyms, total area in square kilometers and UN membership. Paid plans can set the major cities parameter to include prominent urban centers along with geographic coordinates.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl "https://api.apiverve.com/v1/countrylookup?country=USA&majorcities=true&details=true" \
  -H "x-api-key: YOUR_API_KEY"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `country` | string | Yes | The country name or ISO code to look up (e.g., USA). Native names (Deutschland, España), dotted codes (U.S., U.K.) and England, Scotland, Wales or Northern Ireland are accepted |
| `majorcities` | boolean | No | Specify if you would like to return all major cities of the country found. default false. Premium field |
| `details` | boolean | No | Set to true to add demonyms, land area in square kilometers, and UN membership to each country. default false |

## Response fields

- `search` — string · The search term or country code used in the lookup request
  - `countries.0.name` — object · The country's names: common, official, and native forms
    - `countries.0.name.common` — string · Common name of the country used in everyday reference
    - `countries.0.name.official` — string · Official formal name of the country recognized internationally
    - `countries.0.name.native` — object · Native language names of the country keyed by language code · (premium)
      - `countries.0.name.native.eng` — object · (premium)
        - `countries.0.name.native.eng.official` — string · (premium)
        - `countries.0.name.native.eng.common` — string · (premium)
  - `countries.0.tld` — array · Top-level domains associated with the country
  - `countries.0.cca2` — string · Two-letter country code following ISO 3166-1 alpha-2 standard
  - `countries.0.ccn3` — string · Three-digit country code following ISO 3166-1 numeric standard · (premium)
  - `countries.0.cca3` — string · Three-letter country code following ISO 3166-1 alpha-3 standard
  - `countries.0.cioc` — string · International Olympic Committee country code for sports competitions · (premium)
  - `countries.0.independent` — boolean · Indicates whether the country is politically independent · (premium)
  - `countries.0.status` — string · Official assignment status of the country code in international records · (premium)
  - `countries.0.unRegionalGroup` — string · UN regional group the country belongs to
  - `countries.0.capital` — array · Array of capital city or cities of the country
  - `countries.0.altSpellings` — array · Alternative spellings and abbreviations of the country name
  - `countries.0.region` — string · Geographic region where the country is located globally
  - `countries.0.subregion` — string · More specific geographic subregion classification of the country
  - `countries.0.languages` — object · Object mapping language codes to official language names
    - `countries.0.languages.eng` — string
  - `countries.0.latlng` — array · Array with latitude and longitude coordinates for country center · (premium)
  - `countries.0.landlocked` — boolean · Indicates whether the country has no ocean or sea coastline · (premium)
  - `countries.0.flag` — string · Unicode flag emoji representation of the country
  - `countries.0.area` — number · Total area of the country in square kilometers, returned when details=true (null when unknown) · (premium)
  - `countries.0.demonyms` — object · Demonyms keyed by language code, each with feminine (f) and masculine (m) forms, returned when details=true · (premium)
    - `countries.0.demonyms.eng` — object · (premium)
      - `countries.0.demonyms.eng.f` — string · (premium)
      - `countries.0.demonyms.eng.m` — string · (premium)
    - `countries.0.demonyms.fra` — object · (premium)
      - `countries.0.demonyms.fra.f` — string · (premium)
      - `countries.0.demonyms.fra.m` — string · (premium)
  - `countries.0.unMember` — boolean · Whether the country is a United Nations member state, returned when details=true · (premium)

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "search": "USA",
    "countries": [
      {
        "name": {
          "common": "United States",
          "official": "United States of America",
          "native": {
            "eng": {
              "official": "United States of America",
              "common": "United States"
            }
          }
        },
        "tld": [
          ".us"
        ],
        "cca2": "US",
        "ccn3": "840",
        "cca3": "USA",
        "cioc": "USA",
        "independent": true,
        "status": "officially-assigned",
        "unRegionalGroup": "Western European and Others Group",
        "capital": [
          "Washington D.C."
        ],
        "altSpellings": [
          "US",
          "USA",
          "United States of America"
        ],
        "region": "Americas",
        "subregion": "North America",
        "languages": {
          "eng": "English"
        },
        "latlng": [
          38,
          -97
        ],
        "landlocked": false,
        "flag": "🇺🇸",
        "area": 9372610,
        "demonyms": {
          "eng": {
            "f": "American",
            "m": "American"
          },
          "fra": {
            "f": "Américaine",
            "m": "Américain"
          }
        },
        "unMember": true
      }
    ]
  }
}
```

## Use cases

- **Customs Declaration Filling** — When generating export manifests, logistics software queries the destination ISO code to append standardized official country names and regions.
- **Locale Preference Detection** — E-commerce platforms resolve visitor country codes to display corresponding official languages and flag icons on storefront headers.
- **Global Vendor Profiling** — Standardize supplier databases by resolving freeform location text into uniform ISO alpha-3 codes, capital cities, and top-level domains.
- **Traveler Briefing Packs** — Travel booking apps supply passengers with destination briefing cards containing capital cities, spoken languages, and regional groupings before departure.

## SDKs

- **npm** — `npm install @apiverve/countrylookup` (https://www.npmjs.com/package/@apiverve/countrylookup)
- **PyPI** — `pip install apiverve-countrylookup` (https://pypi.org/project/apiverve-countrylookup/)
- **NuGet** — `dotnet add package APIVerve.API.CountryLookup` (https://www.nuget.org/packages/APIVerve.API.CountryLookup)
- **Source** — https://github.com/apiverve/countrylookup-api

## More

- Full reference: https://docs.apiverve.com/ref/countrylookup
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
