v2.0.14

World location data,
beautifully structured.

250+ countries, 5,000+ states, 150,000+ cities. All with coordinates, ISO codes, and metadata — in JSON, CSV, XML, or YAML.

npm install @tansuasici/country-state-city

0

Countries

0

States

0

Cities

Capabilities

Built for developers

Everything you need to work with location data, from quick lookups to bulk exports.

Multiple Formats

Export as JSON, CSV, XML, or YAML with a single method call.

ISO 3166-1 Compliant

Country codes, subdivisions, and metadata that enterprise apps trust.

Global Coverage

250+ countries with coordinates, timezones, currencies, and translations.

TypeScript Native

Full type definitions, tree-shakeable, works in Node.js and browsers.

MCP Integration

New

Connect directly to Claude Desktop and other MCP-compatible AI assistants. Query countries, states, and cities through natural language.

Learn More

Quick Start

Up and running in seconds

Terminal
$ npm install @tansuasici/country-state-city
app.ts
import { CountryStateCity }
  from '@tansuasici/country-state-city';

const countries = CountryStateCity
  .getAllCountries();
const states = CountryStateCity
  .getStatesByCountryId(225);