Upload product image
upload_imageUpload product images to the Open Food Facts database by specifying the barcode, image type, and base64-encoded photo. Supports front, ingredients, nutrition, packaging, and other angles.
Instructions
Upload a product image to Open Food Facts. Requires OFF_USER_ID and OFF_PASSWORD.
Prefer more photos over fewer. Panels with text (ingredients, nutrition, certifications, recycling instructions) are highest value as OFF can OCR them. Plain sides with just a colour or logo are lowest value but still worth uploading if you have them.
Use the most appropriate imagefield (front, ingredients, nutrition, packaging). Use "other" for additional photos — this uploads without selecting the image as a display image, which is useful when a good display image already exists or for supplementary angles.
The OFF server auto-selects images for front/nutrition/ingredients/packaging on upload unless one is already selected. If you get "status not ok" but a positive imgid, the image uploaded successfully but was not selected (e.g. a display image already exists).
For images on disk, base64-encode them first (e.g. via shell: base64 -i photo.jpg).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"barcode": "<barcode>",
"imagefield": "<imagefield>",
"image_data": "<image_data>"
},
"name": "upload_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lc | No | Language code for the image (default: en) | en |
| barcode | Yes | Product barcode | |
| image_data | Yes | Base64-encoded image data (JPEG or PNG) | |
| imagefield | Yes | Image type |