Jump to content

API/Read: Difference between revisions

170 bytes added ,  31 May 2019
No edit summary
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.
72

edits