Changes

Jump to navigation Jump to search
837 bytes removed ,  13:35, 5 September 2023
no edit summary
Line 11: Line 11:     
== Search API v2 ==
 
== Search API v2 ==
A new search api (work in progress) is available, which is easier to use. See [[Open Food Facts Search API Version 2]]
+
A new search API (work in progress) is available, which is easier to use. See [[Open Food Facts Search API Version 2]]
    
= NEW version of the documentation =
 
= NEW version of the documentation =
   −
The new version of the documentation is available here:  
+
The new version of the documentation is available here: [https://openfoodfacts.github.io/openfoodfacts-server/introduction/api/ new version of the documentation as OpenAPI 3.1 (still a work in progress)] ([https://github.com/openfoodfacts/openfoodfacts-server/tree/main/docs/reference/ source])  
 
  −
* [https://openfoodfacts.github.io/openfoodfacts-server/introduction/api/ new version of the documentation as OpenAPI 3.1 (still a work in progress)] ([https://github.com/openfoodfacts/openfoodfacts-server/tree/main/docs/reference/ source])
  −
 
  −
* Previous [https://openfoodfacts.github.io/api-documentation version of the documentation]
      
We have many SDKs at the bottom of the page, and we also have official implementations for Android, iPhone (and Flutter) that you can draw inspiration from.
 
We have many SDKs at the bottom of the page, and we also have official implementations for Android, iPhone (and Flutter) that you can draw inspiration from.
Line 43: Line 39:  
It is also used by several applications and while not yet stable, doesn't change much.
 
It is also used by several applications and while not yet stable, doesn't change much.
   −
You can have a look at the source code of the apps ([[Mobile_App]])
+
You can take a look at the source code of the apps ([[Mobile_App]])
    
'''Anyone with Swagger (or equivalent knowledge) willing to help us document the API is most welcome :-)'''
 
'''Anyone with Swagger (or equivalent knowledge) willing to help us document the API is most welcome :-)'''
Line 56: Line 52:  
* You can do READ operations using the production server.
 
* You can do READ operations using the production server.
 
* You should use the SSL version of the API. <code>https://world.openfoodfacts.org</code>
 
* You should use the SSL version of the API. <code>https://world.openfoodfacts.org</code>
* '''Please send a UserAgent HTTP Header''' with the name of the app/service querying, the version, system and a URL if you have one, so that you are not blocked by mistake (e.g. <code>UserAgent: MyFoodApp - Android - Version 1.0 - https://myfoodapp.example.com</code>)
+
* '''Please send a User-Agent HTTP Header''' with the name of the app/service querying, the version, system and a URL if you have one, so that you are not blocked by mistake (e.g. <code>UserAgent: MyFoodApp - Android - Version 1.0 - https://myfoodapp.example.com</code>)
    
== WRITE operations ==
 
== WRITE operations ==
Line 77: Line 73:  
* fields that end with _datetime are dates in the iso8601 format: yyyy-mm-ddThh:mn:ssZ
 
* fields that end with _datetime are dates in the iso8601 format: yyyy-mm-ddThh:mn:ssZ
 
* fields that end with _tags are comma separated list of tags (e.g. categories_tags is the set of normalized tags computer from the categories field)
 
* fields that end with _tags are comma separated list of tags (e.g. categories_tags is the set of normalized tags computer from the categories field)
* fields that end with a language 2 letter code (e.g. fr for French) is the set of tags in that language
+
* fields that end with a language 2-letter code (e.g. fr for French) is the set of tags in that language
 
* fields that end with _100g correspond to the amount of a nutriment (in g) for 100 g or 100 ml of product
 
* fields that end with _100g correspond to the amount of a nutriment (in g) for 100 g or 100 ml of product
 
* keys must match BSON syntax, and may not contain `.` or `$`.  
 
* keys must match BSON syntax, and may not contain `.` or `$`.  
Line 119: Line 115:     
* Publishing the API on a faster server
 
* Publishing the API on a faster server
* Having a CI pipeline from the source repository to the published documentation
   
* Deprecating documentation on the wiki for good.
 
* Deprecating documentation on the wiki for good.
 
* Setting up a process to keep the API updated.
 
* Setting up a process to keep the API updated.
Line 131: Line 126:  
You can fill in the issue report [https://github.com/openfoodfacts/openfoodfacts-server/issues/new here on GitHub]
 
You can fill in the issue report [https://github.com/openfoodfacts/openfoodfacts-server/issues/new here on GitHub]
 
(For documentation issues, see below)
 
(For documentation issues, see below)
=== Keeping the documentation up to date with the live API ===
  −
* Project that tracks what we have to document: https://github.com/openfoodfacts/api-documentation/issues
  −
   
=== Known bugs ===
 
=== Known bugs ===
 
* General bugs: https://github.com/openfoodfacts/openfoodfacts-server/issues
 
* General bugs: https://github.com/openfoodfacts/openfoodfacts-server/issues
 
* API bugs: https://github.com/openfoodfacts/openfoodfacts-server/labels/api
 
* API bugs: https://github.com/openfoodfacts/openfoodfacts-server/labels/api
 
* API milestone: https://github.com/openfoodfacts/openfoodfacts-server/milestone/8
 
* API milestone: https://github.com/openfoodfacts/openfoodfacts-server/milestone/8
  −
=== Yet-Undocumented APIs ===
  −
* https://github.com/openfoodfacts/api-documentation
  −
  −
== Sister projects ==
  −
=== Open Pet Food Facts ===
  −
Open Pet Food Facts behaves just like Open Food Facts. Behaviours may change over time, as we tweak it.
  −
* https://world.openpetfoodfacts.org/api/v0/product/20106836.json
  −
  −
=== Open Beauty Facts ===
  −
[[API/OpenBeautyFacts]]
  −
  −
=== Open Products Facts ===
  −
Open Products Facts behaves mostly like Open Food Facts. Behaviours may change over time, as we tweak it.
 

Navigation menu