PHPackages                             yannickyayo/laravel-api-geo - 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. yannickyayo/laravel-api-geo

ActiveLibrary[API Development](/categories/api)

yannickyayo/laravel-api-geo
===========================

Wrapper Laravel pour communiquer avec l'API GEO du gouvernement français.

0.1.0(4y ago)02MITPHPPHP ^7.4

Since Jun 11Pushed 4y ago1 watchersCompare

[ Source](https://github.com/YannickYayo/laravel-api-geo)[ Packagist](https://packagist.org/packages/yannickyayo/laravel-api-geo)[ Docs](https://github.com/yannickyayo/laravel-api-geo)[ GitHub Sponsors](https://github.com/YannickYayo)[ RSS](/packages/yannickyayo-laravel-api-geo/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (1)Dependencies (10)Versions (2)Used By (0)

Wrapper Laravel pour communiquer avec l'API GEO du gouvernement français.
=========================================================================

[](#wrapper-laravel-pour-communiquer-avec-lapi-geo-du-gouvernement-français)

[![Latest Version on Packagist](https://camo.githubusercontent.com/03341041c0ac92eb520f2eb4e186dc91faea0c740bd637fa2c139acc17b85684/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f79616e6e69636b7961796f2f6c61726176656c2d6170692d67656f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/yannickyayo/laravel-api-geo)[![Tests](https://github.com/YannickYayo/laravel-api-geo/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/YannickYayo/laravel-api-geo/actions/workflows/run-tests.yml)[![Larastan](https://github.com/YannickYayo/laravel-api-geo/actions/workflows/larastan.yml/badge.svg?branch=main)](https://github.com/YannickYayo/laravel-api-geo/actions/workflows/larastan.yml)[![Style](https://github.com/YannickYayo/laravel-api-geo/actions/workflows/php-cs-fixer.yml/badge.svg?branch=main)](https://github.com/YannickYayo/laravel-api-geo/actions/workflows/php-cs-fixer.yml)[![Total Downloads](https://camo.githubusercontent.com/4ae78f9c685acfea41df3740ef5f3beb4d857b161f53949e51c36989854afef9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f79616e6e69636b7961796f2f6c61726176656c2d6170692d67656f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/yannickyayo/laravel-api-geo)

Ce package Laravel apporte un Wrapper autour de l'[API Geo](https://api.gouv.fr/les-api/api-geo) du gouvernement français.

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

[](#installation)

Vous pouvez installer le package via composer :

```
composer require yannickyayo/laravel-api-geo
```

Utilisation
-----------

[](#utilisation)

```
use Yannickyayo\LaravelApiGeo\Facades\LaravelApiGeo;

//---------- Recherches ----------//

// Chercher une commune
$response = LaravelApiGeo::towns()->search('nom', 'Pau');
/*
Clés possible pour la recherche des communes :
[
    'codePostal',
    'codeDepartement',
    'codeRegion',
    'nom',
    'lon',
    'lat',
]
*/

// Chercher un département
$response = LaravelApiGeo::departments()->search('nom', 'Pyrénées-Atlantiques');
/*
Clés possible pour la recherche des départements :
[
    'code',
    'codeRegion',
    'nom',
]
*/

// Chercher une région
$response = LaravelApiGeo::regions()->search('nom', 'Nouvelle-Aquitaine');
/*
Clés possible pour la recherche des régions :
[
    'code',
    'nom',
]
*/

/*
Exemple de résultat :
    [
        "status_code" => 200,
        "data" => "[{"code":"64445","codeDepartement":"64","codeRegion":"75","nom":"Pau","codesPostaux":["64000","64023"],"surface":3149.75,"population":77251,"centre":{"type":"Point","coordinates":[-0.3462,43.3197]},"contour":{"type":"Polygon","coordinates":[[...]]},"_score":0.24253612514094966,"departement":{"code":"64","nom":"Pyrénées-Atlantiques"},"region":{"code":"75","nom":"Nouvelle-Aquitaine"}}]",
    ]

    Vous recevez un tableau contenant de code status de la réponse et les données au format json.
*/
```

Récupérer seulement certaines colonnes
--------------------------------------

[](#récupérer-seulement-certaines-colonnes)

Il est possible de limiter les colonnes renvoyées par l'API avec la méthode `fields()` :

```
$response = LaravelApiGeo::towns()->fields(['nom', 'surface'])->search('nom', 'Pau');

/*
Colonnes possibles pour les communes :
[
    'code',
    'codeDepartement',
    'codeRegion',
    'nom',
    'codesPostaux',
    'surface',
    'population',
    'centre',
    'contour',
    'departement',
    'region',
]

Colonnes possibles pour les départements
[
    'nom',
    'code',
    'codeRegion',
    'region',
]

Colonnes possibles pour les régions
[
    'code',
    'nom',
]
*/
```

Test
----

[](#test)

```
composer test
```

Changelog
---------

[](#changelog)

Veuillez vous référer au [CHANGELOG](CHANGELOG.md) pour plus d'informations sur ce qui a changé récemment.

Contribuer
----------

[](#contribuer)

Veuillez vous référer au fichier [CONTRIBUTING](.github/CONTRIBUTING.md) pour les détails.

Failles de sécurité
-------------------

[](#failles-de-sécurité)

Veuillez vour référer à [notre politique de sécurité](../../security/policy) pour savoir comment faire un rapport de sécurité.

Credits
-------

[](#credits)

- [LEONE Yannick](https://github.com/YannickYayo)
- [Tous les contributeurs](../../contributors)

License
-------

[](#license)

Licence MIT (MIT). Voir [Licence](LICENSE.md) pour plus d'informations.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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

Unknown

Total

1

Last Release

1797d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/34b51ab4a50a0a8270068da4bde6ad2b287a992d7fce8fe978a9a102a9f5dea4?d=identicon)[Yannick Yayo](/maintainers/Yannick%20Yayo)

---

Top Contributors

[![YannickYayo](https://avatars.githubusercontent.com/u/9850323?v=4)](https://github.com/YannickYayo "YannickYayo (9 commits)")

---

Tags

laravelYannickYayolaravel-api-geo

###  Code Quality

TestsPest

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/yannickyayo-laravel-api-geo/health.svg)

```
[![Health](https://phpackages.com/badges/yannickyayo-laravel-api-geo/health.svg)](https://phpackages.com/packages/yannickyayo-laravel-api-geo)
```

###  Alternatives

[simplestats-io/laravel-client

Client for SimpleStats!

4515.5k](/packages/simplestats-io-laravel-client)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[njoguamos/laravel-plausible

A laravel package for interacting with plausible analytics api.

208.8k](/packages/njoguamos-laravel-plausible)[ryangjchandler/bearer

Minimalistic token-based authentication for Laravel API endpoints.

8129.8k](/packages/ryangjchandler-bearer)[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1221.1k](/packages/codebar-ag-laravel-docuware)[combindma/laravel-facebook-pixel

Meta pixel integration for Laravel

4956.9k](/packages/combindma-laravel-facebook-pixel)

PHPackages © 2026

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