Need help with your APIs? I offer API discovery, governance & evangelism services. Explore services →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

REST Countries Countries API

Country lookup and search endpoints

REST Countries Countries API is published by REST Countries on the APIs.io network, described by a machine-readable OpenAPI specification.

This API exposes 3 JSON Schema definitions.

Tagged areas include Countries. The published artifact set on APIs.io includes an OpenAPI specification, API documentation, a JSON-LD context, rate-limit docs, and 3 JSON Schemas.

This API exposes 4 operations across 4 paths, and defines 22 schemas. It is described by OpenAPI 3.1.0, at version v5.

Requests are made against a single base URL, https://api.restcountries.com/countries/v5.

4 operations 4 paths 22 schemas 4 GET

Metadata

The identity and technical contract details declared by the specification.

Specification
OpenAPI 3.1.0
API Version
v5
Base URL
https://api.restcountries.com/countries/v5
Authentication
HTTP Bearer, API Key
Terms of Service
Resource Areas
1

Authentication & Security 2

REST Countries Countries API declares 2 security schemes for authenticating requests. It accepts HTTP bearer tokens (bearerAuth). An API key is passed in the query as api-key (apiKeyQuery). By default, every request must be authenticated.

  • bearerAuth — Bearer token authentication. Obtain your API key from https://restcountries.com. A demo key rclivedemo is available for testing.
  • apiKeyQuery — API key passed as a query parameter (less secure)

Paths & Operations 4

Across 4 paths, the API surfaces 4 operations — 4 GET. Each is listed below with its method, path, parameters, and response codes.

Countries 4

Country lookup and search endpoints

GET
/
List all countries
listCountries 6 params → 200400401403500
GET
/{aggregate}
Search within a named property aggregate
searchByAggregate 7 params → 200400401403404500
GET
/{property}/{value}
Exact-match lookup by property value
lookupByProperty 7 params → 200400401403404500
GET
/{property}
Substring search within a single property
searchByProperty 7 params → 200400401403404500

Schemas 22

The contract defines 22 schemas that model the data the API accepts and returns. The most detailed are Country (29 properties), Memberships (14 properties), Capital (8 properties), Classification (7 properties). Each schema is shown below with its type and property counts.

CountryArea
object
Land area of the country
2 properties
Country
object
Comprehensive country data record
29 properties
NumberFormat
object
Country-specific number formatting conventions
2 properties
Currency
object
Currency used in the country
2 properties
Memberships
object
International organization memberships
14 properties
PostalCode
object
Postal code format information
2 properties
Meta
object
Pagination metadata
6 properties
CountryCodes
object
Standardized country identifier codes
7 properties
Language
object
Language spoken in the country
3 properties
DateInfo
object
Country-specific date and calendar conventions
3 properties
Flag
object
Flag representation in various formats
6 properties
CountryNames
object
Country name data in various forms and languages
5 properties
Capital
object
Capital city information
8 properties
Error
object
API error response
1 property
Economy
object
Economic data for the country
1 property
Classification
object
Political and international classification of the country
7 properties
CountriesListEnvelope
object
1 property
CountriesListData
object
2 properties
Links
object
External reference links for the country
4 properties
Cars
object
Automobile-related country information
2 properties
Parent
object
Sovereign parent country for dependencies
2 properties
CountryCoordinates
object
Geographic center coordinates
2 properties

Specification

The full machine-readable OpenAPI contract behind this narrative.

Source

restcountries-countries-api-openapi.yml Raw ↑