Authentication

Login Session

Retrieve session cookie for writing operations.

POST
/cgi/session.pl
User-Agent<token>

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)'

In: header

user_idstring

Username for login

Note: you must always use the username (and not the email) as it is far less brittle.

passwordstring

Password for login

Formatpassword

Response Body

curl -X POST "https://world.openfoodfacts.net/cgi/session.pl" \  -H "Content-Type: application/x-www-form-urlencoded" \  -d 'user_id=string&password=pa%24%24word'
Empty
Empty