PHPackages                             mrcnpdlk/mojepanstwo-api - 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. mrcnpdlk/mojepanstwo-api

ActiveLibrary[API Development](/categories/api)

mrcnpdlk/mojepanstwo-api
========================

MojePanstwo API

v0.2.1(8y ago)2501[2 issues](https://github.com/mrcnpdlk/mojepanstwo-api/issues)MITPHPPHP &gt;=7.0

Since Oct 29Pushed 8y agoCompare

[ Source](https://github.com/mrcnpdlk/mojepanstwo-api)[ Packagist](https://packagist.org/packages/mrcnpdlk/mojepanstwo-api)[ RSS](/packages/mrcnpdlk-mojepanstwo-api/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (5)Dependencies (5)Versions (7)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/3e1a16028f5233ddf28f8100ef0bb9a7520544a55afd710627f20a59abaffd32/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6d72636e70646c6b2f6d6f6a6570616e7374776f2d6170692e737667)](https://packagist.org/packages/mrcnpdlk/mojepanstwo-api)[![Latest Unstable Version](https://camo.githubusercontent.com/508aecad562352b7a9db9bf2653e49d7e12e685f19be716b81ccb763b329a0a5/68747470733a2f2f706f7365722e707567782e6f72672f6d72636e70646c6b2f6d6f6a6570616e7374776f2d6170692f762f756e737461626c652e706e67)](https://packagist.org/packages/mrcnpdlk/mojepanstwo-api)[![Total Downloads](https://camo.githubusercontent.com/9c19635ae7502adcacdf300389d3a7d5f8a2b4005cbd31e83b42703f3f290d07/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d72636e70646c6b2f6d6f6a6570616e7374776f2d6170692e737667)](https://packagist.org/packages/mrcnpdlk/mojepanstwo-api)[![Monthly Downloads](https://camo.githubusercontent.com/8be09e0adf9229a67117383687ff3d11db307c501d522822c4103968d94d55b8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6d72636e70646c6b2f6d6f6a6570616e7374776f2d6170692e737667)](https://packagist.org/packages/mrcnpdlk/mojepanstwo-api)[![License](https://camo.githubusercontent.com/716ea1cd2bbae4291d73107d35469800c472a88df9791ea84612d69e6e4b9cec/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d72636e70646c6b2f6d6f6a6570616e7374776f2d6170692e737667)](https://packagist.org/packages/mrcnpdlk/mojepanstwo-api)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/1c0f8c5b1dffb0ca0fe38c185a50204f27e3bc3bc2c361c2549e334727eb86d0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d72636e70646c6b2f6d6f6a6570616e7374776f2d6170692f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mrcnpdlk/mojepanstwo-api/?branch=master)[![Build Status](https://camo.githubusercontent.com/5fcc19d65a85f434d4e3700f8e2bb1b7690da8bf7cc2e6e145af97e93dc73166/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d72636e70646c6b2f6d6f6a6570616e7374776f2d6170692f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mrcnpdlk/mojepanstwo-api/build-status/master)[![Code Coverage](https://camo.githubusercontent.com/d5bcd9de67a02bb481c73c17dd8bdf46b365bd7989c0bbe8f2db38d50682487d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d72636e70646c6b2f6d6f6a6570616e7374776f2d6170692f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mrcnpdlk/mojepanstwo-api/?branch=master)

[![Maintainability](https://camo.githubusercontent.com/9995760112c13c3f84824b5591999ad82ece8a20f6e5bdfe8179e61efe22ff1e/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f38336335653330323064316536306366643134332f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/mrcnpdlk/mojepanstwo-api/maintainability)

mojepanstwo-api
===============

[](#mojepanstwo-api)

API v3 for

Api coverage
------------

[](#api-coverage)

LpMethod nameReturned type1getCommuneCommune2getDistrictDistrict3getProvinceProvince4getKrsEntityTypeKrsEntityType5getKrsEntityKrsEntity6getKrsPersonKrsPerson7searchCommuneQueryBuilder8searchDistrictQueryBuilder9searchProvinceQueryBuilder10searchKrsEntityTypeQueryBuilder11searchKrsEntityQueryBuilder12searchKrsPersonQueryBuilderFor methods returned `QueryBuilder` object, you are able to use below actions to specify your own conditions:

LpMethod nameReturned type1page()QueryBuilder2where()QueryBuilder3whereQ()QueryBuilder4orderBy()QueryBuilder5limit()QueryBuilder6get()SearchResponseBasic usage
-----------

[](#basic-usage)

### Client settings

[](#client-settings)

Library supports Cache bundles based on [PSR-16](http://www.php-fig.org/psr/psr-16/) standard.

For below example was used [phpfastcache/phpfastcache](https://github.com/PHPSocialNetwork/phpfastcache). `phpfastcache/phpfastcache` supports a lot of endpoints, i.e. `Files`, `Sqlite`, `Redis` and many other. More information about using cache and configuration it you can find in this [Wiki](https://github.com/PHPSocialNetwork/phpfastcache/wiki). Library also supports logging packages based on [PSR-3](http://www.php-fig.org/psr/psr-3/) standard, i.e. very popular [monolog/monolog](https://github.com/Seldaek/monolog).

Pushing Log and Cache instances. Not required, but suggested for better performance.

```
    $oInstanceCacheRedis = new \phpFastCache\Helper\Psr16Adapter(
        'redis',
        [
            "host"                => null, // default localhost
            "port"                => null, // default 6379
            'defaultTtl'          => 3600 * 24, // 24h
            'ignoreSymfonyNotice' => true,
        ]);

    $oInstanceLogger = new \Monolog\Logger('MOJEPANSTWO');
    $oInstanceLogger->pushHandler(new \Monolog\Handler\ErrorLogHandler(
            \Monolog\Handler\ErrorLogHandler::OPERATING_SYSTEM,
            \Psr\Log\LogLevel::DEBUG
        )
    );

    $oClient = new \mrcnpdlk\MojePanstwo\Client();
    $oClient->setCacheInstance($oInstanceCacheRedis)
            ->setLoggerInstance($oInstanceLogger)
    ;
```

### Getting KRS Entity

[](#getting-krs-entity)

#### Request

[](#request)

##### Available pull flags

[](#available-pull-flags)

- `KrsEntity::PULL_NONE`
- `KrsEntity::PULL_COMPANIES` - Layer `firmy`
- `KrsEntity::PULL_DEPARTMENTS` - Layer `oddzialy`
- `KrsEntity::PULL_PARTNERS` - Layer `wspolnicy`
- `KrsEntity::PULL_PKDS` - Layer `dzialalnosci`
- `KrsEntity::PULL_SHARES` - Layer `emisje_akcji`
- `KrsEntity::PULL_PERSON_REPRESENTATION` - Layer `reprezentacja`
- `KrsEntity::PULL_PERSON_SUPERVISION` - Layer `nadzor`
- `KrsEntity::PULL_PERSON_PROXY` - Layer `prokurenci`
- `KrsEntity::PULL_PERSON_FOUNDING` - Layer `komitetZalozycielski`
- `KrsEntity::PULL_ALL` - All layers

```
    $oApi = \mrcnpdlk\MojePanstwo\Api::create($oClient);

    $res = $oApi->getKrsEntity('0000359730',\mrcnpdlk\MojePanstwo\Model\KrsEntity::PULL_ALL);
    print_r($res);
```

#### Response

[](#response)

```
mrcnpdlk\MojePanstwo\Model\KrsEntity Object
(
    [id] => 359730
    [krs] => 0000359730
    [nip] => 1231216692
    [regon] =>
    [nazwa] => FUNDACJA EPAŃSTWO
    .
    .
    [wczesniejsza_rejestracja_str] =>
    [www] => BIURO @EPF.ORG.PL
    [wykreslony] => 0
    [dzialalnosci] => Array
        (
        )
    [emisje_akcji] => Array
        (
        )
    [firmy] => Array
        (
        )
    [nadzor] => Array
        (
            [0] => mrcnpdlk\MojePanstwo\Model\KrsEntity\Person Object
                (
                    [osoba_id] => 418604
                    [nazwa] => XXXXX Michał Grzegorz
                    [data_urodzenia] => 1977-03-12
                    [privacy_level] => 0
                    [funkcja] =>
                )
            [1] => mrcnpdlk\MojePanstwo\Model\KrsEntity\Person Object
                (
                    [osoba_id] => 447892
                    [nazwa] => XXXXX Maciej Rafał
                    [data_urodzenia] => 1977-07-21
                    [privacy_level] => 0
                    [funkcja] =>
                )
            [2] => mrcnpdlk\MojePanstwo\Model\KrsEntity\Person Object
                (
                    [osoba_id] => 8972
                    [nazwa] => XXXXX Jakub Mirosław
                    [data_urodzenia] => 1985-09-23
                    [privacy_level] => 0
                    [funkcja] =>
                )
        )
    [prokurenci] => Array
        (
        )
    [reprezentacja] => Array
        (
            [0] => mrcnpdlk\MojePanstwo\Model\KrsEntity\Person Object
                (
                    [osoba_id] => 8971
                    [nazwa] => XXXXX Daniel
                    [data_urodzenia] => 1984-04-03
                    [privacy_level] => 0
                    [funkcja] => Prezes Zarządu
                )
            [1] => mrcnpdlk\MojePanstwo\Model\KrsEntity\Person Object
                (
                    [osoba_id] => 146037
                    [nazwa] => XXXXXX Krzysztof Kazimierz
                    [data_urodzenia] => 1981-12-03
                    [privacy_level] => 0
                    [funkcja] => Członek Zarządu
                )
        )
    [wspolnicy] => Array
        (
        )
    [oddzialy] => Array
        (
        )
)
```

### Searching KRS Entity

[](#searching-krs-entity)

#### Request

[](#request-1)

Calling `searchKrsEntity()` method returns QueryBuilder instance, additional functions as `limit()`, `where()`, `page()` are available. At the end call method `get()` to receive `SearchResponse` object.

```
    $res = $oApi->searchKrsEntity()
                ->limit(2)
                ->where('wojewodztwo_id', 2)
                ->page(2)
                ->get()
    ;
    print_r($res);
```

#### Response

[](#response-1)

```
mrcnpdlk\MojePanstwo\Model\SearchResponse Object
(
   [count] => 21102
   [took] => 340
   [links] => mrcnpdlk\MojePanstwo\Model\SearchResponseLinks Object
       (
           [self] => https://api-v3.mojepanstwo.pl/dane/krs_podmioty/?conditions%5Bkrs_podmioty.wojewodztwo_id%5D=2&page=2&limit=2&_type=objects
           [first] => https://api-v3.mojepanstwo.pl/dane/krs_podmioty/?conditions%5Bkrs_podmioty.wojewodztwo_id%5D=2&page=1&limit=2&_type=objects
           [next] => https://api-v3.mojepanstwo.pl/dane/krs_podmioty/?conditions%5Bkrs_podmioty.wojewodztwo_id%5D=2&page=3&limit=2&_type=objects
           [last] => https://api-v3.mojepanstwo.pl/dane/krs_podmioty/?conditions%5Bkrs_podmioty.wojewodztwo_id%5D=2&page=10551&limit=2&_type=objects
       )

   [items] => Array
       (
           [0] => mrcnpdlk\MojePanstwo\Model\SearchResponseItem Object
               (
                   [id] => 699600
                   [dataset] => krs_podmioty
                   [url] => https://api-v3.mojepanstwo.pl/dane/krs_podmioty/699600
                   [mp_url] => https://mojepanstwo.pl/dane/krs_podmioty/699600
                   [schema_url] => https://api-v3.mojepanstwo.pl/schemas/dane/krs_podmioty.json
                   [global_id] => 58872094
                   [slug] => correct-context
                   [score] =>
                   [data] => mrcnpdlk\MojePanstwo\Model\KrsEntity Object
                       (
                           [id] => 699600
                           [krs] => 0000699600
                           [nip] => 9532727782
                           [regon] =>
                           [nazwa] => CORRECT CONTEXT SPÓŁKA Z OGRANICZONĄ ODPOWIEDZIALNOŚCIĄ
                           [nazwa_skrocona] => CORRECT CONTEXT
                           .
                           .
                           .
                       )
               )
               .
               .
               .
       )
)
```

### Getting KRS Person

[](#getting-krs-person)

#### Request

[](#request-2)

##### Available pull flags

[](#available-pull-flags-1)

- `KrsPerson::PULL_NONE`
- `KrsPerson::PULL_KRS_ENTITIES`
- `KrsPerson::PULL_ALL`

```
    $oApi = \mrcnpdlk\MojePanstwo\Api::create($oClient);

    $res = $oApi->getKrsPerson('1491928',\mrcnpdlk\MojePanstwo\Model\KrsPerson::PULL_ALL);
    print_r($res);
```

### Searching KRS Person

[](#searching-krs-person)

#### Request

[](#request-3)

Calling `searchKrsPerson()` method returns QueryBuilder instance, additional functions as `limit()`, `where()`/`whereQ()`, `page()` are available. At the end call method `get()` to receive `SearchResponse` object.

```
    $res = $oApi->searchKrsPerson()
                ->whereQ('Jan Nowak')
                ->get()
    ;
    print_r($res);
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

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

Every ~8 days

Total

5

Last Release

3085d ago

### Community

Maintainers

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

---

Top Contributors

[![mrcnpdlk](https://avatars.githubusercontent.com/u/22945316?v=4)](https://github.com/mrcnpdlk "mrcnpdlk (45 commits)")

---

Tags

krsmojepanstwomojepanstwo-apikrsmojepanstwo

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mrcnpdlk-mojepanstwo-api/health.svg)

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

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)[gusapi/gusapi

Gus Api Library for PHP

1351.5M8](/packages/gusapi-gusapi)

PHPackages © 2026

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