To add a product it would be useful to only need the barcode.
grocy could look into different online "barcode to product" databases, like http://opengtindb.org to get all neccesary information.
It seems that the API of opengtindb.org 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:
Yes, it would better to establish a modular way.
The API of opengtindb.org 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 opengtindb.org.
Edit: https://github.com/gruessung/IntelliFridge/blob/master/eanApi.php
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: https://demo-en.grocy.info/api#/Stock/get_stock_external_barcode_lookup__barcode_
Maybe this works for you...
:)
Most helpful comment
Yes, it would better to establish a modular way.
The API of opengtindb.org 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 opengtindb.org.
Edit: https://github.com/gruessung/IntelliFridge/blob/master/eanApi.php