Download the PHP package kaveraa/api-gouv-publique-fr without Composer
On this page you can find all versions of the php package kaveraa/api-gouv-publique-fr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kaveraa/api-gouv-publique-fr
More information about kaveraa/api-gouv-publique-fr
Files in kaveraa/api-gouv-publique-fr
Package api-gouv-publique-fr
Short Description Typed PHP client for French public APIs (company search, address and Geo) with Laravel and Symfony bridges. Unofficial.
License MIT
Homepage https://github.com/kaveraa/api-gouv-publique-fr
Informations about the package api-gouv-publique-fr
API Gouv Publique FR
English - Français
A typed PHP client for French public APIs. Version 0.1 covers company search ("Recherche d'entreprises") and address search (the BAN, served by the Geoplateforme). Version 0.2 adds the Geo API (communes, departements, regions, EPCI). Version 0.3 adds a Symfony bundle. It works in any PHP project. It has optional bridges for Laravel and Symfony. Version 1.0 is stable: see the backward compatibility promise.
This is an unofficial project. It is not affiliated with the French State.
Requirements
- PHP 8.3 or newer
- Laravel 12 or 13 (optional)
- Symfony 7.4 or 8 (optional)
Install
Laravel example
Plain PHP example
This example uses Symfony HttpClient as the PSR-18 client and Nyholm as the PSR-17 factory.
Guides
- Quick start
- Company search
- Address search
- Geo API
- Laravel
- Symfony
- Plain PHP
- Errors, cache and rate limit
- Testing
- Backward compatibility
- Upgrade from 0.3 to 0.4
- FAQ
Features
- Typed objects (DTOs) for companies, establishments, managers, addresses, communes, departements, regions and EPCI.
- One exception class per problem, all with a common parent:
ApiException. - Optional response cache, off by default. It works with any PSR-16 cache.
- Rate limit retry in Laravel (HTTP 429).
- Laravel validation rules:
Siren,SiretandEntrepriseExiste. - Symfony bundle: configuration, autowired clients and a response cache on a cache pool.
- Symfony validation constraints:
Siren,SiretandEntrepriseExiste. - Test fakes and factories for your own tests, and a fake mode for Symfony tests.
Not included
The INSEE SIRENE API is not included.
Unofficial notice
This package is not made by the French State and is not affiliated with it. "api.gouv.fr" and the API names belong to their owners. Please read the terms of use of each API.
License
MIT. See LICENSE.
Contributing
See SECURITY.md.
All versions of api-gouv-publique-fr with dependencies
ext-json Version *
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/simple-cache Version ^2.0 || ^3.0