PHPackages                             annexare/countries-list - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. annexare/countries-list

ActiveLibrary[Database &amp; ORM](/categories/database)

annexare/countries-list
=======================

Continents &amp; countries: ISO 3166-1 alpha-2 code, name, ISO 639-1 languages, capital, currency, native name, phone. JSON, CSV and SQL.

3.3.0(2mo ago)1.3k220.8k—9.2%427[6 issues](https://github.com/annexare/Countries/issues)[1 PRs](https://github.com/annexare/Countries/pulls)1MITTypeScriptCI passing

Since Jan 9Pushed 2mo ago17 watchersCompare

[ Source](https://github.com/annexare/Countries)[ Packagist](https://packagist.org/packages/annexare/countries-list)[ Docs](http://annexare.github.io/Countries/)[ RSS](/packages/annexare-countries-list/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)DependenciesVersions (41)Used By (1)

Countries, Languages &amp; Continents data
==========================================

[](#countries-languages--continents-data)

[![Monthly Downloads](https://camo.githubusercontent.com/e35a3bdfb2f29d5e3832a1ae1e8c8bdfdd5d5d8b9eafeaa69cda116eecdbc520/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f646d2f636f756e74726965732d6c6973742e737667)](https://www.npmjs.com/package/countries-list)[![NPM](https://camo.githubusercontent.com/eea18e9165b6405d45303061f0c0e262827516e23256ee29bbac3572a504252b/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f636f756e74726965732d6c6973742e737667 "NPM package version")](https://www.npmjs.com/package/countries-list)[![Packagist](https://camo.githubusercontent.com/b16750b1fdba68b638f021052f40a7bb25dc88f55ce22590019a9c5702ced216/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616e6e65786172652f636f756e74726965732d6c6973742e737667 "Packagist version")](https://packagist.org/packages/annexare/countries-list)[![CI: JS](https://github.com/annexare/Countries/workflows/Countries%20JS/badge.svg "CI: JS")](https://github.com/annexare/Countries/actions)[![CI: PHP](https://github.com/annexare/Countries/workflows/Countries%20PHP/badge.svg "CI: PHP")](https://github.com/annexare/Countries/actions)[![Twitter](https://camo.githubusercontent.com/1824c9a509a2b2f3da58f5dfca31de4697d46a93de49157102e3fccf12403859/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f616e6e65786172652e7376673f6c6162656c3d666f6c6c6f772b40616e6e6578617265)](https://twitter.com/annexare)

Continents &amp; countries: **ISO 3166-1 alpha-2** code (with **alpha-2** to **alpha-3** set), name, **ISO 639-1** languages, capital and **ISO 4217** currency codes, native name, calling codes. Lists are available in JSON, CSV and SQL formats. Also, contains separate JSON files with additional country **Emoji** flags data.

Version 3.0: Breaking changes
-----------------------------

[](#version-30-breaking-changes)

Version 3 comes with some data structure changes. It was completely reworked under the hood with **TypeScript**, **ESM** exports and **Turborepo** file structure.

Everything is strongly typed so you can easily use data with auto-complete in your IDE.

**Note**: If your projects depend on the old structure, carefully specify required versions in your dependencies.

Installation
------------

[](#installation)

Package is available via:

- **Bun** `bun add countries-list`
- **NPM** `npm install countries-list`
- **Composer / Packagist** `composer require annexare/countries-list`

Usage (version 3.x)
-------------------

[](#usage-version-3x)

Module exports `continents`, `countries`, `languages` and utility functions.

```
// Interfaces and types
import type {
  ICountry,
  ICountryData,
  ILanguage,
  TContinentCode,
  TCountryCode,
  TLanguageCode,
} from 'countries-list'

// Main data and utils
import { continents, countries, languages } from 'countries-list'
// Utils
import { getCountryCode, getCountryData, getCountryDataList, getEmojiFlag } from 'countries-list'

// Minimal data in JSON
import countries2to3 from 'countries-list/minimal/countries.2to3.min.json'
import countries3to2 from 'countries-list/minimal/countries.3to2.min.json'
import languageNames from 'countries-list/minimal/languages.native.min'

getCountryCode('Ukraine') // 'UA'
getCountryCode('Україна') // 'UA'
getCountryData('UA') // ICountryData
```

Built files are in the `dist` directory of this repository, and `packages/countries` directory contains source data.

**Note**: JS build contains ES modules, CommonJS and IIFE (for now)

- CJS `cjs/index.js`
- ESM `mjs/index.js`
- IIFE `index.iife.js`

Data structure examples
-----------------------

[](#data-structure-examples)

```
const continents = {
  AF: 'Africa',
  AN: 'Antarctica',
  AS: 'Asia',
  EU: 'Europe',
  NA: 'North America',
  OC: 'Oceania',
  SA: 'South America',
}

const countries = {
  // ...
  UA: {
    name: 'Ukraine',
    native: 'Україна',
    phone: [380],
    continent: 'EU',
    capital: 'Kyiv',
    currency: ['UAH'],
    languages: ['uk'],
  },
  // ...
}

const languages = {
  // ...
  uk: {
    name: 'Ukrainian',
    native: 'Українська',
  },
  ur: {
    name: 'Urdu',
    native: 'اردو',
    rtl: 1,
  },
  // ...
}
```

Contributing to this repository
-------------------------------

[](#contributing-to-this-repository)

Everything is generated from strongly typed files in `packages/countries/src`, including SQL file.

Everything in `dist` is generated, so please make data related changes **ONLY** to files from `packages/countries`, commit them. Use `bun run build` (or `turbo build`, `turbo test`) command to build/test generated files.

Credits
-------

[](#credits)

Prepared by [Annexare Studio](https://annexare.com/) from different public sources. Feel free to use it as you need in your apps or send updates into [this](https://github.com/annexare/Countries) public repository. It's under MIT license.

###  Health Score

68

—

FairBetter than 100% of packages

Maintenance86

Actively maintained with recent releases

Popularity62

Solid adoption and visibility

Community33

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 71.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~100 days

Recently: every ~145 days

Total

38

Last Release

75d ago

Major Versions

1.4.1 → 2.0.02017-07-16

2.6.1 → 3.0.02023-09-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/23a8ec170cc405ea55453eb65cfe5dee58f506ca0161602a7b0c6c6fe3cbff7a?d=identicon)[dmythro](/maintainers/dmythro)

---

Top Contributors

[![dmythro](https://avatars.githubusercontent.com/u/1391015?v=4)](https://github.com/dmythro "dmythro (161 commits)")[![Z-AX](https://avatars.githubusercontent.com/u/130520464?v=4)](https://github.com/Z-AX "Z-AX (39 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (8 commits)")[![cperez87](https://avatars.githubusercontent.com/u/5105145?v=4)](https://github.com/cperez87 "cperez87 (5 commits)")[![BitOfGold](https://avatars.githubusercontent.com/u/7027091?v=4)](https://github.com/BitOfGold "BitOfGold (2 commits)")[![Mukhammadali](https://avatars.githubusercontent.com/u/22298895?v=4)](https://github.com/Mukhammadali "Mukhammadali (2 commits)")[![oliviertassinari](https://avatars.githubusercontent.com/u/3165635?v=4)](https://github.com/oliviertassinari "oliviertassinari (1 commits)")[![orkhan](https://avatars.githubusercontent.com/u/1258485?v=4)](https://github.com/orkhan "orkhan (1 commits)")[![vsulak](https://avatars.githubusercontent.com/u/6022594?v=4)](https://github.com/vsulak "vsulak (1 commits)")[![joakim](https://avatars.githubusercontent.com/u/34790?v=4)](https://github.com/joakim "joakim (1 commits)")[![erikdju](https://avatars.githubusercontent.com/u/1689799?v=4)](https://github.com/erikdju "erikdju (1 commits)")[![hmelenok](https://avatars.githubusercontent.com/u/2149114?v=4)](https://github.com/hmelenok "hmelenok (1 commits)")[![aetonsi](https://avatars.githubusercontent.com/u/18366087?v=4)](https://github.com/aetonsi "aetonsi (1 commits)")[![kudlav](https://avatars.githubusercontent.com/u/11516259?v=4)](https://github.com/kudlav "kudlav (1 commits)")[![michaeljamie](https://avatars.githubusercontent.com/u/26236137?v=4)](https://github.com/michaeljamie "michaeljamie (1 commits)")

---

Tags

calling-codescapitalcjscontinentcountriescountry-codescsvcurrenciesemojiesmiso3166iso3166-1iso639iso639-1jsonlanguage-codeslocalessqltypescripttypingsjsoncurrencylanguagesdatasqlcountriescsvcountryemojicontinentISO 3166-1capitalISO 639-1

### Embed Badge

![Health badge](/badges/annexare-countries-list/health.svg)

```
[![Health](https://phpackages.com/badges/annexare-countries-list/health.svg)](https://phpackages.com/packages/annexare-countries-list)
```

###  Alternatives

[rinvex/countries

Rinvex Countries is a simple and lightweight package for retrieving country details with flexibility. A whole bunch of data including name, demonym, capital, iso codes, dialling codes, geo data, currencies, flags, emoji, and other attributes for all 250 countries worldwide at your fingertips.

1.7k7.4M48](/packages/rinvex-countries)[ddeboer/data-import

Import data from, and export data to, a range of file formats and media

5604.3M9](/packages/ddeboer-data-import)[stefangabos/world_countries

Constantly updated lists of world countries, territories and areas of geographical interest, with associated alpha-2, alpha-3 and numeric codes as defined by the ISO 3166-1 standard, available in multiple formats and languages, with national flags included

1.6k122.7k1](/packages/stefangabos-world-countries)[portphp/portphp

Data import/export workflow

2702.9M22](/packages/portphp-portphp)[aternus/geonames-client

GeoNames API Client

39215.5k2](/packages/aternus-geonames-client)[archon/dataframe

Archon: PHP Data Analysis Library

9824.2k1](/packages/archon-dataframe)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
