cba85 / php-sirene-api
PHP package for SIRENE API
Installs: 1 320
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- guzzlehttp/guzzle: ~6.0
Requires (Dev)
- phpunit/phpunit: ^8
This package is auto-updated.
Last update: 2025-03-13 16:40:03 UTC
README
PHP package to use version 3 of SIRENE API.
Authentification
You need a token authentification to use SIRENE API version 3. You can generate one on INSEE website : https://api.insee.fr/catalogue/site/themes/wso2/subthemes/insee/pages/item-info.jag?name=Sirene&version=V3&provider=insee
Older version
- For the version 1 of SIRENE API, please check out the
v1
branch in this repository. - For the version 2 of SIRENE API, please check out the
v2
branch in this repository.
Install
$ composer require cba85/php-sirene-api
Usage
<?php // Composer autoload require dirname(__DIR__) . "/vendor/autoload.php"; // SIRENE class $sirene = new \Sirene\Sirene("YOUR_AUTH_TOKEN"); // Version 3 - SIREN $results = $sirene->siren(null, ['nombre' => 5]); $results = $sirene->siren("213105554"); $results = $sirene->siren("nonDiffusibles", ['nombre' => 10]); // Version 3 - SIRET $results = $sirene->siret(null, ['nombre' => 5]); $results = $sirene->siret("213105554"); $results = $sirene->siret("liensSuccession", ['nombre' => 25]); $results = $sirene->siret("nonDiffusibles", ['nombre' => 10]); // Version 3 - Information $results = $sirene->informations();
Dependencies
Tests
Enter your auth token in tests/SireneTest.php
:
protected $token = "YOUR_TOKEN";
$ ./vendor/bin/phpunit --bootstrap vendor/autoload.php tests/SireneTest