PHPackages                             felipeva/api-colombia-php - 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. felipeva/api-colombia-php

ActiveLibrary[API Development](/categories/api)

felipeva/api-colombia-php
=========================

The Api Colombia PHP Client.

1.0.5(2y ago)310[1 PRs](https://github.com/FelipeVa/api-colombia-php/pulls)MITPHPPHP ^8.2.0

Since May 19Pushed 2y ago1 watchersCompare

[ Source](https://github.com/FelipeVa/api-colombia-php)[ Packagist](https://packagist.org/packages/felipeva/api-colombia-php)[ RSS](/packages/felipeva-api-colombia-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (7)Versions (8)Used By (0)

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();

// Get all departments
$departments = $client->departments()->all();

foreach ($departments as $department) {
    echo $department->name;
}
```

---

***Api Colombia PHP*** is a PHP API client that lets you easily interact with the [Api Colombia](https://github.com/Mteheran/api-colombia).

Table of Contents
-----------------

[](#table-of-contents)

- [Getting started](#getting-started)
    - [Installation](#installation)
- [Usage](#usage)
    - [Country Resource](#country-resource)
    - [Region Resource](#region-resource)
    - [Department Resource](#department-resource)
    - [City Resource](#city-resource)
    - [President Resource](#president-resource)
    - [Tourist Attraction Resource](#tourist-attraction-resource)
    - [Category Natural Area Resource](#category-natural-area-resource)
    - [Natural Area Resource](#natural-area-resource)
    - [Map Resource](#map-resource)

Getting started
---------------

[](#getting-started)

> **Requires [PHP 8.2+](https://php.net/releases/)**

### Installation

[](#installation)

First, install the package via the [Composer](https://getcomposer.org/) package manager:

```
composer require felipeva/api-colombia-php
```

Then, you're ready to start using the package:

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();

// Get all cities
$cities = $client->cities()->all();

foreach ($cities as $city) {
    echo $city->name;
}

// Get all departments
$departments = $client->departments()->all();

foreach ($departments as $department) {
    echo $department->name;
}
```

Usage
-----

[](#usage)

### Country Resource

[](#country-resource)

#### `get`

[](#get)

Retrieves general information about Colombia.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$country = $client->countries()->get('Colombia');

// Returns a Country object
$country->name; // Colombia
$country->surface;
$country->population;
$country->languages;
// ...
```

### Region Resource

[](#region-resource)

#### `all`

[](#all)

Retrieves all regions in Colombia.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$regions = $client->regions()->all();

// Returns a Listed object of Region objects
foreach ($regions->data as $region) {
    $region->id;
    $region->name;
    $region->description;
    $region->departments; // Array of Department objects
    // ...
}
```

#### `get`

[](#get-1)

Retrieves a region by its id.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$region = $client->regions()->get(1);

// Returns a Region object
$region->id;
$region->name;
$region->description;
$region->departments; // Array of Department objects
```

#### `departments`

[](#departments)

Retrieves all departments in a region.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$regionDepartments = $client->regions()->departments(1);

// Returns a Listed object of Department objects
foreach ($regionDepartments->data as $department) {
    $department->id;
    $department->name;
    $department->description;
    $department->cities; // Array of City objects
    // ...
}
```

### Department Resource

[](#department-resource)

#### `all`

[](#all-1)

Retrieves all departments in Colombia.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$departments = $client->departments()->all();

// Returns a Listed object of Department objects
foreach ($departments->data as $department) {
    $department->id;
    $department->name;
    $department->description;
    $department->cities; // Array of City objects
    // ...
}
```

#### `get`

[](#get-2)

Retrieves a department by its id.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$department = $client->departments()->get(1);

// Returns a Department object
$department->id;
$department->name;
$department->description;
$department->cities; // Array of City objects
```

#### `cities`

[](#cities)

Retrieves all cities in a department.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$departmentCities = $client->departments()->cities(1);

// Returns a Listed object of City objects
foreach ($departmentCities->data as $city) {
    $city->id;
    $city->name;
    $city->description;
    $city->population;
    $city->surface;
    $city->department; // Department object
    // ...
}
```

#### `naturalAreas`

[](#naturalareas)

Retrieves all natural areas in a department.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$departmentNaturalAreas = $client->departments()->naturalAreas(1);

// Returns a Listed object of NaturalArea objects
foreach ($departmentNaturalAreas->data as $naturalArea) {
    $naturalArea->id;
    $naturalArea->name;
    $naturalArea->department; // Department object
    // ...
}
```

#### `touristAttractions`

[](#touristattractions)

Retrieves all tourist attractions in a department.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$departmentTouristAttractions = $client->departments()->touristAttractions(1);

// Returns a Listed object of TouristAttraction objects
foreach ($departmentTouristAttractions->data as $touristAttraction) {
    $touristAttraction->id;
    $touristAttraction->name;
    $touristAttraction->description;
    $touristAttraction->city; // City object
    // ...
}
```

#### `getByName`

[](#getbyname)

Retrieves a department by its name.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$department = $client->departments()->getByName('Antioquia');

// Returns a Listed object of Department objects
foreach ($department->data as $department) {
    $department->id;
    $department->name;
    $department->description;
    $department->cities; // Array of City objects
    // ...
}
```

#### `search`

[](#search)

Searches for departments by the following fields: Name, Description, PhonePrefix.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$departments = $client->departments()->search('Antioquia');

// Returns a Listed object of Department objects
foreach ($departments->data as $department) {
    $department->id;
    $department->name;
    $department->description;
    $department->cities; // Array of City objects
    // ...
}
```

#### `paged`

[](#paged)

Retrieves a paged list of departments.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$departments = $client->departments()->paged(page: 1, pageSize: 10);

$departments->page; // 1
$departments->pageSize; // 10
$departments->totalRecords; // number of records

// Returns a Paged object of Department objects
foreach ($departments->data as $department) {
    $department->id;
    $department->name;
    $department->description;
    // ...
}
```

### City Resource

[](#city-resource)

#### `all`

[](#all-2)

Retrieves all cities in Colombia.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$cities = $client->cities()->all();

// Returns a Listed object of City objects
foreach ($cities->data as $city) {
    $city->id;
    $city->name;
    $city->description;
    $city->population;
    $city->surface;
    $city->department; // Department object
    // ...
}
```

#### `get`

[](#get-3)

Retrieves a city by its id.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$city = $client->cities()->get(1);

// Returns a City object
$city->id;
$city->name;
$city->description;
$city->population;
$city->surface;
// ...
```

#### `getByName`

[](#getbyname-1)

Retrieves a city by its name.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$city = $client->cities()->getByName('Medellín');

// Returns a Listed object of City objects
foreach ($city->data as $city) {
    $city->id;
    $city->name;
    $city->description;
    $city->population;
    $city->surface;
    // ...
}
```

#### `search`

[](#search-1)

Searches for cities by the following fields: Name, Description, PostalCode.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$cities = $client->cities()->search('Medellín');

// Returns a Listed object of City objects
foreach ($cities->data as $city) {
    $city->id;
    $city->name;
    $city->description;
    $city->population;
    $city->surface;
    // ...
}
```

#### `paged`

[](#paged-1)

Retrieves a paged list of cities.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$cities = $client->cities()->paged(page: 1, pageSize: 10);

$cities->page; // 1
$cities->pageSize; // 10
$cities->totalRecords; // number of records

// Returns a Paged object of City objects
foreach ($cities->data as $city) {
    $city->id;
    $city->name;
    $city->description;
    $city->population;
    $city->surface;
    // ...
}
```

### President Resource

[](#president-resource)

#### `all`

[](#all-3)

Retrieves all presidents in Colombia.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$presidents = $client->presidents()->all();

// Returns a Listed object of President objects
foreach ($presidents->data as $president) {
    $president->id;
    $president->name;
    $president->lastName;
    $president->description;
    // ...
}
```

#### `get`

[](#get-4)

Retrieves a president by its id.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$president = $client->presidents()->get(1);

// Returns a President object
$president->id;
$president->name;
$president->lastName;
$president->description;
// ...
```

#### `getByName`

[](#getbyname-2)

Retrieves a president by its name.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$president = $client->presidents()->getByName('Gustavo Petro');

// Returns a Listed object of President objects
foreach ($president->data as $president) {
    $president->id;
    $president->name;
    $president->lastName;
    $president->description;
    // ...
}
```

#### `getByYear`

[](#getbyyear)

Retrieves a president by its year.

To be implemented..

#### `search`

[](#search-2)

Searches for presidents by the following fields: Name, Description, PoliticalParty,LastName

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$presidents = $client->presidents()->search('Gustavo Petro');

// Returns a Listed object of President objects
foreach ($presidents->data as $president) {
    $president->id;
    $president->name;
    $president->lastName;
    $president->description;
    // ...
}
```

#### `paged`

[](#paged-2)

Retrieves a paged list of presidents.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$presidents = $client->presidents()->paged(page: 1, pageSize: 10);

$presidents->page; // 1
$presidents->pageSize; // 10
$presidents->totalRecords; // number of records

// Returns a Paged object of President objects
foreach ($presidents->data as $president) {
    $president->id;
    $president->name;
    $president->lastName;
    $president->description;
    // ...
}
```

### Tourist Attraction Resource

[](#tourist-attraction-resource)

#### `all`

[](#all-4)

Retrieves all touristic attractions in Colombia.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$touristicAttractions = $client->touristAttractions()->all();

// Returns a Listed object of TouristicAttraction objects
foreach ($touristicAttractions->data as $touristicAttraction) {
    $touristicAttraction->id;
    $touristicAttraction->name;
    $touristicAttraction->description;
    $touristicAttraction->city; // City object
    // ...
}
```

#### `get`

[](#get-5)

Retrieves a touristic attraction by its id.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$touristicAttraction = $client->touristAttractions()->get(1);

// Returns a TouristicAttraction object
$touristicAttraction->id;
$touristicAttraction->name;
$touristicAttraction->description;
$touristicAttraction->city; // City object
// ...
```

#### `getByName`

[](#getbyname-3)

Retrieves a touristic attraction by its name.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$touristicAttraction = $client->touristAttractions()->getByName('Catedral de Sal de Zipaquirá');

// Returns a Listed object of TouristicAttraction objects
foreach ($touristicAttraction->data as $touristicAttraction) {
    $touristicAttraction->id;
    $touristicAttraction->name;
    $touristicAttraction->description;
    $touristicAttraction->city; // City object
    // ...
}
```

#### `search`

[](#search-3)

Searches for touristic attractions by the following fields: Name, Description,LastName,Latitude, Longitude

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$touristicAttractions = $client->touristAttractions()->search('Catedral de Sal de Zipaquirá');

// Returns a Listed object of TouristicAttraction objects
foreach ($touristicAttractions->data as $touristicAttraction) {
    $touristicAttraction->id;
    $touristicAttraction->name;
    $touristicAttraction->description;
    $touristicAttraction->city; // City object
    // ...
}
```

#### `paged`

[](#paged-3)

Retrieves a paged list of touristic attractions.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$touristicAttractions = $client->touristAttractions()->paged(page: 1, pageSize: 10);

$touristicAttractions->page; // 1
$touristicAttractions->pageSize; // 10
$touristicAttractions->totalRecords; // number of records

// Returns a Paged object of TouristicAttraction objects
foreach ($touristicAttractions->data as $touristicAttraction) {
    $touristicAttraction->id;
    $touristicAttraction->name;
    $touristicAttraction->description;
    $touristicAttraction->city; // City object
    // ...
}
```

### Category Natural Area Resource

[](#category-natural-area-resource)

#### `all`

[](#all-5)

Retrieves all categories of natural areas in Colombia.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$categoriesNaturalArea = $client->categoryNaturalAreas()->all();

// Returns a Listed object of CategoryNaturalArea objects
foreach ($categoriesNaturalArea->data as $categoryNaturalArea) {
    $categoryNaturalArea->id;
    $categoryNaturalArea->name;
    $categoryNaturalArea->description;
    $categoryNaturalArea->naturalAreas; // array of NaturalArea objects
    // ...
}
```

#### `get`

[](#get-6)

Retrieves a category of natural areas by its id.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$categoryNaturalArea = $client->categoryNaturalAreas()->get(1);

// Returns a CategoryNaturalArea object
$categoryNaturalArea->id;
$categoryNaturalArea->name;
$categoryNaturalArea->description;
$categoryNaturalArea->naturalAreas; // array of NaturalArea objects
// ...
```

#### `naturalAreas`

[](#naturalareas-1)

Retrieves all natural areas of a category by its id.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$naturalAreas = $client->categoryNaturalAreas()->naturalAreas(1);

// Returns a Listed object of NaturalArea objects
foreach ($naturalAreas->data as $naturalArea) {
    $naturalArea->id;
    $naturalArea->name;
    $naturalArea->categoryNaturalArea; // CategoryNaturalArea object
    // ...
}
```

### Natural Area Resource

[](#natural-area-resource)

#### `all`

[](#all-6)

Retrieves all natural areas in Colombia.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$naturalAreas = $client->naturalAreas()->all();

// Returns a Listed object of NaturalArea objects
foreach ($naturalAreas->data as $naturalArea) {
    $naturalArea->id;
    $naturalArea->name;
    $naturalArea->categoryNaturalArea; // CategoryNaturalArea object
    // ...
}
```

#### `get`

[](#get-7)

Retrieves a natural area by its id.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$naturalArea = $client->naturalAreas()->get(1);

// Returns a NaturalArea object
$naturalArea->id;
$naturalArea->name;
$naturalArea->categoryNaturalArea; // CategoryNaturalArea object
// ...
```

#### `getByName`

[](#getbyname-4)

Retrieves a natural area by its name.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$naturalArea = $client->naturalAreas()->getByName('Parque Nacional Natural Tayrona');

// Returns a Listed object of NaturalArea objects
foreach ($naturalArea->data as $naturalArea) {
    $naturalArea->id;
    $naturalArea->name;
    $naturalArea->categoryNaturalArea; // CategoryNaturalArea object
    // ...
}
```

#### `search`

[](#search-4)

Searches for natural areas by the following fields: Name, Description,LastName,Latitude, Longitude

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$naturalAreas = $client->naturalAreas()->search('Parque Nacional Natural Tayrona');

// Returns a Listed object of NaturalArea objects
foreach ($naturalAreas->data as $naturalArea) {
    $naturalArea->id;
    $naturalArea->name;
    $naturalArea->categoryNaturalArea; // CategoryNaturalArea object
    // ...
}
```

#### `paged`

[](#paged-4)

Retrieves a paged list of natural areas.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$naturalAreas = $client->naturalAreas()->paged(page: 1, pageSize: 10);

$naturalAreas->page; // 1
$naturalAreas->pageSize; // 10
$naturalAreas->totalRecords; // number of records

// Returns a Paged object of NaturalArea objects
foreach ($naturalAreas->data as $naturalArea) {
    $naturalArea->id;
    $naturalArea->name;
    $naturalArea->categoryNaturalArea; // CategoryNaturalArea object
    // ...
}
```

### Map Resource

[](#map-resource)

#### `all`

[](#all-7)

Retrieves all maps in Colombia.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$maps = $client->maps()->all();

// Returns a Listed object of Map objects
foreach ($maps->data as $map) {
    $map->id;
    $map->name;
    $map->description;
    // ...
}
```

#### `get`

[](#get-8)

Retrieves a map by its id.

```
use FelipeVa\ApiColombia\ApiColombia;

$client = ApiColombia::client();
$map = $client->maps()->get(1);

// Returns a Map object
$map->id;
$map->name;
$map->description;
// ...
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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 ~2 days

Total

6

Last Release

1076d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/eb48edd4643293b357db8ab8aac77952602993e41798504827b8e75f48ebd6c8?d=identicon)[FelipeVa](/maintainers/FelipeVa)

---

Top Contributors

[![felipeva](https://avatars.githubusercontent.com/u/4754195?v=4)](https://github.com/felipeva "felipeva (44 commits)")

---

Tags

apicolombiaphpphpapiclientcolombiaapi-colombia

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/felipeva-api-colombia-php/health.svg)

```
[![Health](https://phpackages.com/badges/felipeva-api-colombia-php/health.svg)](https://phpackages.com/packages/felipeva-api-colombia-php)
```

###  Alternatives

[kunalvarma05/dropbox-php-sdk

Dropbox PHP API V2 SDK (Unofficial)

3633.0M18](/packages/kunalvarma05-dropbox-php-sdk)[mozex/anthropic-php

Anthropic PHP is a supercharged community-maintained PHP API client that allows you to interact with Anthropic API.

46365.1k13](/packages/mozex-anthropic-php)[google-gemini-php/symfony

Symfony Bundle for Gemini

149.4k1](/packages/google-gemini-php-symfony)[sima-land/api-php-client

Client library for Simaland APIs

311.5k](/packages/sima-land-api-php-client)

PHPackages © 2026

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