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

ActiveLibrary[API Development](/categories/api)

mrcnpdlk/teryt-api
==================

Teryt WS1 Api

1.1.0(2y ago)1640.6k—8.1%9[2 issues](https://github.com/mrcnpdlk/teryt-api/issues)1MITPHPPHP &gt;=7.2CI failing

Since Sep 7Pushed 2y ago6 watchersCompare

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

READMEChangelog (10)Dependencies (13)Versions (14)Used By (1)

[![Latest Stable Version](https://camo.githubusercontent.com/30b1d3b096f57d26a039f603d200dc2f955c6e317c5a569dce70cff3658fa37e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6d72636e70646c6b2f74657279742d6170692e737667)](https://packagist.org/packages/mrcnpdlk/teryt-api)[![Latest Unstable Version](https://camo.githubusercontent.com/8af046853dd954fe5523410aaa0c6fdcdc7f3eb9b3efaed9463843ede3242cf7/68747470733a2f2f706f7365722e707567782e6f72672f6d72636e70646c6b2f74657279742d6170692f762f756e737461626c652e706e67)](https://packagist.org/packages/mrcnpdlk/teryt-api)[![Total Downloads](https://camo.githubusercontent.com/1ca10232868fe7c842c53b05bf486f4104593229d39d00a77b6e437b861befc7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d72636e70646c6b2f74657279742d6170692e737667)](https://packagist.org/packages/mrcnpdlk/teryt-api)[![Monthly Downloads](https://camo.githubusercontent.com/401c1e3d604a5b033d6226fd4a6c30eb6b1d5de44b4163b168f175df54d4b30a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6d72636e70646c6b2f74657279742d6170692e737667)](https://packagist.org/packages/mrcnpdlk/teryt-api)[![License](https://camo.githubusercontent.com/a61c5b10d9c14dab1dd63c0ee522ad7fe8e0ef50c9b8e6def6c636d47458b0f9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d72636e70646c6b2f74657279742d6170692e737667)](https://packagist.org/packages/mrcnpdlk/teryt-api)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/bb44f66337004cc7ca68ef73b3d354f3d10044828a54ec7e722e68bae4ab3033/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d72636e70646c6b2f74657279742d6170692f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mrcnpdlk/teryt-api/?branch=master)[![Build Status](https://camo.githubusercontent.com/201da9ed6e1700cf8eeeca769f9c60cd9adb4088336cf4af394266b20d5a4a5d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d72636e70646c6b2f74657279742d6170692f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mrcnpdlk/teryt-api/build-status/master)[![Code Coverage](https://camo.githubusercontent.com/ce1f4399db2ce7b40ac33b0bdabfbc5746e2dab6aa0b940b523f44e1f8b72fdc/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d72636e70646c6b2f74657279742d6170692f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mrcnpdlk/teryt-api/?branch=master)

[![Code Climate](https://camo.githubusercontent.com/bffd66efcb526536578fac48dc083763a9140994daf3470a6c41ea72d082dd1b/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6d72636e70646c6b2f74657279742d6170692f6261646765732f6770612e737667)](https://codeclimate.com/github/mrcnpdlk/teryt-api)[![Issue Count](https://camo.githubusercontent.com/c9d5f9c03efb3adc7a4b606b7390b4a216987c2686be8b76133a79b2b2e2ce63/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6d72636e70646c6b2f74657279742d6170692f6261646765732f69737375655f636f756e742e737667)](https://codeclimate.com/github/mrcnpdlk/teryt-api)

[![Dependency Status](https://camo.githubusercontent.com/a359f215ec5c5afe80bdad5b852ad25dbbd93303c799140b950c49f34671ea20/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3539623236373961333638623038303033643065383435352f62616467652e737667)](https://www.versioneye.com/user/projects/59b2679a368b08003d0e8455?child=summary)

TERYT WS1 API - Polish address database
=======================================

[](#teryt-ws1-api---polish-address-database)

Installation
------------

[](#installation)

Install the latest version with [composer](https://packagist.org/packages/mrcnpdlk/teryt-api)

```
composer require mrcnpdlk/teryt-api
```

Basic usage
-----------

[](#basic-usage)

### Cache

[](#cache)

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).

```
    /**
     * Cache in system files
     */
    $oInstanceCacheFiles = new \phpFastCache\Helper\Psr16Adapter('files');
```

### Log

[](#log)

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).

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

### Teryt Authentication

[](#teryt-authentication)

Service TERYT WS1 shares API based on `SOAP Protocol`. More information about service you can find on this [site](http://eteryt.stat.gov.pl/eTeryt/rejestr_teryt/udostepnianie_danych/baza_teryt/usluga_sieciowa_interfejsy_api/jakkorzystac.aspx)There are two ways to connect to the server:

- `production database` - you need login/password
- `testing database` - default authentication with default login/password pair

First of all we need configure connection calling `setTerytConfig()` method and optionally set cache and log instances

```
use mrcnpdlk\Teryt\Client;
use mrcnpdlk\Teryt\NativeApi;
use mrcnpdlk\Teryt\Config;

$oConfig = new Config([
    'logger'       => $oInstanceLogger,
    'cache'        => $oInstanceCacheFiles,
    'username'     => 'my_login',
    'password'     => 'my_password',
    'isProduction' => true,
]);
$oNativeApi = NativeApi::create($oConfig);
```

After that we able to call auxiliary static methods defined in NativeApi class, i.e:

```
var_dump($oNativeApi->CzyZalogowany());
var_dump($oNativeApi->PobierzSlownikCechULIC());
var_dump($oNativeApi->WyszukajMiejscowosc('skiernie',null));
```

Defined methods (`\mrcnpdlk\Teryt\NativeApi`)
---------------------------------------------

[](#defined-methods-mrcnpdlkterytnativeapi)

Almost all methods from official documentation have been mapped and defined.

Full list below `\mrcnpdlk\Teryt\NativeApi`:

### General

[](#general)

MethodStatusDescription`CzyZalogowany()`👌`PobierzDateAktualnegoKatTerc()`👌`PobierzDateAktualnegoKatNTS()`👌`PobierzDateAktualnegoKatSimc()`👌`PobierzDateAktualnegoKatUlic()`👌### Catalog TERC

[](#catalog-terc)

MethodStatusDescription`PobierzListeWojewodztw()`👌`PobierzListePowiatow()`👌`PobierzListeGmin()`👌`PobierzGminyiPowDlaWoj()`👌### Catalog NTS

[](#catalog-nts)

MethodStatusDescription`PobierzListeRegionow()`👌`PobierzListeWojewodztwWRegionie()`👌`PobierzListePodregionow()`👌`PobierzListePowiatowWPodregionie()`👌`PobierzListeGminPowiecie()`👌### Catalog ULIC

[](#catalog-ulic)

MethodStatusDescription`PobierzListeUlicDlaMiejscowosci()`👌### Catalog SIMC

[](#catalog-simc)

MethodStatusDescription`PobierzListeMiejscowosciWGminie()`👌`PobierzListeMiejscowosciWRodzajuGminy()`👌### Dictionary

[](#dictionary)

MethodStatusDescription`PobierzSlownikRodzajowJednostek()`👌`PobierzSlownikRodzajowSIMC()`👌`PobierzSlownikCechULIC()`👌### Catalog

[](#catalog)

MethodStatusDescription`PobierzKatalogTERCAdr()`👌`PobierzKatalogTERC()`👌`PobierzKatalogNTS()`👌`PobierzKatalogSIMCAdr()`👌`PobierzKatalogSIMC()`👌`PobierzKatalogSIMCStat()`👌`PobierzKatalogULIC()`👌`PobierzKatalogULICAdr()`👌`PobierzKatalogULICBezDzielnic()`👌`PobierzKatalogWMRODZ()`👌### Changes

[](#changes)

MethodStatusDescription`PobierzZmianyTercUrzedowy()`👌`PobierzZmianyTercAdresowy()`👌`PobierzZmianyNTS()`👌`PobierzZmianySimcUrzedowy()`👌`PobierzZmianySimcAdresowy()`👌`PobierzZmianySimcStatystyczny()`👌`PobierzZmianyUlicUrzedowy()`👌`PobierzZmianyUlicAdresowy()`👌### Verification

[](#verification)

MethodStatusDescription`WeryfikujAdresDlaMiejscowosci()`👌`WeryfikujAdresDlaMiejscowosciAdresowy()`👌`WeryfikujAdresWmiejscowosci()`👌`WeryfikujAdresWmiejscowosciAdresowy()`👌`WeryfikujAdresDlaUlic()`👌`WeryfikujAdresDlaUlicAdresowy()`👌`WeryfikujNazwaAdresUlic()`⚠️empty response`WeryfikujNazwaAdresUlicAdresowy()`👌### Search

[](#search)

MethodStatusDescription`WyszukajJPT()`⚠️empty response`WyszukajMiejscowosc()`👌`WyszukajMiejscowoscWJPT()`👌`WyszukajUlice()`👌`WyszukajJednostkeWRejestrze()`👌`WyszukajMiejscowoscWRejestrze()`👌`WyszukajUliceWRejestrze()`👌Defined methods (`\mrcnpdlk\Teryt\Api`)
---------------------------------------

[](#defined-methods-mrcnpdlkterytapi)

MethodStatusDescription`getCity()`👌```
$oApi = new \mrcnpdlk\Teryt\Api($oClient);
print_r($oApi->getCity('0700884'));
```

```
mrcnpdlk\Teryt\Model\City Object
(
    [id] => 0700884
    [parentId] => 0700884
    [rmId] => 01
    [rmName] => wieś
    [name] => Burzenin
    [commune] => mrcnpdlk\Teryt\Model\Commune Object
        (
            [id] => 101414
            [tercId] => 1014052
            [name] => Burzenin
            [typeId] => 2
            [typeName] => gmina wiejska
            [district] => mrcnpdlk\Teryt\Model\District Object
                (
                    [id] => 1014
                    [name] => sieradzki
                    [typeName] => powiat
                    [province] => mrcnpdlk\Teryt\Model\Province Object
                        (
                            [id] => 10
                            [name] => ŁÓDZKIE
                        )
                )
        )
)

```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity65

Established project with proven stability

 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 ~232 days

Recently: every ~578 days

Total

11

Last Release

848d ago

Major Versions

v0.3.3 → 1.0.02019-12-24

PHP version history (2 changes)v0.1.0PHP &gt;=7.0

1.0.0PHP &gt;=7.2

### 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 (72 commits)")

---

Tags

addresssoapteryt

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[codedredd/laravel-soap

A SoapClient wrapper integration for Laravel

221516.6k3](/packages/codedredd-laravel-soap)[laminas/laminas-soap

6221.8M37](/packages/laminas-laminas-soap)[shippo/shippo-php

A PHP library for connecting with multiple carriers (FedEx, UPS, USPS) using Shippo.

1711.8M2](/packages/shippo-shippo-php)[gusapi/gusapi

Gus Api Library for PHP

1351.5M8](/packages/gusapi-gusapi)[besimple/soap-client

Build and consume SOAP Client based web services

582.2M14](/packages/besimple-soap-client)[besimple/soap-common

Build and consume SOAP Common based web services

122.4M8](/packages/besimple-soap-common)

PHPackages © 2026

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