Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
API/Read
(view source)
Revision as of 21:14, 31 May 2019
170 bytes added
,
21:14, 31 May 2019
→Over-riding Country code (cc) and Language of the interface (lc) using cc and lc parameters
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.
Vaiton
72
edits
Navigation menu
Personal tools
Log in
Namespaces
Page
Discussion
Variants
Views
Read
View source
View history
More
Search
Navigation
Log in
Open Food Facts galaxy
📍Where am I?
🍊Open Food Facts website
Open Food Facts wiki
Main page
Recent changes
Random page
🧴 Open Beauty Facts wiki
Main page
Deep dive per topic
All topics
Whole wiki
Help about MediaWiki
Icons in the wiki
Tools
Special pages
Printable version
Admins
Edit sidebar
Styling
Replace text
Special Pages