Optional
init: RequestInitOptional
init: RequestInitOptional
options: { authToken?: string; baseUrl?: string }Add a product tag, returns error if the tag already exists
Tag to add or update with the following fields:
k
: keyv
: valueproduct
: barcodeversion
: if passed it should be equal to 1owner
: user_id of the owner of the tag (empty for public tags)Optional
comment?: stringComment
Optional
editor?: stringEditor
K
Optional
last_edit?: stringLast Edit Format: date-time
Optional
owner?: stringOwner
Product
V
Optional
version?: numberVersion
if the tag was added or updated
Get the list of keys with statistics
The keys list can be restricted to private tags from some owner.
Get the list of products that have a key
or key=value
if value
is provided
Optional
value: stringGet a list of existing tags for a product
Authentication: provide user/password and get a bearer token in return
Open Food Facts user_id (not email)
user password
the bearer token, to be used in later requests with usual "Authorization: bearer token" headers
Update a product tag, returns error if the tag does not exist
Tag to update with the following fields:
k
: keyv
: valueproduct
: barcodeversion
: version of the tag (must be equal to previous version + 1)owner
: user_id of the owner of the tag (empty for public tags)Optional
comment?: stringComment
Optional
editor?: stringEditor
K
Optional
last_edit?: stringLast Edit Format: date-time
Optional
owner?: stringOwner
Product
V
Optional
version?: numberVersion
if the tag was added or updated
Delete a product tag
Tag to delete with the following fields:
k
: keyv
: valueproduct
: barcodeversion
: version of the tag [required]owner
: user_id of the owner of the tag (empty for public tags)Optional
comment?: stringComment
Optional
editor?: stringEditor
K
Optional
last_edit?: stringLast Edit Format: date-time
Optional
owner?: stringOwner
Product
V
Optional
version?: numberVersion
if the tag was deleted
MDN Reference