PHPackages                             ivuorinen/business-data-fetcher - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ivuorinen/business-data-fetcher

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ivuorinen/business-data-fetcher
===============================

Library to fetch finnish business data

v1.1.1(1y ago)19[1 PRs](https://github.com/ivuorinen/business-data-fetcher/pulls)MITPHPPHP ^8.2CI passing

Since Aug 15Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/ivuorinen/business-data-fetcher)[ Packagist](https://packagist.org/packages/ivuorinen/business-data-fetcher)[ RSS](/packages/ivuorinen-business-data-fetcher/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (5)Versions (8)Used By (0)

Business Data Fetcher
=====================

[](#business-data-fetcher)

[![PHP Composer](https://github.com/ivuorinen/business-data-fetcher/actions/workflows/composer.yml/badge.svg)](https://github.com/ivuorinen/business-data-fetcher/actions/workflows/composer.yml)

PHP library for fetching Finnish business data from the PRH (Finnish Patent and Registration Office) open data API.

Supports both **v1** (BIS) and **v3** (YTJ) APIs.

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

[](#installation)

```
composer require ivuorinen/business-data-fetcher
```

Usage
-----

[](#usage)

### v1 API (BIS)

[](#v1-api-bis)

Fetch company details by Business ID:

```
use Ivuorinen\BusinessDataFetcher\BusinessDataFetcher;

$client = new BusinessDataFetcher();
$results = $client->getBusinessInformation('1639413-9');

foreach ($results as $company) {
    echo $company->name . "\n";
    echo $company->businessId . "\n";

    foreach ($company->names as $name) {
        echo $name->name . ' (' . $name->getLanguageString() . ")\n";
    }
}
```

### v3 API (YTJ)

[](#v3-api-ytj)

Search companies with multiple filters:

```
use Ivuorinen\BusinessDataFetcher\v3\Client;

$client = new Client();

// Search by name
$result = $client->searchCompanies(name: 'Example');
echo "Found {$result->totalResults} companies\n";

foreach ($result->companies as $company) {
    echo $company->businessId->value . ' - ';
    echo $company->names[0]->name . "\n";
}

// Search by Business ID
$result = $client->searchCompanies(businessId: '1639413-9');

// Search with multiple filters
$result = $client->searchCompanies(
    location: 'Helsinki',
    companyForm: 'OY',
    mainBusinessLine: '62010',
);

// Get code list descriptions
$description = $client->getDescription('REK', 'en');

// Get postal codes
$postCodes = $client->getPostCodes('fi');

// Download all companies as ZIP
$stream = $client->getAllCompanies();
file_put_contents('companies.zip', $stream->getContents());
```

v1 vs v3 API Comparison
-----------------------

[](#v1-vs-v3-api-comparison)

Featurev1 (BIS)v3 (YTJ)Base URL`/bis/v1``/opendata-ytj-api/v3`LookupBy Business ID onlySearch by name, location, form, etc.Company formString codeStructured with descriptionsAddressesFlat structureNested with PostOffice objectsCode listsN/A`/description` endpointPostal codesN/A`/post_codes` endpointBulk downloadN/A`/all_companies` ZIPMigration from v1 DTOs
----------------------

[](#migration-from-v1-dtos)

If upgrading from the Spatie DTO version:

- DTOs are now `final readonly` classes (no `->toArray()`)
- `$sourceText` / `$authorityText` properties removed; use `getSourceText()` / `getAuthorityString()` methods
- `HasVersion` trait removed; `$version` is a regular constructor property
- `BusinessDataFetcher` constructor accepts an optional Guzzle `Client` for testing

Development
-----------

[](#development)

```
composer lint          # PSR-12 linting
composer lint-fix      # Auto-fix violations
composer phpstan       # Static analysis (level 9)
composer test          # Pest test suite
```

Data Source
-----------

[](#data-source)

- v1: [https://avoindata.prh.fi/ytj\_en.html](https://avoindata.prh.fi/ytj_en.html)
- v3:

Notice of Liability
-------------------

[](#notice-of-liability)

The data provided by the API is subject to change without warning and the author(s) of this library are providing this without compensation and cannot be held responsible.

License
-------

[](#license)

[MIT licensed](LICENSE.md)

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance67

Regular maintenance activity

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 52.5% 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 ~4 days

Total

3

Last Release

628d ago

### Community

Maintainers

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

---

Top Contributors

[![ivuorinen](https://avatars.githubusercontent.com/u/11024?v=4)](https://github.com/ivuorinen "ivuorinen (21 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (19 commits)")

---

Tags

api-clientapi-client-phpcompany-datacompany-data-apifinnish-company-dataphpprh

###  Code Quality

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ivuorinen-business-data-fetcher/health.svg)

```
[![Health](https://phpackages.com/badges/ivuorinen-business-data-fetcher/health.svg)](https://phpackages.com/packages/ivuorinen-business-data-fetcher)
```

###  Alternatives

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dhlparcel/magento2-plugin

DHL Parcel plugin for Magento 2

11180.5k2](/packages/dhlparcel-magento2-plugin)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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