PHPackages                             asm/eprel-api-client - 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. asm/eprel-api-client

ActiveLibrary[API Development](/categories/api)

asm/eprel-api-client
====================

Eprel API Client

v1.1.4(2mo ago)020MITPHPPHP ^8.3CI passing

Since Feb 23Pushed 2mo agoCompare

[ Source](https://github.com/maschmann/eprel-public-api-client)[ Packagist](https://packagist.org/packages/asm/eprel-api-client)[ Docs](https://github.com/maschmann/eprel-public-api-client)[ RSS](/packages/asm-eprel-api-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (24)Versions (7)Used By (0)

EPREL API Client for PHP
========================

[](#eprel-api-client-for-php)

[![CI](https://github.com/maschmann/eprel-public-api-client/actions/workflows/ci.yml/badge.svg)](https://github.com/maschmann/eprel-public-api-client/actions/workflows/ci.yml)[![PHP Version](https://camo.githubusercontent.com/0180367da0701fa01e01b5a43a7bb0fdd01e4f73d2d368fdcd34711197710a7d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e342b2d3838393242462e737667)](https://php.net/)

A modern, fluent, and strongly-typed PHP client to interact with the **EPREL** (European Product Database for Energy Labelling) Public API.

What is EPREL?
--------------

[](#what-is-eprel)

The **Europäische Produktdatenbank für Energieverbrauchskennzeichnung** (European Product Database for Energy Labelling) is a database managed by the European Commission. It allows consumers to search for and verify the energy labels and product information sheets of appliances sold within the EU (e.g., refrigerators, washing machines, televisions, etc.).

This library allows you to seamlessly integrate the public search and retrieval capabilities of the EPREL database into your PHP applications.

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

[](#requirements)

- PHP 8.4 or higher
- A PSR-18 compatible HTTP Client (e.g., Guzzle)
- A PSR-17 compatible HTTP Factory
- *(Optional but recommended)* A PSR-6 compatible Cache Implementation (defaults to an in-memory array cache)

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

[](#installation)

You can install the package via composer:

```
composer require asm/eprel-api-client
```

Usage
-----

[](#usage)

### Basic Initialization

[](#basic-initialization)

You can initialize the client using an array of parameters or through a fluent configuration interface.

```
use Asm\EprelApiClient\EprelClient;

// Using the Fluent API (Recommended)
$client = (new EprelClient())
    ->uri('https://eprel.ec.europa.eu/api')
    ->apiKey('your-api-key') // If required by the API
    ->version('1.6.3')
    ->cacheTtl(3600); // Cache responses for 1 hour

// Alternatively, using the constructor:
$client = new EprelClient([
    'uri' => 'https://eprel.ec.europa.eu/api',
    'cacheTtl' => 3600,
]);
```

### Searching for Products

[](#searching-for-products)

You can retrieve a paginated list of products matching specific filter criteria (like the product group or energy class).

```
$page = $client->getProducts([
    'productGroup' => 'REFRIGERATORS',
    'energyClass' => 'A',
    'size' => 20,
    'page' => 0
]);

echo "Total Elements found: " . $page->totalElements . "\n";

foreach ($page->content as $productSummary) {
    echo "Brand: " . $productSummary->brandName . "\n";
    echo "Model: " . $productSummary->modelIdentifier . "\n";
    echo "EPREL Reg Number: " . $productSummary->registrationNumber . "\n";
    echo "Energy Class: " . $productSummary->energyClass . "\n";
    echo "---\n";
}
```

### Fetching Product Details

[](#fetching-product-details)

To retrieve the complete details, technical parameters, and URLs for the energy labels of a specific product, use its EPREL registration number.

```
use Asm\EprelApiClient\Exception\ResourceNotFoundException;

try {
    $productDetail = $client->getProduct('123456');

    echo "Brand: " . $productDetail->brandName . "\n";
    echo "Label URL: " . $productDetail->energyLabelUrl . "\n";
    echo "Product Sheet URL: " . $productDetail->productInformationSheetUrl . "\n";

    // Access arbitrary technical parameters provided by the API
    if (isset($productDetail->technicalParameters['volume'])) {
        echo "Volume: " . $productDetail->technicalParameters['volume'] . " L\n";
    }

} catch (ResourceNotFoundException $e) {
    echo "Product not found in the EPREL database.";
} catch (\Throwable $e) {
    echo "An API error occurred: " . $e->getMessage();
}
```

Caching
-------

[](#caching)

To avoid hitting rate limits and to significantly improve your application's performance, it is highly recommended to inject a persistent PSR-6 Cache Item Pool.

By default, the client uses an in-memory `ArrayAdapter` which only persists data for the duration of the current PHP script execution.

```
use Symfony\Component\Cache\Adapter\RedisAdapter;
use Asm\EprelApiClient\EprelClient;

$redisConnection = RedisAdapter::createConnection('redis://localhost');
$cachePool = new RedisAdapter($redisConnection);

$client = (new EprelClient())
    ->setCache($cachePool)
    ->cacheTtl(86400); // Cache for 24 hours
```

Development &amp; Testing
-------------------------

[](#development--testing)

This library comes with a Dockerized environment for easy development and testing.

```
# Start the docker environment and install composer dependencies
make setup

# Run PHPUnit tests
make test

# Run code style checks (PHPCS)
make cs

# Run static analysis (PHPStan Level max)
make stan

# Run Psalm
make psalm

# Run all tests and quality checks
make all
```

License
-------

[](#license)

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

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance85

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

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

Total

6

Last Release

76d ago

PHP version history (2 changes)v1.0.0PHP ^8.4

v1.1.0PHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/113964?v=4)[Jason](/maintainers/asm)[@asm](https://github.com/asm)

---

Top Contributors

[![maschmann](https://avatars.githubusercontent.com/u/157620?v=4)](https://github.com/maschmann "maschmann (13 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/asm-eprel-api-client/health.svg)

```
[![Health](https://phpackages.com/badges/asm-eprel-api-client/health.svg)](https://phpackages.com/packages/asm-eprel-api-client)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[tempest/framework

The PHP framework that gets out of your way.

2.1k23.1k9](/packages/tempest-framework)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6939.5M343](/packages/drupal-core-recommended)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)

PHPackages © 2026

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