Changes

Jump to navigation Jump to search
649 bytes added ,  10:11, 28 September 2022
no edit summary
Line 171: Line 171:  
</pre>
 
</pre>
   −
== List of taxonomies ==
+
== Getting taxonomies files ==
    
The definitions can be edited on [https://github.com/openfoodfacts/openfoodfacts-server/tree/master/taxonomies GitHub], they are periodically synchronized on the Open Food Facts database and web site.
 
The definitions can be edited on [https://github.com/openfoodfacts/openfoodfacts-server/tree/master/taxonomies GitHub], they are periodically synchronized on the Open Food Facts database and web site.
   −
=== Taxonomies ===
+
=== Raw taxonomies ===
 
'''(on Github, account and VCS knowledge needed)'''
 
'''(on Github, account and VCS knowledge needed)'''
 
* [https://github.com/openfoodfacts/openfoodfacts-server/blob/master/taxonomies/test.txt Test taxonomy] showing the basic taxonomy definition features
 
* [https://github.com/openfoodfacts/openfoodfacts-server/blob/master/taxonomies/test.txt Test taxonomy] showing the basic taxonomy definition features
Line 197: Line 197:  
* [https://github.com/openfoodfacts/openfoodfacts-server/blob/master/taxonomies/nova_groups.txt Global NOVA groups taxonomy]
 
* [https://github.com/openfoodfacts/openfoodfacts-server/blob/master/taxonomies/nova_groups.txt Global NOVA groups taxonomy]
   −
'''JSON format'''
+
=== '''Taxonomies in JSON format''' ===
 
   
Every taxonomy is also available as a json on OpenFoodFacts. Use  
 
Every taxonomy is also available as a json on OpenFoodFacts. Use  
 
* <code><nowiki>https://static.openfoodfacts.org/data/taxonomies/</nowiki><taxonomy name>.json</code>
 
* <code><nowiki>https://static.openfoodfacts.org/data/taxonomies/</nowiki><taxonomy name>.json</code>
Line 206: Line 205:  
* https://static.openfoodfacts.org/data/taxonomies/categories.json
 
* https://static.openfoodfacts.org/data/taxonomies/categories.json
 
* https://static.openfoodfacts.org/data/taxonomies/categories-full.json
 
* https://static.openfoodfacts.org/data/taxonomies/categories-full.json
 +
 +
=== Taxonomy API ===
 +
We have a basic taxonomy API to get information about a taxonomy.
 +
 +
Eg. to get information about ''en:carrots'' entry in ''categories'' taxonomy:
 +
 +
https://world.openfoodfacts.org/api/v2/taxonomy?tagtype=categories&tags=en:carrots
 +
 +
you can add ''lc'' (language code) parameter to ask for more than one language. ''cc'' is used for country code.
 +
 +
Eg. to add french information on previous request:
 +
 +
[https://world.openfoodfacts.org/api/v2/taxonomy?tagtype=categories&tags=en:carrots&lc=en%2Cfr&cc=fr https://world.openfoodfacts.org/api/v2/taxonomy?tagtype=categories&tags=en:carrots&lc=en,fr&cc=fr]
    
=== Draft Taxonomies ===
 
=== Draft Taxonomies ===
229

edits

Navigation menu