Ecosystem

One dataset.
Nine ways to use it.

Every channel is built from the same open database, with the same IDs. Start with one, switch or combine later without remapping anything.

REST APITiered, high-availability
GET /v1/countries
Packages

Install it the way you work.

Versioned packages with types included. Offline data packages use ODbL-1.0; the npm API SDK and CLI use MIT. Check each package before use. Node snapshots need no network; countries-browser loads data from a CDN.

Node.js and browser · TypeScript types included
Live
@countrystatecity/sdkOfficial REST API clientnpm install @countrystatecity/sdk
Tool
@countrystatecity/cliSearch, explore, generate codenpm install -g @countrystatecity/cli
Offline
@countrystatecity/countriesCountries, states, cities · Nodenpm install @countrystatecity/countries
Offline
@countrystatecity/countries-browserSame API, loads via CDNnpm install @countrystatecity/countries-browser
Offline
@countrystatecity/timezonesIANA timezone datanpm install @countrystatecity/timezones
Offline
@countrystatecity/currenciesISO 4217 currency datanpm install @countrystatecity/currencies
Offline
@countrystatecity/translationsNames in 19 languagesnpm install @countrystatecity/translations
Offline
@countrystatecity/phonecodesCountry dial codesnpm install @countrystatecity/phonecodes
Offline
@countrystatecity/postalcodes844,000+ codes, 125 countriesnpm install @countrystatecity/postalcodes
Offline
@countrystatecity/geojsonPoint FeatureCollectionsnpm install @countrystatecity/geojson
Offline or live

Prototype offline. Go live when you ship.

Packages are frozen snapshots, perfect for dev, tests and dropdowns. Switch to the API for fresh data, fuzzy search and support. IDs link the records; snapshot contents vary by release.

Offline packageno key · no network
import { getStatesOfCountry, getCitiesOfState }
  from '@countrystatecity/countries';

const states = await getStatesOfCountry('IN');
const cities = await getCitiesOfState('IN', 'MH');
Live API client3,000 free requests / mo
import { createCSCClient } from '@countrystatecity/sdk';

const csc = createCSCClient({ apiKey: process.env.CSC_API_KEY });
const { data: states } = await csc.states.list({ country: 'IN' });
const hits = await csc.search.fuzzy({ query: 'bangalor', type: 'city' });

Not sure where to start?

Most teams start with the API: 3,000 free requests a month, no card needed.