forked from dev-magdy/Shreyash-specs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nutiguide-api.yaml
175 lines (174 loc) · 4.65 KB
/
nutiguide-api.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
openapi: 3.0.3
info:
title: NutriGuide API
description: |
NutriGuide API gives information about registered products and helps you make better food choices.
termsOfService: https://world.openfoodfacts.org/terms-of-use
contact:
name: NutriGuide API
url: https://slack.openfoodfacts.org/
email: [email protected]
license:
name: "data: ODbL"
url: https://opendatacommons.org/licenses/odbl/summary/index.html
version: "2"
servers:
- url: https://world.openfoodfacts.org
description: prod
paths:
/api/v2/product/{barcode}:
get:
tags:
- Read Requests
summary: Get information for a specific product by barcode
description: Get information for a specific product by barcode
operationId: getFoodFact
parameters:
- name: barcode
in: path
description: |
The barcode of the product to be fetched. e.g: 3017620422003
required: true
style: simple
explode: false
schema:
type: string
example: "3017620422003"
- $ref: '#/components/parameters/fields'
responses:
"200":
description: OK
content:
application/json:
schema:
type: object
/api/v2/search:
get:
summary: Search for Products
# description: Search for Products
tags:
- Read Requests
responses:
"200":
description: OK
content:
application/json:
schema:
type: object
operationId: findFoods
description: |
You can use the search function to obtain nutritional data for products that meet your search criteria. If the search query parameter contains two values, they should be separated by a comma (,).
parameters:
- $ref: "#/components/parameters/fields"
- $ref: "#/components/parameters/sort_by"
- name: additives_tags
schema:
type: string
example: e322
in: query
description: "eg: e322"
- name: allergens_tags
schema:
type: string
example: m
in: query
description: "eg: m"
- name: brands_tags
schema:
type: string
example: ferrero
in: query
description: "eg: ferrero"
- name: categories_tags
schema:
type: string
example: chocolates
in: query
description: "eg: chocolates"
- name: countries_tags
schema:
type: string
example: united-kingdom
in: query
description: "complete country name, eg: united-kingdom"
- name: emb_codes_tags
schema:
type: string
in: query
- name: labels_tags
schema:
type: string
example: organic
in: query
description: "eg: organic"
- name: manufacturing_places_tags
schema:
type: string
in: query
- name: nutrition_grades_tags
schema:
type: string
example: e
in: query
description: "eg: e"
- schema:
type: string
in: query
name: origins_tags
- schema:
type: string
in: query
name: purchase_places_tags
- schema:
type: string
example: nutrition-facts-completed
in: query
name: states_tags
- schema:
type: string
example: aldi
in: query
name: stores_tags
- schema:
type: string
in: query
name: traces_tags
- schema:
type: integer
in: query
name: page_size
- schema:
type: integer
in: query
name: page
description: "1-indexed"
components:
parameters:
sort_by:
schema:
type: string
example: product_name
enum:
- product_name
- last_modified_t
- scans_n
- unique_scans_n
- created_t
- completeness
- popularity_key
- nutriscore_score
- nova_score
- nothing
- ecoscore_score
in: query
name: sort_by
fields:
schema:
type: string
example: "code,product_name,selected_images,nutriments"
in: query
name: fields
description: |
The fields to be returned, comma separated. eg: code,product_name,nutriments
tags:
- name: Read Requests