Changes

Jump to navigation Jump to search
21 bytes removed ,  21:21, 19 October 2016
Line 1,226: Line 1,226:  
==== General principles ====
 
==== General principles ====
 
===== Advanced Search =====
 
===== Advanced Search =====
 +
 +
====== Query examples ======
 +
<pre>http://world.openfoodfacts.org/cgi/search.pl?search_terms=coke&search_simple=1&jqm=1</pre>
 +
<pre>http://world.openfoodfacts.org/cgi/search.pl?search_terms=banania&search_simple=1&action=process&json=1</pre>
 +
<pre>http://world.openfoodfacts.org/cgi/search.pl?search_terms=banania&search_simple=1&action=process&xml=1</pre>
 +
 
====== Parameters ======
 
====== Parameters ======
 
You can basically use all the parameters you'd use in a [http://world.openfoodfacts.org/cgi/search.pl?action=display&sort_by=unique_scans_n&page_size=20&action=display graphical advanced search on the site]<br>
 
You can basically use all the parameters you'd use in a [http://world.openfoodfacts.org/cgi/search.pl?action=display&sort_by=unique_scans_n&page_size=20&action=display graphical advanced search on the site]<br>
      
<pre>
 
<pre>
   
search_url = "http://world.openfoodfacts.org/cgi/search.pl"
 
search_url = "http://world.openfoodfacts.org/cgi/search.pl"
 
search_terms2 # search terms
 
search_terms2 # search terms
Line 1,430: Line 1,434:  
json=1
 
json=1
 
xml=1
 
xml=1
#to search results pages on the web site to get results in a jquerymobile format.
+
#to search results pages on the web site to get results in a jQuery Mobile format.
 
jqm=1
 
jqm=1
 +
</pre>
          +
===== Generic Search =====
 +
====== Core principle: Combine tags to get custom results ======
 +
'''Combining tags is really powerful, letting you create thousands of custom APIs for your use case.'''
   −
</pre>
  −
  −
===== Examples<sup>(remember to do tests on world.openfoodfacts.net - login and password: off )</sup> =====
  −
<pre>http://world.openfoodfacts.org/cgi/search.pl?search_terms=coke&search_simple=1&jqm=1</pre>
  −
<pre>http://world.openfoodfacts.org/cgi/search.pl?search_terms=banania&search_simple=1&action=process&json=1</pre>
  −
<pre>http://world.openfoodfacts.org/cgi/search.pl?search_terms=banania&search_simple=1&action=process&xml=1</pre>
  −
  −
===== Generic Search =====
  −
====== Combining Tags to get custom results ======
  −
Combining tags works, letting you create thousands of APIs
   
* http://world.openfoodfacts.org/packager-code/emb-35069c/brand/sojasun.json
 
* http://world.openfoodfacts.org/packager-code/emb-35069c/brand/sojasun.json
  

Navigation menu