Countries

💡

Tip: You can test this endpoint without an API key — requests without authentication use a lower rate limit.

Retrieve detailed information about countries, including codes, currencies, languages, timezones, and neighboring countries.

Standards Used

  • ISO 3166-1
  • IANA TZDB
  • ISO 4217
  • ISO 639-1

The Country object#

FieldTypeRequiredDescription
alpha3stringYesISO 3166-1 alpha-3 code.
Example: JPN
cctldstringNoCountry code top-level domain.
Example: .jp
codestringYesISO 3166-1 alpha-2 code.
Example: JP
continentstringYesContinent name.
Example: Asia
currenciesstring[]YesAll currencies (ISO 4217 codes).
Example: ["JPY"]
languagesstring[]YesOfficial/primary languages (ISO 639-1 codes).
Example: ["ja"]
namestringYesCommon country name.
Example: Japan
neighborsstring[]YesNeighboring countries (alpha-2 codes).
Example: []
numericinteger (int32)YesISO 3166-1 numeric code.
Example: 392
official_namestringYesOfficial country name.
Example: Japan
primary_currencystringNoPrimary currency (ISO 4217 code).
Example: JPY
primary_languagestringNoPrimary language (ISO 639-1 code).
Example: ja
timezonesstring[]YesTimezones (IANA identifiers).
Example: ["Asia/Tokyo"]

Endpoints#

Query Parameters

ParameterTypeRequiredDescription
pagequeryintegerNoPage number (1-indexed).
Example: 1
per_pagequeryintegerNoNumber of results per page (1-100).
Example: 20

Response

FieldTypeRequiredDescription
dataobject[]YesThe data items for this page.
paginationobjectYes Pagination metadata in response.
pageintegerYesCurrent page number.
Example: 1
per_pageintegerYesItems per page.
Example: 20
total_itemsintegerYesTotal number of items.
Example: 100
total_pagesintegerYesTotal number of pages.
Example: 5

Example Request

const response = await fetch(
  'https://worlddataapi.com/v1/countries?page=1&per_page=20',
  {
    headers: {
      'X-API-Key': 'YOUR_API_KEY'
    }
  }
);

const data = await response.json();

Error Responses

StatusDescription
429Rate limit exceeded

Path Parameters

ParameterTypeRequiredDescription
identifierpathstringYesCountry code (alpha-2, alpha-3, numeric) or name

Response

FieldTypeRequiredDescription
alpha3stringYesISO 3166-1 alpha-3 code.
Example: JPN
cctldstringNoCountry code top-level domain.
Example: .jp
codestringYesISO 3166-1 alpha-2 code.
Example: JP
continentstringYesContinent name.
Example: Asia
currenciesstring[]YesAll currencies (ISO 4217 codes).
Example: ["JPY"]
languagesstring[]YesOfficial/primary languages (ISO 639-1 codes).
Example: ["ja"]
namestringYesCommon country name.
Example: Japan
neighborsstring[]YesNeighboring countries (alpha-2 codes).
Example: []
numericinteger (int32)YesISO 3166-1 numeric code.
Example: 392
official_namestringYesOfficial country name.
Example: Japan
primary_currencystringNoPrimary currency (ISO 4217 code).
Example: JPY
primary_languagestringNoPrimary language (ISO 639-1 code).
Example: ja
timezonesstring[]YesTimezones (IANA identifiers).
Example: ["Asia/Tokyo"]

Example Request

const response = await fetch(
  'https://worlddataapi.com/v1/countries/example',
  {
    headers: {
      'X-API-Key': 'YOUR_API_KEY'
    }
  }
);

const data = await response.json();

Error Responses

StatusDescription
404Country not found