Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cba85/php-sirene-api
🏢PHP package for SIRENE API
https://github.com/cba85/php-sirene-api
php sirene
Last synced: about 2 months ago
JSON representation
🏢PHP package for SIRENE API
- Host: GitHub
- URL: https://github.com/cba85/php-sirene-api
- Owner: cba85
- License: mit
- Created: 2019-09-08T21:28:09.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-13T04:08:56.000Z (over 5 years ago)
- Last Synced: 2024-05-08T23:38:35.097Z (8 months ago)
- Topics: php, sirene
- Language: PHP
- Homepage:
- Size: 8.79 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP SIRENE API
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
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
- https://github.com/guzzle/guzzle
## Tests
Enter your auth token in `tests/SireneTest.php`:
```php
protected $token = "YOUR_TOKEN";
``````bash
$ ./vendor/bin/phpunit --bootstrap vendor/autoload.php tests/SireneTest
```