---
title: "Upload Product Image"
method: POST
path: "/cgi/product_image_upload.pl"
tags: ["Images"]
---

# Upload Product Image

`POST /cgi/product_image_upload.pl`

## Request

- Base URL: `https://world.openfoodfacts.net`
- URL: `https://world.openfoodfacts.net/cgi/product_image_upload.pl`
- Auth: API key in cookie `session` and API key in header `User-Agent`

Photos are source and proof of data.
The first photo uploaded for a product is
auto-selected as the product’s “front” photo.'

## Request body `multipart/form-data`

- object: Properties that goes in change ref
  - `code` string, required: Barcode of the product
  - `imagefield` string, required: Indicates the type of the image and the corresponding language. It should be in the format `{IMAGE_TYPE}_{LANG}` format, where `IMAGE_TYPE` is one of `front|ingredients|nutrition|packaging` and `LANG` is the 2 letter language code. Use `other` with no language code if you don't want the image to be selected. Note that the first image of a product is always selected as front picture.
  - `imgupload_front_en` string, binary, required: This field must contain image binary content. The format and extension must be one of gif|jpeg|jpg|png|heic. This field is dynamic and dependent on the value of imagefield in the request body. It wil be imgupload_the value of the imagefield stated earlier. For example, if `imagefield=front_en`, the name of this field should be `imageupload_front_en`.
  - `comment` string: A comment on the contribution. It will be shown in product changes history. Adding meaningful comments help moderators and users understand a single product history.
  - `app_name` string: Name of the app providing the information
  - `app_version` string: Version of the app providing the information
  - `app_uuid` string: When an app uses a single user to log its contributions, it might be interesting to know which user of the app is providing the information. You can use this field to provide an identifier (eg: an sha1 of the username) that's privacy preserving. Make sure that your salt is strong, perfectly random and secret In case we have trouble with one of your user, it helps our moderators revert edits.
  - `User-Agent` string: It is required that you pass a specific User-Agent header when you do an API request. But some times it's not possible to modify such a header (eg. request using JavaScript in a browser). In such cases, you can override it with this parameter.

## Response `200`

OK

- AddPhotoToExistingProduct
  - `files` object[]
    - `url` string
    - `filename` string
    - `name` string
    - `thumbnailUrl` string
    - `code` string
  - `image` object
    - `thumb_url` string
    - `imgid` integer
    - `crop_url` string
  - `imgid` integer
  - `status` string
  - `imagefield` string
  - `code` string

## Changes

- **2026-11-18** `ebaef6823f1f`: 2 breaking, 1 warning, 6 info
  - added `#/components/schemas/add_photo_to_existing_product_2, #/components/schemas/change_ref_properties` to the request body `allOf` list
  - the response's body type changed from no type to `object` for status `200`
  - removed `#/components/schemas/add_photo_to_existing_product.yaml, #/components/schemas/change_ref_properties.yaml` from the request body `allOf` list
  - added the optional property `code` to the response with the `200` status
  - …5 more
- **2025-07-02** `96b4f64cbc65`: 2 info
  - api tag `Images` added
  - api tag `Upload Images` removed
- **2025-07-02** `7193ad484e5d`: 2 info
  - api tag `Upload Images` added
  - api tag `Write Requests` removed
- **2025-05-26** `62cdffa6beab`: 1 breaking
  - added `#/components/schemas/add_photo_to_existing_product.yaml, #/components/schemas/change_ref_properties.yaml` to the request body `allOf` list

[Operation history](https://skmtc.dev/openfoodfacts/apis/open-food-facts-open-api/changes/cgi/product_image_upload.pl/post.md)

---

[API](https://skmtc.dev/openfoodfacts/apis/open-food-facts-open-api.md) - [All operations](https://skmtc.dev/openfoodfacts/apis/open-food-facts-open-api/llms.txt) - [OpenAPI document](https://skmtc.dev/openfoodfacts/apis/open-food-facts-open-api/revisions/ebaef6823f1f?raw)
