Changes

Jump to navigation Jump to search
204 bytes added ,  08:57, 5 November 2019
no edit summary
Line 4: Line 4:  
[[API|← Back to API]] (required read)
 
[[API|← Back to API]] (required read)
   −
'''Please send a UserAgent HTTP Header with the name of the app/service querying, the version, system and an URL if you have one''', so that you are not blocked by mistake.
+
'''Please send a User-Agent HTTP Header with the name of the app/service querying, the version, system and an URL if you have one''', so that you are not blocked by mistake.
   −
Example: <code>UserAgent: CoolFoodApp - Android - Version 1.0 - https://coolfoodapp.com</code>
+
Example: <code>User-Agent: CoolFoodApp - Android - Version 1.0 - https://coolfoodapp.com</code>
    
== Downloading static data ==
 
== Downloading static data ==
Line 68: Line 68:  
# https://ch-fr.openfoodfacts.org --> cc = ch, lc = fr (French)
 
# https://ch-fr.openfoodfacts.org --> cc = ch, lc = fr (French)
   −
=== Over-riding Country code (cc) and Language of the interface (lc) using cc and lc parameters ===
+
=== Overriding Country code (cc) and Language of the interface (lc) using cc and lc parameters ===
 +
You can pass the field cc (e.g. <code>?cc=us</code>) and/or the field lc (e.g. <code>?lc=it</code>) to customize the results.
 +
 
 +
For example, if you pass <code>?cc=us</code> and <code>&lc=it</code>, it will set the country to US and the language to Italian;
 +
if you just pass cc, the lc will be the one set in the subdomain.
 +
 
 +
e.g. <code>world.openfoodfacts.org?cc=frc</code> -> cc = fr, lc = en (default language of world)
   −
If you pass ?cc=us and/or &lc=it, it will set the country to US and the language to Italian
  −
-> if you just pass cc, the lc will be the one set in the subdomain.
  −
e.g. world.openfoodfacts.org + cc = fr --> cc = fr, lc = en (default language of world)
      
The cc affects which results are returned. cc = fr -> you get only products with France listed in the countries where sold field.
 
The cc affects which results are returned. cc = fr -> you get only products with France listed in the countries where sold field.
Line 82: Line 85:  
== Viewing a product ==
 
== Viewing a product ==
   −
[[API/Read/Product]]
+
Have a look at: [[API/Read/Product]]
    
== Searching for products ==
 
== Searching for products ==
   −
[[API/Read/Search]]
+
Have a look at: [[API/Read/Search]]
1

edit

Navigation menu