GeographQL API
Overview
GeographQL is a free GraphQL API that provides structured data about countries, states, and cities worldwide. Because it uses GraphQL, you can request exactly the fields you need in a single query, avoiding over-fetching. No authentication is required, making it a great starting point for location-aware apps.
Beginner Tip
Use the GraphQL playground at the API endpoint to explore the schema and test queries before adding them to your code — it shows all available fields interactively.
Available Data
Example Response
{
"name": "Japan",
"capital": "Tokyo",
"population": 125800000,
"region": "Asia",
"languages": [
"Japanese"
],
"flag": "https://flagcdn.com/jp.svg",
"currencies": [
{
"code": "JPY",
"name": "Japanese yen"
}
]
} Field Reference
data.countries List of country objects matching the query. data.countries[].name Official name of the country. data.countries[].capital Capital city of the country. data.countries[].states List of states or provinces within the country (if requested). data.countries[].states[].cities List of cities within the state (if requested in the query). Implementation Example
const url = "https://geographql.netlify.app/";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data); What Can You Build?
Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.
Common Errors & Troubleshooting
Matrix Score Breakdown
Fully tested on Apr 5, 2026
Technical Specifications
Related Tags
Similar APIs
View All →administrative-divisons-db
⭐ Beginner's PickThe Administrative Divisions DB API provides a structured list of all administrative divisions (states, provinces, regions, cities) for countries around the world.
adresse.data.gouv.fr
⚠ Unavailableadresse.data.gouv.fr provides programmatic access to address database of france, geocoding and reverse via REST API.
Airtel IP
⭐ Beginner's PickAirtel IP is a free, no-auth IP geolocation API that aggregates data from multiple sources to return the country associated with any given IP address.
bng2latlong
⭐ Beginner's Pickbng2latlong is a simple, free API that converts British National Grid (OSGB36) easting and northing coordinates into standard WGS84 latitude and longitude.
Cartes.io
⭐ Beginner's PickCartes.io is a free API that lets you create maps and add custom markers without signing up.