PHPackages                             gusapi/gusapi - 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. gusapi/gusapi

ActiveLibrary[API Development](/categories/api)

gusapi/gusapi
=============

Gus Api Library for PHP

6.3.2(7mo ago)1351.5M—0.2%46[33 issues](https://github.com/johnzuk/GusApi/issues)[2 PRs](https://github.com/johnzuk/GusApi/pulls)8LGPL-2.1-or-laterPHPPHP ^8.1CI passing

Since Sep 29Pushed 1mo ago20 watchersCompare

[ Source](https://github.com/johnzuk/GusApi)[ Packagist](https://packagist.org/packages/gusapi/gusapi)[ RSS](/packages/gusapi-gusapi/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (31)Used By (8)

PHP GUS API library
===================

[](#php-gus-api-library)

[![Packagist](https://camo.githubusercontent.com/471bfcafa28c0b807ee7471c4161dbbdd0aec6cee62dc05f0e355ad2449d215f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6775736170692f6775736170692e737667)](https://packagist.org/packages/gusapi/gusapi)[![Build Status](https://camo.githubusercontent.com/5c5cdfec9caae302fceaac2f3c25a36721df1ca6773a0221a64d83bf7a00c988/68747470733a2f2f7472617669732d63692e6f72672f6a6f686e7a756b2f4775734170692e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/johnzuk/GusApi)[![Codecov](https://camo.githubusercontent.com/44e189c1ae7bb6a430ef467a4f192dc144434a227a9604bdf910cc9b2aa58589/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6a6f686e7a756b2f4775734170692f6d61737465722e737667)](https://codecov.io/gh/johnzuk/GusApi)[![Packagist](https://camo.githubusercontent.com/213a40fd23aec277829e1e55c9d91c0c01cbdad8c1197b68b800702463fcf86e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6775736170692f6775736170692e737667)](https://packagist.org/packages/gusapi/gusapi)[![Packagist](https://camo.githubusercontent.com/198ab38b6f5a6cbb6f609dc6c5c4c29364508e175f9a157fca2073f6ebbea5a7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6775736170692f6775736170692e737667)](https://packagist.org/packages/gusapi/gusapi)[![StyleCI](https://camo.githubusercontent.com/6f8d91eb476d2bc2eee9f637fcc150683aaf6eb42715c40150dcd321076f7e61/68747470733a2f2f7374796c6563692e696f2f7265706f732f33303833363439332f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/30836493)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/9947e143b82bc2337ef41663b11448c7fbc03a7daacdceedaef7cfe660ddc36a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a6f686e7a756b2f4775734170692f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/johnzuk/GusApi/?branch=master)

PHP GUS API is an object-oriented library to get information from [REGON site](https://api.stat.gov.pl/Home/RegonApi) based on **official** REGON SOAP API. Official GUS docs [here](https://api.stat.gov.pl/Home/RegonApi).

Installation
============

[](#installation)

This library uses [Composer](https://packagist.org/packages/gusapi/gusapi), just type in:

```
composer require gusapi/gusapi
```

Supported Versions
==================

[](#supported-versions)

VersionPHP versionBIR service versionSupportDoc6.x&gt;= 8.0BIR1.1 (available since October 2022)Support ends on April 1, 2023[Doc](https://github.com/johnzuk/GusApi/blob/master/README.md)5.x&gt;= 7.1BIR1.1 (available since May 2019)Support ends on December 1, 2020[Doc](https://github.com/johnzuk/GusApi/blob/5.0.0/README.md)If you still use PHP &lt;= 8.0 see documentation for 5.x version [HERE](https://github.com/johnzuk/GusApi/blob/5.0.0/README.md)
-------------------------------------------------------------------------------------------------------------------------------

[](#if-you-still-use-php--80-see-documentation-for-5x-version-here)

Upgrade from 5.x to 6.x
=======================

[](#upgrade-from-5x-to-6x)

For more information see [UPGRADE.md](UPGRADE.md).

Example for 6.x
===============

[](#example-for-6x)

See file [examples/readmeExample.php](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 ';
    echo 'For more information read server message below: ';
    echo sprintf(
        "StatusSesji:%s\nKomunikatKod:%s\nKomunikatTresc:%s\n",
        $gus->getSessionStatus(),
        $gus->getMessageCode(),
        $gus->getMessage()
    );
}
```

Stargazers over time
--------------------

[](#stargazers-over-time)

[![Stargazers over time](https://camo.githubusercontent.com/57121cc17eb1cf30958f25670834417f5baf38da93c1a3d08a2eaf114886782b/68747470733a2f2f7374617263686172742e63632f6a6f686e7a756b2f4775734170692e7376673f76617269616e743d6c69676874)](https://starchart.cc/johnzuk/GusApi)

###  Health Score

66

—

FairBetter than 99% of packages

Maintenance73

Regular maintenance activity

Popularity58

Moderate usage in the ecosystem

Community35

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 52.3% 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

Every ~130 days

Recently: every ~252 days

Total

29

Last Release

223d ago

Major Versions

1.0 → 3.12017-09-30

3.2.1 → 4.0.0-alpha2018-05-10

4.0.2 → 5.0.02019-06-02

5.3.0 → 6.0.0.x-dev2022-10-20

PHP version history (7 changes)3.0.x-devPHP &gt;=5.3

3.1PHP &gt;=5.4

3.3PHP &gt;=5.6

4.0.0-alphaPHP ^7.1

5.2.0PHP ^7.1|^8.0

6.0.0.x-devPHP ^8.0

6.3.2PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/d096633bd6d714c4ce9e3b3d04da07681692d1b5050ed255051036dff3abecd8?d=identicon)[johnzuk](/maintainers/johnzuk)

---

Top Contributors

[![johnzuk](https://avatars.githubusercontent.com/u/5394761?v=4)](https://github.com/johnzuk "johnzuk (58 commits)")[![IonBazan](https://avatars.githubusercontent.com/u/1985514?v=4)](https://github.com/IonBazan "IonBazan (23 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (9 commits)")[![simivar](https://avatars.githubusercontent.com/u/828020?v=4)](https://github.com/simivar "simivar (5 commits)")[![msiemaszko](https://avatars.githubusercontent.com/u/5961267?v=4)](https://github.com/msiemaszko "msiemaszko (3 commits)")[![cureoeu](https://avatars.githubusercontent.com/u/8598643?v=4)](https://github.com/cureoeu "cureoeu (2 commits)")[![kapiwko](https://avatars.githubusercontent.com/u/9286521?v=4)](https://github.com/kapiwko "kapiwko (2 commits)")[![krzyc](https://avatars.githubusercontent.com/u/290585?v=4)](https://github.com/krzyc "krzyc (2 commits)")[![bitdeli-chef](https://avatars.githubusercontent.com/u/3092978?v=4)](https://github.com/bitdeli-chef "bitdeli-chef (2 commits)")[![timiTao](https://avatars.githubusercontent.com/u/6087694?v=4)](https://github.com/timiTao "timiTao (1 commits)")[![kukulich](https://avatars.githubusercontent.com/u/260445?v=4)](https://github.com/kukulich "kukulich (1 commits)")[![pszeptynski](https://avatars.githubusercontent.com/u/20754497?v=4)](https://github.com/pszeptynski "pszeptynski (1 commits)")[![robertpustulka](https://avatars.githubusercontent.com/u/7437773?v=4)](https://github.com/robertpustulka "robertpustulka (1 commits)")[![artur-mietek](https://avatars.githubusercontent.com/u/80744012?v=4)](https://github.com/artur-mietek "artur-mietek (1 commits)")

---

Tags

gus-apiphp-gus-apiregon-soap-apiapilibrarysoapregonnipGUSCEIDGkrs

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/gusapi-gusapi/health.svg)

```
[![Health](https://phpackages.com/badges/gusapi-gusapi/health.svg)](https://phpackages.com/packages/gusapi-gusapi)
```

PHPackages © 2026

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