PHPackages                             openfoodfacts/openfoodfacts-laravel - 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. openfoodfacts/openfoodfacts-laravel

ActiveLibrary[API Development](/categories/api)

openfoodfacts/openfoodfacts-laravel
===================================

Open Food Facts API wrapper for Laravel

v0.8.0(4w ago)18727.8k↓69.5%26[2 issues](https://github.com/openfoodfacts/openfoodfacts-laravel/issues)[4 PRs](https://github.com/openfoodfacts/openfoodfacts-laravel/pulls)MITPHPPHP ^8.2CI passing

Since Mar 27Pushed 6d ago12 watchersCompare

[ Source](https://github.com/openfoodfacts/openfoodfacts-laravel)[ Packagist](https://packagist.org/packages/openfoodfacts/openfoodfacts-laravel)[ Docs](https://github.com/openfoodfacts/openfoodfacts-laravel)[ GitHub Sponsors](https://github.com/openfoodfacts)[ RSS](/packages/openfoodfacts-openfoodfacts-laravel/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (18)Versions (20)Used By (0)

   ![](https://camo.githubusercontent.com/f9a0b288f62c3f2d8d87a8d97c58ea61790394a2743a97ce5f622410d7e0f401/68747470733a2f2f7374617469632e6f70656e666f6f6466616374732e6f72672f696d616765732f6c6f676f732f6f66662d6c6f676f2d686f72697a6f6e74616c2d6c696768742e737667)Laravel Open Food Facts API
===========================

[](#laravel-open-food-facts-api)

[![Latest Version on Packagist](https://camo.githubusercontent.com/bd14ae9a778c9e9b1020cba64f915a402d0a24a4c63c3ea692a80f7ee1d758ea/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f70656e666f6f6466616374732f6f70656e666f6f6466616374732d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/openfoodfacts/openfoodfacts-laravel)[![Code Coverage](https://camo.githubusercontent.com/6535780a63dd8ee2cf086c15f507d12e41dbe6fb4a7a09a55080fc70bd21c20e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6f70656e666f6f6466616374732f6f70656e666f6f6466616374732d6c61726176656c2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/openfoodfacts/openfoodfacts-laravel/?branch=master)[![Quality Score](https://camo.githubusercontent.com/5cd93fe2913eb583c0dc5cd5b519170813212627a42e65feb0c0e6e821130552/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6f70656e666f6f6466616374732f6f70656e666f6f6466616374732d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/openfoodfacts/openfoodfacts-laravel)

This package provides a convenient wrapper to the [Open Food Facts API](https://en.wiki.openfoodfacts.org/API) for Laravel applications.

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

[](#requirements)

- PHP 8.1+
- Laravel 9.x, 10.x, 11.x, 12.x, 13.x

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

[](#installation)

You can install the package via composer:

```
composer require openfoodfacts/openfoodfacts-laravel
```

#### Legacy support

[](#legacy-support)

- PHP 8.0 (Laravel &lt;=9.x): `composer require "openfoodfacts/openfoodfacts-laravel:^0.3"`
- PHP 7.2-7.4.x (Laravel 5.7-8.x): `composer require "openfoodfacts/openfoodfacts-laravel:^0.2"`

Usage
-----

[](#usage)

#### Find product details by barcode

[](#find-product-details-by-barcode)

```
OpenFoodFacts::barcode('20203467');
```

it returns an array with product details:

```
Array
(
    [product_name] => Cantuccini with hazelnuts
    [image_url] => https://static.openfoodfacts.org/images/products/20203467/front_fr.4.400.jpg
    ...
)

```

... or find in other product databases:

```
$beauty = OpenBeautyFacts::barcode('8718951087460');

$pet = OpenPetFoodFacts::barcode('8714265000263'); // Note: underlying product database is under construction
```

#### Find products that match a search term:

[](#find-products-that-match-a-search-term)

```
$collection = OpenFoodFacts::find('Coca Cola Zero');

// returns a Illuminate\Support\Collection of arrays with details of each product found
```

Also works with:

```
$pet = OpenPetFoodFacts::find('Yarrah');
$beauty = OpenBeautyFacts::find("Deodorant Alum");
```

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

[](#contributing)

You're very welcome to contribute. We coordinate on the Open Food Facts slack, on the #PHP channel : Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

License
-------

[](#license)

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

Using this SDK and Third party applications
-------------------------------------------

[](#using-this-sdk-and-third-party-applications)

- If you use this SDK, feel free to open a PR to add your application in the list in [REUSERS.md](https://github.com/openfoodfacts/openfoodfacts-laravel/blob/develop/REUSERS.md)
- Make sure you comply with the OdBL licence, mentioning the Source of your data, and ensuring to avoid combining non free data you can't release legally as open data. Another requirement is contributing back any product you add using this SDK.
- Please get in touch at
- We are very interested in learning what the Open Food Facts data is used for. It is not mandatory, but we would very much appreciate it if you tell us about your re-uses () so that we can share them with the Open Food Facts community. You can also fill this form to get a chance to get your app featured:

Authors
-------

[](#authors)

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance96

Actively maintained with recent releases

Popularity46

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~154 days

Total

12

Last Release

28d ago

PHP version history (4 changes)v0.1PHP &gt;=7.2.5

v0.3.0PHP ^8.0.2

v0.4.0PHP ^8.1

v0.7.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/04ae98a418754a2b7859ec3db6d9a37c07dcf2b3034e6ff5ad93c5cee027b5ea?d=identicon)[openfoodfacts](/maintainers/openfoodfacts)

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

---

Top Contributors

[![epalmans](https://avatars.githubusercontent.com/u/7260915?v=4)](https://github.com/epalmans "epalmans (69 commits)")[![teolemon](https://avatars.githubusercontent.com/u/1689815?v=4)](https://github.com/teolemon "teolemon (43 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (28 commits)")[![Dwarfex](https://avatars.githubusercontent.com/u/721721?v=4)](https://github.com/Dwarfex "Dwarfex (23 commits)")[![Benoit382](https://avatars.githubusercontent.com/u/5646257?v=4)](https://github.com/Benoit382 "Benoit382 (9 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (6 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (4 commits)")[![marcelorodrigo](https://avatars.githubusercontent.com/u/443962?v=4)](https://github.com/marcelorodrigo "marcelorodrigo (4 commits)")[![f-blanc](https://avatars.githubusercontent.com/u/147386903?v=4)](https://github.com/f-blanc "f-blanc (2 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (2 commits)")[![deepsource-autofix[bot]](https://avatars.githubusercontent.com/in/57168?v=4)](https://github.com/deepsource-autofix[bot] "deepsource-autofix[bot] (2 commits)")[![Quadrubo](https://avatars.githubusercontent.com/u/71718414?v=4)](https://github.com/Quadrubo "Quadrubo (1 commits)")[![deepsourcebot](https://avatars.githubusercontent.com/u/60907429?v=4)](https://github.com/deepsourcebot "deepsourcebot (1 commits)")

---

Tags

foodhacktoberfestlaravellaravel-packagenutritionopenfoodfactsphpphplaravelopenfoodfacts

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/openfoodfacts-openfoodfacts-laravel/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.0k](/packages/simplestats-io-laravel-client)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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