PHPackages                             tor2r/laravel-brreg-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tor2r/laravel-brreg-api

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

tor2r/laravel-brreg-api
=======================

Fetch data from Brønnøysundregisteret.

v1.0.3(3mo ago)2158[1 PRs](https://github.com/Tor2r/laravel-brreg-api/pulls)MITPHPPHP ^8.2CI passing

Since Feb 11Pushed 2mo agoCompare

[ Source](https://github.com/Tor2r/laravel-brreg-api)[ Packagist](https://packagist.org/packages/tor2r/laravel-brreg-api)[ Docs](https://github.com/tor2r/laravel-brreg-api)[ GitHub Sponsors](https://github.com/Tor2r)[ RSS](/packages/tor2r-laravel-brreg-api/feed)WikiDiscussions main Synced today

READMEChangelog (4)Dependencies (16)Versions (9)Used By (0)

Laravel Brreg API
=================

[](#laravel-brreg-api)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5f404a3d6483605c31c0007e00648b9f115eca6e1e99a33fe3b57341c43f8d6f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f7232722f6c61726176656c2d62727265672d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tor2r/laravel-brreg-api)[![GitHub Tests Action Status](https://camo.githubusercontent.com/b181108144cbcc6f63e64cc6d04e258f6caa3c54153d81953699e3bfe5650414/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f746f7232722f6c61726176656c2d62727265672d6170692f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/tor2r/laravel-brreg-api/actions?query=workflow%3Arun-tests+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/29f8b52744981c730caed2da0872f4c4ef0e73923bd9da30771cb43c43056529/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f7232722f6c61726176656c2d62727265672d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tor2r/laravel-brreg-api)

A Laravel package for fetching basic data from [Brønnøysundregisteret](https://data.brreg.no/) (the Norwegian Register of Business Enterprises). Supports both Enhetsregisteret and Frivillighetsregisteret.

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

[](#requirements)

- PHP 8.2 or higher
- Laravel 11, 12, or 13

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

[](#installation)

You can install the package via composer:

```
composer require tor2r/laravel-brreg-api
```

You can publish the config file with:

```
php artisan vendor:publish --tag="brreg-api-config"
```

This is the contents of the published config file:

```
return [
    'base_url' => env('BRREG_API_BASE_URL', 'https://data.brreg.no'),
    'results_per_page' => env('BRREG_API_RESULTS_PER_PAGE', 100),
];
```

Usage
-----

[](#usage)

### Enhetsregisteret (Business Registry)

[](#enhetsregisteret-business-registry)

```
use Tor2r\BrregApi\Facades\BrregApi;

// Fetch a single entity by organisation number
$entity = BrregApi::getByOrgnr('987654321');

// Search by name
$results = BrregApi::searchByName('Sesam');

// Limit the number of results
$results = BrregApi::searchByName('Sesam', 10);
```

### Frivillighetsregisteret (Voluntary Organisations Registry)

[](#frivillighetsregisteret-voluntary-organisations-registry)

```
// Fetch a single voluntary organisation
$org = BrregApi::voluntary()->getByOrgnr('987654321');

// Search voluntary organisations by name
$results = BrregApi::voluntary()->searchByName('Frivillig');
```

### Response Format

[](#response-format)

**Single entity** (`getByOrgnr`) returns a flat array with the entity data:

```
$entity = BrregApi::getByOrgnr('925183873');

// [
//     'organisasjonsnummer' => '925183873',
//     'navn' => 'FAGFOKUS AS',
//     'organisasjonsform' => [...],
//     'forretningsadresse' => [...],
//     'antallAnsatte' => 7,
//     ...
// ]
```

**Search methods** (`searchByName`) return a structured response with `data` and `meta`:

```
$results = BrregApi::searchByName('Fagfokus');

// [
//     'data' => [
//         [
//             'organisasjonsnummer' => '925183873',
//             'navn' => 'FAGFOKUS AS',
//             'antallAnsatte' => 7,
//             ...
//         ],
//     ],
//     'meta' => [
//         'per_page' => 100,
//         'total' => 1,
//         'total_pages' => 1,
//         'current_page' => 0,
//     ],
// ]
```

Internal API fields (`_links`, `respons_klasse`) are automatically stripped from responses.

### Error Handling

[](#error-handling)

The package throws `Tor2r\BrregApi\Exceptions\BrregApiException` when something goes wrong:

```
use Tor2r\BrregApi\Exceptions\BrregApiException;

try {
    $entity = BrregApi::getByOrgnr('000000000');
} catch (BrregApiException $e) {
    // "No entity found with organisation number: 000000000"
    echo $e->getMessage();
}
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [Tor L](https://github.com/Tor2r)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance83

Actively maintained with recent releases

Popularity16

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

Total

4

Last Release

106d ago

### Community

Maintainers

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

---

Top Contributors

[![Tor2r](https://avatars.githubusercontent.com/u/34723140?v=4)](https://github.com/Tor2r "Tor2r (16 commits)")

---

Tags

laravelTor2rbrreglaravel-brreg-apiBrønnøysundregisteret

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/tor2r-laravel-brreg-api/health.svg)

```
[![Health](https://phpackages.com/badges/tor2r-laravel-brreg-api/health.svg)](https://phpackages.com/packages/tor2r-laravel-brreg-api)
```

###  Alternatives

[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329530.5k29](/packages/codewithdennis-filament-select-tree)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

124603.0k](/packages/worksome-exchange)[tarfin-labs/event-machine

Event-driven state machines for Laravel with event sourcing, type-safe context, and full audit trail.

199.4k](/packages/tarfin-labs-event-machine)

PHPackages © 2026

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