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 issues](https://github.com/ivuorinen/business-data-fetcher/issues)[1 PRs](https://github.com/ivuorinen/business-data-fetcher/pulls)MITPHPPHP ^8.2CI passing

Since Aug 15Pushed yesterday1 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 3d ago

READMEChangelog (3)Dependencies (5)Versions (12)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

34

—

LowBetter than 75% of packages

Maintenance50

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

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

Total

3

Last Release

682d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11024?v=4)[Ismo Vuorinen](/maintainers/ivuorinen)[@ivuorinen](https://github.com/ivuorinen)

---

Top Contributors

[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (23 commits)")[![ivuorinen](https://avatars.githubusercontent.com/u/11024?v=4)](https://github.com/ivuorinen "ivuorinen (22 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 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

[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k39](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[nfse-nacional/nfse-php

This is my package nfse

1535.3k](/packages/nfse-nacional-nfse-php)[oat-sa/tao-core

TAO core extension

66143.7k124](/packages/oat-sa-tao-core)

PHPackages © 2026

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