Get information about countries via a RESTful API
Current version: v3.1 — v4 in preview
all endpoint, otherwise you'll get a bad request response. See this issue for more information.
# Get all countries (filtered by fields)
https://restcountries.com/v3.1/all?fields=name,capital,currencies
# Get country by name
https://restcountries.com/v3.1/name/peru
# Get country by code
https://restcountries.com/v3.1/alpha/co
# Filter response fields
https://restcountries.com/v3.1/{service}?fields={field},{field},{field}
Check the FIELDS.md file for a description of each field.
/v3.1/all?fields=name,flags
/v3.1/name/{name}
/v3.1/name/{name}?fullText=true
/v3.1/alpha/{code}
/v3.1/alpha?codes={code},{code}
/v3.1/currency/{currency}
/v3.1/lang/{language}
/v3.1/capital/{capital}
/v3.1/region/{region}
/v3.1/subregion/{subregion}
/v3.1/demonym/{demonym}
/v3.1/translation/{translation}
/v3.1/independent?status=true
/v3.1/{service}?fields={field},{field}
Any help is always welcome! Just edit the relevant file and create a new Merge Request or you can also donate using Patreon or PayPal.