# dr5hn/countries-states-cities-database

🌍 Discover our global repository of countries, states, and cities!  🏙️ Get comprehensive data in JSON, SQL, PSQL, SQLSERVER, MONGODB, SQLITE, XML, YAML, and CSV formats. Access ISO2, ISO3 codes, country code, capital, native language, timezones (for countries), and more. #countries #states #cities

Repository: https://github.com/dr5hn/countries-states-cities-database
Canonical: https://ross.abutalabs.com/products/countries-states-cities-database
Homepage: http://countrystatecity.in/
Language: Python
License: ODbL-1.0
License Family: other
Topics: cities, countries, states, state, country, regions, geographical-data, psql, world, csv
Last push: 2026-08-26T11:16:55+00:00

## Health v2 (maintenance only)
Score: 98/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 95, longevity 100
- inputs: {"age_days": 2966, "days_push": 7, "days_rel": 35, "gap_med": 22.0, "n_releases_24m": 17}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 9796, forks 3024 (observed 2026-08-28T04:10:37.168603+00:00)

## What it is
A community-maintained open dataset of world countries, states, cities, and postcodes with ISO codes, coordinates, timezones, currencies, and phone codes, published in 12 formats (JSON, SQL, CSV, XML, YAML, etc.). It also backs a hosted REST API and npm/PyPI packages for querying the data.

## Use cases
- populate a country/state/city dropdown in a signup form
- get ISO 3166 codes and phone dial codes for all countries
- look up timezones for cities with IANA coverage
- import world geography data into MySQL, PostgreSQL, MongoDB, or SQLite
- build a location-aware shipping or address form
- find postcodes for 125 countries
- query states and cities via a REST API from any language

## When to choose
- you need comprehensive offline geographic reference data in multiple database/file formats
- you want a free ODbL-licensed dataset with regular updates and attribution
- you need ISO codes, coordinates, timezones, and currencies bundled together
- you want npm or PyPI packages for direct integration

## When to avoid
- you need detailed street-level or building-level geocoding rather than administrative regions
- you need frequently changing demographic data like exact populations
- your project cannot comply with ODbL attribution requirements
- you need routing or map tile data rather than reference lists

## Facets
- artifact type: dataset
- maturity: active
- function: data-science, geospatial, csv, yaml, database
- domain: data-science, apis, web-development
- platform: cross-platform, python, self-hosted
- tags: countries, states, cities, postcodes, timezones, iso-codes, geographical-data, odbl, rest-api, sql-exports, maps, localization, nodejs, web-server

## Member repositories
- dr5hn/countries-states-cities-database (main) score 98

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:37.168603+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:21:00.469703+00:00, confidence not recorded.
  - readme: https://github.com/dr5hn/countries-states-cities-database (fetched 2026-08-28T04:10:37.168603+00:00, sha 6b8c23266c6f)
  - homepage: http://countrystatecity.in/ (fetched 2026-08-29T08:20:48.250939+00:00, sha 6a7ebc963fb4)
  - site_page: https://countrystatecity.in/about (fetched 2026-08-29T08:20:48.261611+00:00, sha 1bf1271d732e)
  - site_page: https://docs.countrystatecity.in/ (fetched 2026-08-29T08:20:48.265386+00:00, sha d336ca2505cc)
  - site_page: https://countrystatecity.in/pricing (fetched 2026-08-29T08:20:48.263607+00:00, sha cd71b08d415b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
