New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Barcode lookup via online database #6

gruessung opened this Issue Apr 19, 2018 · 3 comments


2 participants
Copy link

gruessung commented Apr 19, 2018

To add a product it would be useful to only need the barcode.
grocy could look into different online "barcode to product" databases, like to get all neccesary information.

@berrnd berrnd added the enhancement label Apr 19, 2018

@berrnd berrnd changed the title Feature Request: Barcode to product over external database Barcode lookup via online database Apr 19, 2018


This comment has been minimized.

Copy link

berrnd commented Apr 19, 2018

It seems that the API of is not free and also only available for commercial purposes.
When doing this, it would be best to do it in an "plugin like" way, not hardcode to a specific service...

The information to get would be currently only the name and the quantity unit (would need a mapping to own quantity units).

When the major bunch of products are added to the database, from my personal experience with grocy in nearly 1 year daily use, it's not a big problem:

  • I keep generic named products only in my database (means for example I only have "Chocolate", although I buy it from different brands)
  • To a product multiple barcodes can be assigned (different brands of chocolate...)
  • Assigning unknown barcodes and creating products can be directly done in a kind of "workflow" during purchase scanning (a popup appears when you leave the product input field when something unknown was entered)

This comment has been minimized.

Copy link

gruessung commented Apr 20, 2018

Yes, it would better to establish a modular way.
The API of is not free, right. But all datasets are licensed under GNU. Some times ago i build a wrapper for this website to extract all neccesarry data out of the source code.
If you provice a plugin api for grocy, i would create a plugin for


@gruessung gruessung referenced this issue Apr 20, 2018


Document API #5

berrnd added a commit that referenced this issue Apr 22, 2018


This comment has been minimized.

Copy link

berrnd commented Apr 22, 2018

This is now also done - I added a kind of plugin like system to lookup products by barcodes, see the reference implementation of such a plugin in data/plugins/DemoBarcodeLookupPlugin.php

In short:
Via the REST API at /api/stock/external-barcode-lookup/123456 products can be looked up by barcode via the configured plugin.

Additionally when also ?add=true is provided, on a successful lookup the product is also added to the database and in the output the new product id is included.

Direct link to the API documentation:

Maybe this works for you...


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment