lufiipe/insee-sierene 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lufiipe/insee-sierene

最新稳定版本:1.0.0

Composer 安装命令:

composer require lufiipe/insee-sierene

包简介

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

README 文档

README

GitHub Release GitHub Actions Workflow Status Static Badge GitHub License Static Badge

INSEE Sirene client for PHP

The INSEE Sirene client package is a PHP 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

Install

composer require lufiipe/insee-sierene

Usage

require_once "vendor/autoload.php";
use LuFiipe\InseeSierene\Exception\SireneException;
use LuFiipe\InseeSierene\Parameters\SearchParameters;
use LuFiipe\InseeSierene\Sirene;

$sirene = new Sirene('YOUR-API-KEY');

// Get legal entity details by SIREN number
$sirene->siren('120027016')->getBody();

// Get establishment details by SIRET Number
$sirene->siret('12002701600563')->getBody();

// 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) {
    var_dump($legalUnit);
});

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

// INSEE Sirene Service Status
try {
    $res = $sirene->informations();
} catch (SireneException $e) {
    // ../..
}

Documentation

You can find detailed instructions on how to use this package at the dedicated documentation site.

Tests

Copy the file phpunit.xml.dist to phpunit.xml and update the value of the INSEE_API_KEY variable with your api key.

Then, run:

composer test

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 427
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 6
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-06-23