countries
countries copied to clipboard
π Public GraphQL API for information about countries
Countries GraphQL API
A public GraphQL API for information about countries, continents, and languages. This project uses Countries List and provinces
as data sources, so the schema follows the shape of that data, with a few exceptions:
- The codes used to key the objects in the original data are available as a
code
property on each item returned from the API. - The
country.continent
andcountry.languages
are now objects and arrays of objects, respectively. - Each
Country
has an array ofstates
populated by their states/provinces, if any.
Writing queries
{
country(code: "BR") {
name
native
capital
emoji
currency
languages {
code
name
}
}
}
The above GraphQL query will produce the following JSON response:
{
"data": {
"country": {
"name": "Brazil",
"native": "Brasil",
"capital": "BrasΓlia",
"emoji": "π§π·",
"currency": "BRL",
"languages": [
{
"code": "pt",
"name": "Portuguese"
}
]
}
}
}
Docs
Read about all of the fields available and view example queries in the docs. You can also check out the playground to explore the schema and test out some queries.
Examples
- React
- React Native
- ReasonML
- Country quiz app (React, TypeScript)
- Python
- Seed
- Country Searcher
License
MIT