🌍 Geo-Data API

Generate a static JSON API for geographic data including countries, states, and cities that can be hosted on any CDN

Transform geographic datasets into a small, cacheable, CDN-ready API with search capabilities

v1.0.0 MIT License CDN Ready

195+

Countries

5000+

States/Provinces

100K+

Cities

🏷️ Keywords & Tags

api json psql state states cities region country regions countries generator hacktoberfest world-regions geographical-data country-state-city countries-states-cities

🚀 Quick Start

Get started with our API in seconds:

// Get all countries
fetch('/api/v1/countries.json')
  .then(response => response.json())
  .then(data => console.log(data));

// Get country by ISO2
fetch('/api/v1/countries/us.json')
  .then(response => response.json())
  .then(data => console.log(data));

📡 API Endpoints

Countries
  • GET /api/v1/countries.json - All countries
  • GET /api/v1/countries/{iso2}.json - Single country
States
  • GET /api/v1/states/{iso3166_2}.json - Single state
  • GET /api/v1/states/country/{iso2}.json - States by country
Cities
  • GET /api/v1/cities/batch/{batchId}.json - Cities in batches
  • GET /api/v1/cities/country/{iso2}.json - Cities by country
  • GET /api/v1/cities/state/{iso3166_2}.json - Cities by state

🔧 Built With

Runtime

Node.js

Dependencies
  • fs-extra: ^11.3.1
  • lodash: ^4.17.21
Dev Dependencies
  • prettier: ^3.6.2