PHPackages                             datingvip/php-rest-countries - 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. [API Development](/categories/api)
4. /
5. datingvip/php-rest-countries

AbandonedArchivedLibrary[API Development](/categories/api)

datingvip/php-rest-countries
============================

PHP API client for RestCountries.EU

v1.1.1(2y ago)06.0k↓46.4%MITPHPPHP ^7.3|^8

Since Jul 6Pushed 2y agoCompare

[ Source](https://github.com/DatingVIP/php-rest-countries)[ Packagist](https://packagist.org/packages/datingvip/php-rest-countries)[ RSS](/packages/datingvip-php-rest-countries/feed)WikiDiscussions develop Synced yesterday

READMEChangelog (2)Dependencies (3)Versions (5)Used By (0)

PHP RestCountries
=================

[](#php-restcountries)

> Get information about countries via a RESTful API

System requirements
-------------------

[](#system-requirements)

- **PHP &gt;= 7.3**

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

[](#installation)

Using Composer

- `composer require datingvip/php-rest-countries`

or you can include the following in your `composer.json`

- `"datingvip/php-rest-countries": "^1.0.0"`

Usage instructions
------------------

[](#usage-instructions)

First, create new `RestCountries` instance to make configuring the library for use:

```
use NNV\RestCountries;

$restCountries = new RestCountries;
```

Once the `RestCountries` instance has been registered. You may use it like so:

### [All](https://restcountries.eu/#api-endpoints-all)

[](#all)

```
$restCountries->all();
```

### [Name](https://restcountries.eu/#api-endpoints-name)

[](#name)

> Search by country name. It can be the native name or partial name or full name

```
$restCountries->byName("viet");

// or with full name
$restCountries->byName("vietnam", true);
```

### [Code(s)](https://restcountries.eu/#api-endpoints-code)

[](#codes)

> Search by ISO 3166-1 2-letter or 3-letter country code(s)

```
// Single country code
$restCountries->byCodes("vn");

// Multiple country codes
$restCountries->byCodes(["vn", "cn", "th"]);
```

### [Currency](https://restcountries.eu/#api-endpoints-currency)

[](#currency)

> Search by ISO 4217 currency code

```
$restCountries->byCurrency("vnd");
```

### [Language](https://restcountries.eu/#api-endpoints-language)

[](#language)

> Search by ISO 639-1 language code.

```
$restCountries->byLanguage("vi");
```

### [Capital city](https://restcountries.eu/#api-endpoints-capital-city)

[](#capital-city)

> Search by capital city

```
$restCountries->byCapitalCity("hanoi");
```

### [Calling code](https://restcountries.eu/#api-endpoints-calling-code)

[](#calling-code)

> Search by calling code

```
$restCountries->byCallingCode("84");
```

### [Region](https://restcountries.eu/#api-endpoints-region)

[](#region)

> Search by region: Africa, Americas, Asia, Europe, Oceania

```
$restCountries->byRegion("asia");
```

### [Regional bloc](https://restcountries.eu/#api-endpoints-regional-bloc)

[](#regional-bloc)

> Search by regional bloc:
>
> - EU (European Union)
> - EFTA (European Free Trade Association)
> - CARICOM (Caribbean Community)
> - PA (Pacific Alliance)
> - AU (African Union)
> - USAN (Union of South American Nations)
> - EEU (Eurasian Economic Union)
> - AL (Arab League)
> - ASEAN (Association of Southeast Asian Nations)
> - CAIS (Central American Integration System)
> - CEFTA (Central European Free Trade Agreement)
> - NAFTA (North American Free Trade Agreement)
> - SAARC (South Asian Association for Regional Cooperation)

```
$restCountries->byRegionalBloc("asean");
```

### Filter response

[](#filter-response)

> You can filter the output of your request to include only the specified fields.

```
// You can use `fields([])` with any available methods

$restCountries->fields(["name", "callingCodes", "capital"])->all();

$restCountries->fields(["name"])->byName("vietnam", true);

$restCountries->fields(["callingCodes"])->byRegionalBloc("asean");
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 70% 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 ~1131 days

Total

3

Last Release

1023d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.5

v1.1.0PHP ^7.3|^8

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/725986?v=4)[Boris Momčilović](/maintainers/kornrunner)[@kornrunner](https://github.com/kornrunner)

---

Top Contributors

[![namnv609](https://avatars.githubusercontent.com/u/8691772?v=4)](https://github.com/namnv609 "namnv609 (7 commits)")[![kornrunner](https://avatars.githubusercontent.com/u/725986?v=4)](https://github.com/kornrunner "kornrunner (3 commits)")

---

Tags

countriesRESTful APIrest countriesrestcountries.com

### Embed Badge

![Health badge](/badges/datingvip-php-rest-countries/health.svg)

```
[![Health](https://phpackages.com/badges/datingvip-php-rest-countries/health.svg)](https://phpackages.com/packages/datingvip-php-rest-countries)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.5M7](/packages/avalara-avataxclient)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)[aimeos/prisma

A powerful PHP package for integrating media related Large Language Models (LLMs) into your applications

1943.1k5](/packages/aimeos-prisma)

PHPackages © 2026

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