PHPackages                             mrferrys/librestcountries - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mrferrys/librestcountries

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mrferrys/librestcountries
=========================

Library for getting countries info from restcountries.com

1.0.1(4y ago)45MiTPHPPHP &gt;=5.0.0

Since Jan 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/MrFerrys/librestcountries)[ Packagist](https://packagist.org/packages/mrferrys/librestcountries)[ RSS](/packages/mrferrys-librestcountries/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

librestcountries
================

[](#librestcountries)

Library for getting countries info from restcountries.com

Description
-----------

[](#description)

Library for getting countries info from restcountries.com

Getting Started
---------------

[](#getting-started)

### Dependencies

[](#dependencies)

- PHP &gt;= 5

### Installation

[](#installation)

composer require mrferrys/librestcountries

### Usage

[](#usage)

- How to list all countries.

```
	use librestcountries\restCountriesClient as rcClient;

	$restClient 			= 	new rcClient();
	$restClient->urlBase	=	"https://restcountries.com/v3.1/";
	$result					=	$restClient->listAll();
	foreach($result as $key=>$value)
	{
		$name=$value->name->common;
		echo ".- $name ".PHP_EOL;
	}

```

- How to filter by property.Filter fields (name,full\_name,code,list\_of\_codes,currency,lang,capital,region,subregion).

```
	$field	=	"name";
	$value	=	"spain";
	$result	=	$restClient->filterBy($field,$value);
	foreach($result as $key=>$value)
	{
		$name=$value->name->common;
		$official=$value->name->official;
		echo ".- $name/$official ".PHP_EOL;
	}

```

Authors
-------

[](#authors)

MrFerrys

Version History
---------------

[](#version-history)

- 1.0.0
    - Initial Release (X.Y.Z MAJOR.MINOR.PATCH)

License
-------

[](#license)

This project is licensed under the MiT License - see the LICENSE file for details

Acknowledgments
---------------

[](#acknowledgments)

REST Countries API:

- [restcountries.com](https://restcountries.com/)

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

1616d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/866868?v=4)[MrFerrys](/maintainers/MrFerrys)[@MrFerrys](https://github.com/MrFerrys)

---

Top Contributors

[![MrFerrys](https://avatars.githubusercontent.com/u/866868?v=4)](https://github.com/MrFerrys "MrFerrys (3 commits)")

### Embed Badge

![Health badge](/badges/mrferrys-librestcountries/health.svg)

```
[![Health](https://phpackages.com/badges/mrferrys-librestcountries/health.svg)](https://phpackages.com/packages/mrferrys-librestcountries)
```

###  Alternatives

[myparcelnl/magento

A Magento 2 module that creates MyParcel labels

1860.2k](/packages/myparcelnl-magento)

PHPackages © 2026

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