forked from dev-magdy/Shreyash-specs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
the-cocktail_db-0.0.2-swagger.yaml
535 lines (496 loc) · 19.1 KB
/
the-cocktail_db-0.0.2-swagger.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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
# Every Open API file needs this
openapi: 3.0.0
#docs metadata
info:
version: 0.0.2
title: TheCocktailDB
description: |
# Introduction
This document is a guide for developers who wish to use TheCocktailDB's database for their applications using its API. It contains an introduction to TheCocktailDB as well as an overview of its endpoints.
---
# TheCocktailDB Overview
TheCocktailDB is an open, crowdsourced database of cocktails and other drinks from around the world. Its JSON API lets users search for drinks based on various criteria, from a drink's name to the glass it's served in.
Patreon supporters with production API keys can access exclusive endpoints and parameters for more detailed searches.
For additional information, visit the [TheCocktailDB website](https://www.thecocktaildb.com/) or the [dedicated forum thread.](https://forum.kodi.tv/showthread.php?tid=235298) If you'd like to support us, you can do so at [our Patreon.](https://www.patreon.com/thedatadb/)
For all other questions and concerns, you can [contact the development team.](mailto:[email protected])
---
# TheCocktailDB Endpoints
## Search for drinks or ingredient
Searches TheCocktailDB's database by the following parameters:
* **Drink name,** returning all drinks that partially match the search term. For example, "jito" will return "Mojito" as well as "Mojito Extra" and "Blueberry Mojito."
* **First letter of drink name.** For example, "m" will return will return "Mojito" but not "Blueberry Mojito."
* **Ingredient name,** returning the exact ingredient that matches the search term. For example, "gin" will return "Gin," but not "ginger."
<br><br>
## Look up exact drink or ingredient
Looks up exact drinks or ingredients by the following parameters:
* **Drink ID,** returning the drink with that ID.
* **Ingredient ID,** returning the ingredient with that ID.
<br><br>
## Random drink
Searches for a single random drink.
<br><br>
## Filter drinks by criteria
Searches for the list of all drinks that fulfills a given criterion. The list of criteria is as follows:
* **Ingredient.** For example, filtering by "lime" will return all drinks in the database that contain lime.
* **Alcohol content.**
* **Drink category.** For example, filtering by "cocktail" will return all cocktails in the database; filtering by "beer" will return all beers.
* **Serving glass.** For example, filtering by "shot glass" will return all drinks in the database traditionally served in shot glasses.
<br><br>
## List available criteria
Searches for the list of all options for a criterion used by the filter endpoint. The list is as follows:
* **Ingredient.** Returns all ingredients in the database.
* **Alcohol content.** Returns all alcoholic classifications for drinks in the database.
* **Drink category.** Returns all drink categories in the database.
* **Serving glass.** Returns all serving glass types in the database.
servers:
- url: https://www.thecocktaildb.com/api/json/v1
description: Public server
# Endpoints
paths:
/1/search.php:
get:
operationId: searchDrinks
summary: Searches for drinks by name or by their first letter. Can also search for ingredients. Searches are not case sensitive.
tags:
- Public
parameters:
- name: s
description: |
Modifies the endpoint to search for drinks by name. Includes partial matches. For example, "jito" will return "Mojito" as well as "Mojito Extra" and "Blueberry Mojito."
Returns null if no results are found. Otherwise, returns an array containing one or more **drinkObject**.
in: query
schema:
type: string
required: false
- name: f
description: |
Modifies the endpoint to search for drinks by the first letter of their names. For example, "m" will return will return "Mojito" but not "Blueberry Mojito."
Returns null if no results are found. Otherwise, returns an array containing one or more **drinkObject**.
in: query
schema:
type: string
required: false
- name: i
description: |
Modifies the endpoint to search for ingredients by name. Does not include partial matches. For example, "gin" will return "Gin," but not "ginger."
Returns null if no results are found. Otherwise, returns an array containing an **ingredientObject**.
in: query
schema:
type: string
required: false
responses:
200:
description: Successful response
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/searchResultDrink'
- $ref: '#/components/schemas/searchResultIngredient'
/1/lookup.php:
get:
summary: Searches for drinks or ingredients by their exact ID in the database.
operationId: lookupDrinks
tags:
- Public
parameters:
- name: i
description: |
Modifies the endpoint to search for drinks by exact ID.
Returns null if no results are found. Otherwise, returns an array containing a **drinkObject**.
in: query
schema:
type: string
required: false
- name: iid
description: |
Modifies the endpoint to search for ingredients by exact ID.
Returns null if no results are found. Otherwise, returns an array containing an **ingredientObject**.
in: query
schema:
type: string
required: false
responses:
200:
description: Successful response
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/searchResultDrink'
- $ref: '#/components/schemas/searchResultIngredient'
/1/random.php:
get:
summary: Returns a random drink.
operationId: randomDrinks
tags:
- Public
responses:
200:
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/searchResultDrink'
/1/filter.php:
get:
summary: Filters drinks based on search criteria.
operationId: filterDrinks
tags:
- Public
parameters:
- name: i
description: |
Searches for drinks by ingredient.
Returns the string "None Found" if no result is found. Otherwise, returns an array containing one or more **filterObject**.
in: query
schema:
type: string
required: false
- name: a
description: |
Searches for drinks by alcohol content.
Returns an array containing one or more **filterObject**.
in: query
schema:
type: string
required: false
- name: c
description: |
Searches for drinks by their category.
Returns an array containing one or more **filterObject**.
in: query
schema:
type: string
required: false
- name: g
description: |
Searches for drinks by their serving glass.
Returns an array containing one or more **filterObject**.
in: query
schema:
type: string
required: false
responses:
200:
description: Successful response
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/searchResultFilter'
/1/list.php:
get:
summary: Returns the list of options for each parameter of the **filter** endpoint.
operationId: listDrinks
tags:
- Public
parameters:
- name: c
description: |
Lists the **c** (category) parameter's options.
Returns an array containing one or more **categoryListObject.**
in: query
schema:
type: string
enum: [list]
required: false
- name: g
description: |
Lists the **g** (glass) parameter's options.
Returns an array containing one or more **glassListObject.**
in: query
schema:
type: string
enum: [list]
required: false
- name: i
description: |
Lists the **i** (ingredient) parameter's options.
Returns an array containing one or more **ingredientListObject.**
in: query
schema:
type: string
enum: [list]
required: false
- name: a
description: |
Lists the **a** (alcoholic) parameter's options.
Returns an array containing one or more **alcoholicListObject.**
in: query
schema:
type: string
enum: [list]
required: false
responses:
200:
description: Successful response
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/searchResultListCategory'
- $ref: '#/components/schemas/searchResultListGlass'
- $ref: '#/components/schemas/searchResultListIngredient'
- $ref: '#/components/schemas/searchResultListAlcoholic'
components:
schemas:
searchResultDrink:
type: object
properties:
drinks:
type: array
description: The array of search results.
items:
$ref: '#/components/schemas/drinkObject'
drinkObject:
properties:
idDrink:
type: integer
description: The ID number of the drink in the database.
strDrink:
type: string
description: The name of the drink.
strDrinkAlternate:
type: string
description: The alternate name of the drink.
strTags:
type: string
description: All of the drink's metadata tags.
strVideo:
type: string
description: The URL for the video associated with the drink.
strCategory:
type: string
description: The metadata tag describing the drink's type.
strIBA:
type: string
description: The metadata tag describing the drink's International Bartenders Association (IBA) category.
strAlcoholic:
type: string
description: The metadata tag describing whether or not the drink is alcoholic.
strGlass:
type: string
description: The metadata tag describing the drink's serving glass.
strInstructions:
type: string
description: Instructions for making the drink in English.
strInstructionsES:
type: string
description: Instructions for making the drink in Spanish.
strInstructionsDE:
type: string
description: Instructions for making the drink in German.
strInstructionsFR:
type: string
description: Instructions for making the drink in French.
strInstructionsIT:
type: string
description: Instructions for making the drink in Italian.
strInstructionsZH-HANS:
type: string
description: Instructions for making the drink in Chinese Simplified Script.
strInstructionsZH-HANT:
type: string
description: Instructions for making the drink in Chinese Traditional Script.
strIngredient1:
type: string
description: Name of the first ingredient.
strIngredient2:
type: string
description: Name of the second ingredient.
strIngredient3:
type: string
description: Name of the third ingredient.
strIngredient4:
type: string
description: Name of the fourth ingredient.
strIngredient5:
type: string
description: Name of the fifth ingredient.
strIngredient6:
type: string
description: Name of the sixth ingredient.
strIngredient7:
type: string
description: Name of the seventh ingredient.
strIngredient8:
type: string
description: Name of the eighth ingredient.
strIngredient9:
type: string
description: Name of the ninth ingredient.
strIngredient10:
type: string
description: Name of the tenth ingredient.
strIngredient11:
type: string
description: Name of the eleventh ingredient.
strIngredient12:
type: string
description: Name of the twelfth ingredient.
strIngredient13:
type: string
description: Name of the thirteenth ingredient.
strIngredient14:
type: string
description: Name of the fourteenth ingredient.
strIngredient15:
type: string
description: Name of the fifteenth ingredient.
strMeasure1:
type: string
description: The exact amount of the first ingredient.
strMeasure2:
type: string
description: The exact amount of the second ingredient.
strMeasure3:
type: string
description: The exact amount of the third ingredient.
strMeasure4:
type: string
description: The exact amount of the fourth ingredient.
strMeasure5:
type: string
description: The exact amount of the fifth ingredient.
strMeasure6:
type: string
description: The exact amount of the sixth ingredient.
strMeasure7:
type: string
description: The exact amount of the seventh ingredient.
strMeasure8:
type: string
description: The exact amount of the eighth ingredient.
strMeasure9:
type: string
description: The exact amount of the ninth ingredient.
strMeasure10:
type: string
description: The exact amount of the tenth ingredient.
strMeasure11:
type: string
description: The exact amount of the eleventh ingredient.
strMeasure12:
type: string
description: The exact amount of the twelfth ingredient.
strMeasure13:
type: string
description: The exact amount of the thirteenth ingredient.
strMeasure14:
type: string
description: The exact amount of the fourteenth ingredient.
strMeasure15:
type: string
description: The exact amount of the fifteenth ingredient.
strImageSource:
type: string
description: The drink image's URL.
strImageAttribution:
type: string
description: The description of the image's source.
strCreativeCommonsConfirmed:
type: string
description: Whether or not the image has a Creative Commons license.
dateModified:
type: string
description: The date the drink was last modified. Format is YYYY-MM-DD HH:MM:SS.
searchResultIngredient:
type: object
properties:
ingredients:
type: array
description: The array of search results.
items:
$ref: '#/components/schemas/ingredientObject'
ingredientObject:
properties:
idIngredient:
type: integer
description: The ID number of the ingredient in the database.
strIngredient:
type: string
description: The name of the ingredient.
strDescription:
type: string
description: The description of the ingredient.
strType:
type: string
description: The type of the ingredient.
strAlcohol:
type: string
description: Whether or not the ingredient is alcoholic.
strABV:
type: string
description: The ABV (alcohol by volume) of the ingredient.
searchResultFilter:
type: object
properties:
drinks:
type: array
description: The array of search results.
items:
$ref: '#/components/schemas/filterObject'
filterObject:
properties:
strDrink:
type: string
description: The name of the drink.
strDrinkThumb:
type: string
description: The URL of the thumbnail of the drink's image.
idDrink:
type: integer
description: The ID number of the drink in the database.
searchResultListCategory:
type: object
properties:
drinks:
type: array
description: The array of search results.
items:
$ref: '#/components/schemas/categoryListObject'
categoryListObject:
properties:
strCategory:
type: string
description: The metadata tag describing the drink's type.
searchResultListGlass:
type: object
properties:
drinks:
type: array
description: The array of search results.
items:
$ref: '#/components/schemas/glassListObject'
glassListObject:
properties:
strGlass:
type: string
description: The metadata tag describing the drink's serving glass.
searchResultListIngredient:
type: object
properties:
drinks:
type: array
description: The array of search results.
items:
$ref: '#/components/schemas/ingredientListObject'
ingredientListObject:
properties:
strIngredient1:
type: string
description: The name of the ingredient.
searchResultListAlcoholic:
type: object
properties:
drinks:
type: array
description: The array of search results.
items:
$ref: '#/components/schemas/alcoholicListObject'
alcoholicListObject:
properties:
strAlcoholic:
type: string
description: The metadata tag describing whether or not the drink is alcoholic.