Open Food Facts Personal Search API

Endpoints for personalized search and recommendations.

Operations 2

GET /api/v2/attribute_groups Get Attribute Groups #
GET /api/v2/preferences Get Preferences Weights #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/open-food-facts-personal-search-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

open-food-facts-personal-search-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Open Food Facts Open Personal Search API
  description: 'As a developer, the Open Food Facts API allows you to get information

    and contribute to the products database. You can create great apps to

    help people make better food choices and also provide data to enhance the database.


    **IMPORTANT**: Please read the API introduction before using this API.'
  termsOfService: https://world.openfoodfacts.org/terms-of-use
  contact:
    name: Open Food Facts
    url: https://slack.openfoodfacts.org/
    email: reuse@openfoodfacts.org
  license:
    name: 'data: ODbL'
    url: https://opendatacommons.org/licenses/odbl/summary/index.html
    x-identifier: ODbL-1.0
  version: '2'
servers:
- description: dev
  url: https://world.openfoodfacts.net
- description: prod
  url: https://world.openfoodfacts.org
- description: proxy (for doc purpose)
  url: http://localhost:8080
security:
- userAgentAuth: []
tags:
- name: Personal Search
  description: Endpoints for personalized search and recommendations.
paths:
  /api/v2/attribute_groups:
    get:
      summary: Get Attribute Groups
      description: 'Attributes are at the heart of personal search.

        They score the products according to different criterias,

        which could then be matched to a user''s preferences.


        This API helps you list attributes and display them in your application,

        for the user to choose the importance of each criteria.


        note: `/api/v2/attribute_groups_{lc}` is also a valid route, but consider it deprecated'
      tags:
      - Personal Search
      operationId: get-attribute-groups
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                description: 'List of groups of attributes for personal search in a specific language.

                  '
                items:
                  title: attribute_group
                  type: object
                  properties:
                    id:
                      type: string
                      description: unique id of the group
                    name:
                      type: string
                      description: Name of the group
                    attributes:
                      type: array
                      description: 'Attributes that are part of this group

                        '
                      items:
                        title: attribute
                        type: object
                        properties:
                          id:
                            type: string
                            description: unique id of the attribute
                          name:
                            type: string
                            description: Name of the attribute
                          icon_url:
                            type: string
                            description: url of icon to display next to the settings for this attribute
                          setting_name:
                            type: string
                            description: a description of the attribute to display to users
                          setting_note:
                            type: string
                            description: a complementary note on the attribute
                          default:
                            type: string
                            enum:
                            - mandatory
                            - very_important
                            - important
                            - not_important
                            description: Indicates the default setting for this attribute
                          panel_id:
                            type: string
                            description: Linked knowledge panel (optional)
                title: get_attribute_groups_response
      parameters:
      - name: lc
        in: query
        description: '2 letter code of the language of the user.

          Used for localizing some fields in returned values (e.g. knowledge panels).

          If not passed, the language may be inferred by the domain name prefix.

          '
        required: false
        schema:
          type: string
          example: fr
  /api/v2/preferences:
    get:
      summary: Get Preferences Weights
      description: 'This endpoint retrieves the weights corresponding to attribute preferences

        for computing personal product recommendations. The weights are used to

        personalize the product recommendations based on user preferences.'
      tags:
      - Personal Search
      operationId: get-preferences
      parameters:
      - name: lc
        in: query
        description: '2 letter code of the language of the user.

          Used for localizing some fields in returned values (e.g. knowledge panels).

          If not passed, the language may be inferred by the domain name prefix.

          '
        required: false
        schema:
          type: string
          example: fr
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                title: get_preferences_response
                description: 'Rules to apply to compute personal ranking of a product,

                  based upon the setting value of each attribute.

                  '
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      description: id for the setting value
                      enum:
                      - not_important
                      - important
                      - very_important
                      - mandatory
                    name:
                      type: string
                      description: name for the setting value, translated according to `lc` parameter
                    factor:
                      type: integer
                      description: 'factor to apply to the property of the product corresponding to attributes

                        having this setting value

                        '
                    minimum_match:
                      type: integer
                      description: 'FIXME

                        '
components:
  securitySchemes:
    cookieAuth:
      type: apiKey
      in: cookie
      name: session
      description: 'Session cookie containing user ID, username, and session token.

        The value is structured as: user_id&username&user_session&session_token

        e.g. "user_id&exampleuser&user_session&abcdefghijklmnopqrstuvwxyz123456789ABCDEFGHIJKLM".

        The session token is obtained after successful login via the `/cgi/session.pl` endpoint.

        '
    userAgentAuth:
      description: Identification using the User-Agent header. This is recommended in all requests so that we can contact you if there are issues. If we cannot identify the source of problematic API queries, we may have to block them. User-Agent header in the format 'app_name/app_version (URL or contact info)'
      type: apiKey
      in: header
      name: User-Agent
externalDocs:
  description: '**IMPORTANT**: Please read the API introduction before using this API.

    '
  url: https://openfoodfacts.github.io/openfoodfacts-server/api/