PHPackages                             nks-hub/nette-ares - 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. nks-hub/nette-ares

ActiveLibrary[API Development](/categories/api)

nks-hub/nette-ares
==================

Nette extension for Czech ARES API — company lookup by IČO, search by name, structured results with caching. PHP 8.1+.

v1.0.3(1mo ago)02MITPHPPHP &gt;=8.1CI passing

Since Feb 26Pushed 1mo agoCompare

[ Source](https://github.com/nks-hub/nette-ares)[ Packagist](https://packagist.org/packages/nks-hub/nette-ares)[ Docs](https://github.com/nks-hub/nette-ares)[ RSS](/packages/nks-hub-nette-ares/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (12)Versions (5)Used By (0)

Nette ARES
==========

[](#nette-ares)

[![Latest Stable Version](https://camo.githubusercontent.com/386bbee18523d2b5f97c39024f5f897f378234e1e3b04f3c0af519fdb195a7ca/68747470733a2f2f706f7365722e707567782e6f72672f6e6b732d6875622f6e657474652d617265732f76)](https://packagist.org/packages/nks-hub/nette-ares)[![Total Downloads](https://camo.githubusercontent.com/e6b553ffa136f37a3b8975663def84486f4ee5c2de4d182d31a512aa6a546de7/68747470733a2f2f706f7365722e707567782e6f72672f6e6b732d6875622f6e657474652d617265732f646f776e6c6f616473)](https://packagist.org/packages/nks-hub/nette-ares)[![PHP Version](https://camo.githubusercontent.com/04744bae0a61d2ffe29c26f07a9612eae20445fc6feaeb77b3af1f0e9be6447c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e312d3838393242462e737667)](https://php.net/)[![Nette Version](https://camo.githubusercontent.com/7fa43b479be18b6ee90eacbd2a4cad2ccdebf68ce28c27fb3898cece6ee8ee78/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6e657474652d253545332e31253230253743253743253230253545342e302d626c75652e737667)](https://nette.org/)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE)

Nette DI extension pro [ARES](https://ares.gov.cz/) (Administrativní registr ekonomických subjektů) — vyhledávání firem podle IČO i názvu s automatickým cachováním výsledků. PHP 8.1+.

Features
--------

[](#features)

- 🔍 **Vyhledání podle IČO** — strukturovaný výsledek s adresou, DIČ, právní formou
- 📝 **Fulltextové vyhledávání** — hledání firem podle názvu s limitem výsledků
- 💾 **Automatické cachování** — konfigurovatelný TTL (výchozí 1 měsíc)
- ✅ **Kontrola aktivity** — ověření, zda firma není zaniklá
- 🎯 **Nette integrace** — DI extension s auto-registrací přes `composer.json`
- 🛡️ **Type-safe** — PHP 8.1+ s strict types a typed properties

Requirements
------------

[](#requirements)

- PHP 8.1+
- Nette 3.1+ / 4.0+

Instalace
---------

[](#instalace)

```
composer require nks-hub/nette-ares
```

Registrace
----------

[](#registrace)

Extension se registruje automaticky díky `extra.nette.extensions` v `composer.json`.

Ruční registrace v `config.neon`:

```
extensions:
    ares: NksHub\NetteAres\DI\AresExtension
```

### Konfigurace (volitelná)

[](#konfigurace-volitelná)

```
ares:
    cacheTtl: '1 month'   # Jak dlouho cachovat výsledky (výchozí: 1 month)
```

Použití
-------

[](#použití)

### Vyhledání firmy podle IČO

[](#vyhledání-firmy-podle-ičo)

```
use NksHub\NetteAres\AresClient;
use NksHub\NetteAres\AresException;

class MyPresenter extends Nette\Application\UI\Presenter
{
    public function __construct(
        private AresClient $ares,
    ) {}

    public function actionDetail(string $ico): void
    {
        try {
            $result = $this->ares->findByIco($ico);

            echo $result->obchodniJmeno;      // "Asseco Central Europe, a.s."
            echo $result->ico;                 // "27074358"
            echo $result->dic;                 // "CZ27074358"
            echo $result->getStreet();         // "Budějovická 778/3a"
            echo $result->getCity();           // "Praha - Michle"
            echo $result->getFormattedPsc();   // "140 00"
            echo $result->kodStatu;            // "CZ"

        } catch (AresException $e) {
            $this->flashMessage($e->getMessage(), 'danger');
        }
    }
}
```

### Vyhledání firem podle názvu

[](#vyhledání-firem-podle-názvu)

```
$results = $this->ares->searchByName('Asseco', limit: 5);

foreach ($results as $result) {
    echo "{$result->obchodniJmeno} (IČO: {$result->ico})\n";
}
```

### Kontrola aktivity firmy

[](#kontrola-aktivity-firmy)

```
if ($this->ares->isActive('27074358')) {
    echo 'Firma je aktivní';
}
```

### Získání DIČ

[](#získání-dič)

```
$dic = $this->ares->getDic('27074358'); // "CZ27074358" nebo null
```

### Použití v AJAX handleru (typicky pro formuláře)

[](#použití-v-ajax-handleru-typicky-pro-formuláře)

```
public function handleAresLookup(string $ico): void
{
    try {
        $result = $this->ares->findByIco($ico);
        $this->sendJson($result->toArray());
    } catch (AresException $e) {
        $this->sendJson(['error' => $e->getMessage()]);
    }
}
```

`toArray()` vrací:

```
[
    'ico'            => '27074358',
    'dic'            => 'CZ27074358',
    'company'        => 'Asseco Central Europe, a.s.',
    'street'         => 'Budějovická 778/3a',
    'city'           => 'Praha - Michle',
    'zip'            => '140 00',
    'country'        => 'CZ',
    'textovaAdresa'  => 'Budějovická 778/3a, Michle, 14000 Praha 4',
]
```

### Cache

[](#cache)

Výsledky se automaticky cachují (výchozí: 1 měsíc). Manuální invalidace:

```
$this->ares->clearCacheByIco('27074358'); // konkrétní IČO
$this->ares->clearCache();                 // celý ARES cache
```

AresResult
----------

[](#aresresult)

Objekt `AresResult` obsahuje:

PropertyTypPopis`ico``string`IČO (8 číslic)`dic``?string`DIČ (formát CZ + IČO)`obchodniJmeno``string`Obchodní jméno`pravniForma``?string`Kód právní formy`ulice``?string`Název ulice`cisloDomovni``?int`Číslo popisné`cisloOrientacni``?int`Číslo orientační`mesto``?string`Obec`castObce``?string`Část obce`psc``?int`PSČ`kodStatu``?string`Kód státu`textovaAdresa``?string`Celá adresa textem`datumVzniku``?string`Datum vzniku`datumZaniku``?string`Datum zánikuHelper metody: `getStreet()`, `getCity()`, `getFormattedPsc()`, `toArray()`.

API
---

[](#api)

Extension využívá oficiální [ARES REST API v3](https://ares.gov.cz/ekonomicke-subjekty-v-be/rest/v3/api-docs):

- `GET /ekonomicke-subjekty/{ico}` — vyhledání podle IČO
- `POST /ekonomicke-subjekty/vyhledat` — fulltextové vyhledávání

Bez autentizace, bez rate-limitu ze strany ARES (doporučujeme rozumné cachování).

Testing
-------

[](#testing)

```
./vendor/bin/tester tests
```

Contributing
------------

[](#contributing)

Pull requesty jsou vítány! Pro větší změny prosím nejprve otevřete issue.

1. Fork repozitáře
2. Vytvořte feature branch (`git checkout -b feature/nova-funkce`)
3. Commit změn (`git commit -m 'feat: popis'`)
4. Push branch (`git push origin feature/nova-funkce`)
5. Otevřete Pull Request

Podpora
-------

[](#podpora)

- 📧 **Email:**
- 🐛 **Bug reports:** [GitHub Issues](https://github.com/nks-hub/nette-ares/issues)
- 📖 **ARES API docs:** [ares.gov.cz](https://ares.gov.cz/ekonomicke-subjekty-v-be/rest/v3/api-docs)

Licence
-------

[](#licence)

MIT License — viz [LICENSE](LICENSE)

---

 Made with ❤️ by [NKS Hub](https://github.com/nks-hub)

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance89

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

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

4

Last Release

55d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/01e4841749ee2b4cf7211d784b093bf67523ed6489c6931401211b130df13884?d=identicon)[lukyrys](/maintainers/lukyrys)

---

Top Contributors

[![blackenzee](https://avatars.githubusercontent.com/u/78553450?v=4)](https://github.com/blackenzee "blackenzee (3 commits)")[![lukyrys](https://avatars.githubusercontent.com/u/2318346?v=4)](https://github.com/lukyrys "lukyrys (3 commits)")

---

Tags

aresbusiness-registerczechiconettenette-extensionphpnettedicicocompanyczecharesbusiness-register

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/nks-hub-nette-ares/health.svg)

```
[![Health](https://phpackages.com/badges/nks-hub-nette-ares/health.svg)](https://phpackages.com/packages/nks-hub-nette-ares)
```

###  Alternatives

[nette/di

💎 Nette Dependency Injection Container: Flexible, compiled and full-featured DIC with perfectly usable autowiring and support for all new PHP features.

92140.6M1.4k](/packages/nette-di)

PHPackages © 2026

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