GusApi
PHP GUS API library based on official REGON SOAP api.
Install / Use
/learn @johnzuk/GusApiREADME
PHP GUS API library
PHP GUS API is an object-oriented library to get information from REGON site based on official REGON SOAP API. Official GUS docs here.
Installation
This library uses Composer, just type in:
composer require gusapi/gusapi
Supported Versions
| Version | PHP version | BIR service version | Support | Doc | |---------|-------------|---------------------------------------|----------------------------------|------| | 6.x | >= 8.0 | BIR1.1 (available since October 2022) | Support ends on April 1, 2023 | Doc| | 5.x | >= 7.1 | BIR1.1 (available since May 2019) | Support ends on December 1, 2020 | Doc|
If you still use PHP <= 8.0 see documentation for 5.x version HERE
Upgrade from 5.x to 6.x
For more information see UPGRADE.md.
Example for 6.x
See file examples/readmeExample.php.
require_once '../vendor/autoload.php';
use GusApi\Exception\InvalidUserKeyException;
use GusApi\Exception\NotFoundException;
use GusApi\GusApi;
use GusApi\ReportTypes;
use GusApi\BulkReportTypes;
$gus = new GusApi('your api key here');
//for development server use:
//$gus = new GusApi('abcde12345abcde12345', 'dev');
try {
$nipToCheck = 'xxxxxxxxxx'; //change to valid nip value
$gus->login();
$gusReports = $gus->getByNip($nipToCheck);
var_dump($gus->dataStatus());
var_dump($gus->getBulkReport(
new DateTimeImmutable('2019-05-31'),
BulkReportTypes::REPORT_DELETED_LOCAL_UNITS
));
foreach ($gusReports as $gusReport) {
//you can change report type to other one
$reportType = ReportTypes::REPORT_PERSON;
echo $gusReport->getName();
echo 'Address: ' . $gusReport->getStreet() . ' ' . $gusReport->getPropertyNumber() . '/' . $gusReport->getApartmentNumber();
$fullReport = $gus->getFullReport($gusReport, $reportType);
var_dump($fullReport);
}
} catch (InvalidUserKeyException $e) {
echo 'Bad user key';
} catch (NotFoundException $e) {
echo 'No data found <br>';
echo 'For more information read server message below: <br>';
echo sprintf(
"StatusSesji:%s\nKomunikatKod:%s\nKomunikatTresc:%s\n",
$gus->getSessionStatus(),
$gus->getMessageCode(),
$gus->getMessage()
);
}
Stargazers over time
Related Skills
node-connect
344.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
96.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。

