PHPackages                             lufiipe/laravel-insee-sierene - 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. lufiipe/laravel-insee-sierene

ActiveLibrary[API Development](/categories/api)

lufiipe/laravel-insee-sierene
=============================

A Laravel package for retrieving company information from the INSEE Sirene API

1.0.0(1y ago)1175MITPHPPHP ^7.4|^8.0CI passing

Since Jun 26Pushed 1y agoCompare

[ Source](https://github.com/lufiipe/laravel-insee-sierene)[ Packagist](https://packagist.org/packages/lufiipe/laravel-insee-sierene)[ RSS](/packages/lufiipe-laravel-insee-sierene/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (5)Versions (3)Used By (0)

[![GitHub Release](https://camo.githubusercontent.com/050060a091209d8176e6a14867177ba1a0622c33761a574a4c3cb070d53161be/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6c7566696970652f6c61726176656c2d696e7365652d73696572656e65)](https://github.com/lufiipe/laravel-insee-sierene/releases)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/0c3602ae3a98dc52a9624a19cde017d5371e9114ad91234830f09dd6926a674c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c7566696970652f6c61726176656c2d696e7365652d73696572656e652f7068705f72756e5f74657374732e796d6c)](https://github.com/lufiipe/laravel-insee-sierene/actions)[![GitHub License](https://camo.githubusercontent.com/87ab19fa5257c87987471aa2b215e3689ae50d77f620fa27214de23d579b76f7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6c7566696970652f6c61726176656c2d696e7365652d73696572656e653f636f6c6f723d79656c6c6f77)](LICENSE)

INSEE Sirene client for Laravel
===============================

[](#insee-sirene-client-for-laravel)

The INSEE Sirene client package is a Laravel library that provides a simple and easy-to-use interface for interacting with the INSEE API. It allows you to retrieve legal data, such as company information.

With this package, you can:

- ✅ Advanced search
- ✅ Facets
- ✅ Iterates over the items in the collection
- ✅ API Rate Limiting
- ✅ Event listener

Prerequisites
-------------

[](#prerequisites)

To interact with an Insee API, you need a valid API key. You can request one by following the step-by-step instructions provided on the "[Connexion à l'API Sirene - Mode d'emploi](https://portail-api.insee.fr/catalog/api/2ba0e549-5587-3ef1-9082-99cd865de66f/doc?page=85c5657d-b1a1-4466-8565-7db1a194667b)" page.

Installation &amp; setup
------------------------

[](#installation--setup)

You can install this package via composer using:

```
composer require lufiipe/laravel-insee-sierene

```

The package will automatically register its service provider.

To publish the config file to `config\insee-sirene.php` run:

```
php artisan vendor:publish --provider="LuFiipe\LaravelInseeSierene\InseeSiereneServiceProvider" --tag=insee-sirene-config

```

This is the default contents of the configuration:

```
return [
    /*
    |--------------------------------------------------------------------------
    | INSEE Sirene API Key
    |--------------------------------------------------------------------------
    |
    | To interact with the INSEE APIs, you must first obtain a valid API key.
    | This key is used to authenticate your requests and must be included in
    | each call to the API. You can request an API key by registering on the
    | INSEE developer portal.
    |
    */
    'key' => '',

    /*
    |--------------------------------------------------------------------------
    | Rate limiting
    |--------------------------------------------------------------------------
    |
    | The usage of the Sirene API is limited to 30 requests per minute.
    | By setting this variable to TRUE, the library automatically manages this
    | limitation by suspending program execution temporarily when necessary.
    |
    */
    'retry_on_rate_limit' => true,

    /*
    |--------------------------------------------------------------------------
    | Timeout
    |--------------------------------------------------------------------------
    |
    | Float describing the total timeout in seconds.
    | Use 0 to wait indefinitely (the default behavior).
    |
    */
    'timeout' => null,
];
```

Basic Usage
-----------

[](#basic-usage)

```
use LuFiipe\InseeSierene\Exception\SireneException;
use LuFiipe\InseeSierene\Parameters\SearchParameters;
use LuFiipe\LaravelInseeSierene\Facades\Sirene;

// Get legal entity details by SIREN number
Sirene::siren('120027016')->get();

// Get establishment details by SIRET Number
Sirene::siret('12002701600563')->get();

// Searches for legal entities whose name currently contains or previously contained the term "INSEE"
$parameters = (new SearchParameters)
    ->setQuery('periode(denominationUniteLegale:INSEE)');
$collection = Sirene::searchLegalUnits($parameters);
$collection->each(function (array $legalUnit) {
    dump($legalUnit);
});

// Retrieves establishments containing the name "WWF"
$parameters = (new SearchParameters)
    ->setQuery('denominationUniteLegale:"WWF"');
$collection = Sirene::searchEstablishments($parameters);
$collection->each(function (array $establishment) {
    dump($establishment);
});

// INSEE Sirene Service Status
try {
    $res = Sirene::informations();
} catch (SireneException $e) {
    // ../..
}
```

Listening for events
--------------------

[](#listening-for-events)

The package fires events where you can listen for to perform some extra logic.

### \\LuFiipe\\LaravelInseeSierene\\Events\\SireneRequestingEvent

[](#lufiipelaravelinseesiereneeventssirenerequestingevent)

This event will fire at the very beginning of request.

It has one public method `getRequest()`, that returns an instance of `LuFiipe\InseeSierene\Request\Request`.

### \\LuFiipe\\LaravelInseeSierene\\Events\\SireneRateLimitReachedEvent`

[](#lufiipelaravelinseesiereneeventssireneratelimitreachedevent)

This event will fire when the API rate limit has been reached.

It has two public methods:

- `getMilliseconds()` : Returns the number of milliseconds to wait before the next request.
- `getRetries()` : Returns the number of retries.

### Exemple

[](#exemple)

Creates a `LogSireneRequestingListener` and a `LogSireneRateLimitReachedListener` listeners:

```
namespace App\Listeners;

use Illuminate\Support\Facades\Log;
use LuFiipe\LaravelInseeSierene\Events\SireneRequestingEvent;

class LogSireneRequestingListener
{
    public function handle(SireneRequestingEvent $event): void
    {
        $request = $event->getRequest();

        Log::info('Insee Sirene : Query', [
            'method' => $request->getMethod(),
            'url' => $request->getUrl(),
            'params' => $request->getRequestBody(),
        ]);
    }
}
```

```
namespace App\Listeners;

use Illuminate\Support\Facades\Log;
use LuFiipe\LaravelInseeSierene\Events\SireneRequestingEvent;

class LogSireneRateLimitReachedListener
{
    public function handle(SireneRateLimitReachedEvent $event)
    {
        Log::info('Insee Sirene : Rate limiting', [
            'Wait ms' => $event->getMilliseconds(),
            'Retries' => $event->getretries(),
        ]);
    }
}
```

Registering the Event and Listener in the `EventServiceProvider`:

```
protected $listen = [
    \LuFiipe\LaravelInseeSierene\Events\SireneRequestingEvent::class => [
        \App\Listeners\LogSireneRequestingListener::class,
    ],
    \LuFiipe\LaravelInseeSierene\Events\SireneRateLimitReachedEvent::class => [
        \App\Listeners\LogSireneRateLimitReachedListener::class,
    ],
];
```

This will generate a log output similar to the following:

```
[2024-11-07 17:08:50] local.INFO: Insee Sirene : Query {"method":"GET","url":"https://api.insee.fr/api-sirene/3.11/informations","params":[]}
[2024-11-07 17:08:50] local.INFO: Insee Sirene : Rate limiting {"Wait ms":18026,"Retries":1}

```

Documentation
-------------

[](#documentation)

You'll find the documentation on .

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance49

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

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

373d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7064120?v=4)[Luis-Filipe Antunes](/maintainers/lufiipe)[@lufiipe](https://github.com/lufiipe)

---

Top Contributors

[![lufiipe](https://avatars.githubusercontent.com/u/7064120?v=4)](https://github.com/lufiipe "lufiipe (1 commits)")

---

Tags

laravelSirensireneINSEESiret

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/lufiipe-laravel-insee-sierene/health.svg)

```
[![Health](https://phpackages.com/badges/lufiipe-laravel-insee-sierene/health.svg)](https://phpackages.com/packages/lufiipe-laravel-insee-sierene)
```

###  Alternatives

[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.9k3](/packages/defstudio-telegraph)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.0k](/packages/simplestats-io-laravel-client)[simondevelop/sirene

Librairie facilitant l'utilisation de l'API sirene de l'insée

1028.0k1](/packages/simondevelop-sirene)

PHPackages © 2026

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