---
title: "Upload Product Image"
method: POST
path: "/api/v3/product/{code}/images"
tags: ["Images"]
---

# Upload Product Image

`POST /api/v3/product/{code}/images`

## Request

- Base URL: `https://world.openfoodfacts.org`
- URL: `https://world.openfoodfacts.org/api/v3/product/{code}/images`
- Auth: API key in cookie `session` and API key in header `User-Agent`

This endpoint allows to upload an image for a product. The image is uploaded in the request body as a base64 encoded string.
Optionally, it is possible to select the uploaded image for specific information (e.g. front, ingredients, nutrition, packaging) for specific languages. Each selected image is a cropped version of the uploaded image.

If the product does not exist, it will be created.

## Path parameters

- `code` string, required

## Request body

- object
  - `lc` string: 2 letter code of the language of the interface. Used for localizing some fields in returned values (e.g. knowledge panels). If not passed, the language may be inferred by the country of the user (passed through the cc field or inferred by the IP address). Full list at https://static.openfoodfacts.org/data/taxonomies/languages.json
  - `cc` string: 2 letter code of the country of the user. Used for localizing some fields in returned values (e.g. knowledge panels). If not passed, the country may be inferred by the IP address of the request. Full list at https://static.openfoodfacts.org/data/taxonomies/countries.json
  - `user_id` string: Username for login Note: you must always use the username (and not the email) as it is far less brittle.
  - `password` string, password: Password for login
  - `image_data_base64` string: Base64 encoded image data (supported formats: JPEG, PNG, GIF, HEIC)
  - `selected` ImagesSelected: Optional instructions to select (and possibly crop) the uploaded image for specific information (e.g. front, ingredients, nutrition, packaging) for specific languages.
    - `front` unknown
    - `ingredients` unknown
    - `nutrition` unknown
    - `packaging` unknown

## Response `200`

The response will include a "product" structure. The fields returned in this structure will depend on the value of the "fields" input field:

- "updated" (default): all fields updated by the query will be returned, including fields that are directly generated from the updated fields. For instance, sending "packagings" or "packagings_add" will return the "packagings" field.

- "none": no fields are returned.

- "all": returns all fields except generated fields that need to be explicitly requested such as "knowledge_panels".

The "fields" values can also be concatenated: "all,knowledge_panels"

- object: A response object to describe if a READ or WRITE request was successful or not, and if there were errors or warnings, and what the impact of those errors or warnings was.
  - `status` 'success' | 'success_with_warnings' | 'success_with_errors' | 'failure': Overall status of the request: whether it failed or succeeded, with or without warnings or errors.
  - `result` object: Overall result of the request (e.g. a product has been created)
    - `id` string: Identifier of a response result entry
    - `name` string: Name of the response result entry in English.
    - `lc_name` string: Name of the response result entry in the language specified in tags_lc, if supplied.
  - `warnings` WarningOrError[]: List of warnings. Warnings are used to alert about something that may be wrong, but is not necessarily wrong (e.g. a nutrient value that is unexpectedly high).
    - `message` object
      - `id` string: Identifier of a response message.
      - `name` string: Name of the response message entry in English.
      - `lc_name` string: Name of the response message entry in the language specified in tags_lc, if supplied.
      - `description` string: Description of the problem specific to the request, in English.
      - `lc_description` string: Description of the problem specific to the request, in the language specified in tags_lc, if supplied.
    - `field` object: Field that triggered the warning or error.
      - `id` string: Name of the field that triggered the warning or error.
      - `value` string: Value of the field that triggered the warning or error.
    - `impact` object
      - `id` string
      - `name` string
      - `lc_name` string
      - `description` string
      - `lc_description` string
  - `errors` WarningOrError[]: List of errors. Errors are used to alert about something that is definitely wrong (e.g. a nutrient value that is impossibly high).
    - `message` object
      - `id` string: Identifier of a response message.
      - `name` string: Name of the response message entry in English.
      - `lc_name` string: Name of the response message entry in the language specified in tags_lc, if supplied.
      - `description` string: Description of the problem specific to the request, in English.
      - `lc_description` string: Description of the problem specific to the request, in the language specified in tags_lc, if supplied.
    - `field` object: Field that triggered the warning or error.
      - `id` string: Name of the field that triggered the warning or error.
      - `value` string: Value of the field that triggered the warning or error.
    - `impact` object
      - `id` string
      - `name` string
      - `lc_name` string
      - `description` string
      - `lc_description` string
  - `product` object
    - `images` object
      - `uploaded` object: List with only the image just uploaded by the user. The key is the image id (imgid) and the value is an object with the image data.

## Changes

- **2026-11-18** (v3) `ab04ff78cb83`: 3 breaking, 1 warning, 8 info
  - added `#/components/schemas/lc_cc` to the request body `allOf` list
  - the `allOf[subschema #2]/selected` request property type changed from no type to `object`
  - the `allOf[subschema #2]/product/images/uploaded/patternProperties[(?<imgid>\d+)]/` response's property type changed from no type to `object` for status `200`
  - removed `#/components/schemas/lc_cc.yaml` from the request body `allOf` list
  - …8 more

[Operation history](https://skmtc.dev/openfoodfacts/apis/open-food-facts-open-api-v3-under-development/changes/api/v3/product/:code/images/post.md)

---

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