cocktail-api-search

1.0.21 • Public • Published

TheCockTailDB

API refer to https://www.thecocktaildb.com/api.php Email: zag@kodi.tv

*Requires npm axios

I created this npm package to communicate to the Open Source Cocktail DB API to help others and automate this task. This was submitted to the Open Source Cocktail API DB Forum .

https://github.com/MrHenryA/NPM-CocktailDB-API-Search

Example

https://MrHenryA.github.io/React-Cocktail/

  • NPM package gets installed, the param is set to "term" that is equal to the value of s. Which will search by name, this can be changed to how ever you like. Search bar has a value of term. Term sets the param ?s="term" which results in searching by cocktail name. It is not mobile friendly/optimized or too responsive, used as a learning experience to expand my knowledge on React.

API Keys

You can use the test API key "1" during development of your app or for educational use However you must apply for a key a production API key via email if releasing publicly on an appstore. The test key may be revoked at any time if abused.

API Methods

Search cocktail by name

https://www.thecocktaildb.com/api/json/v1/1/search.php?s=margarita

Search ingredient by name

https://www.thecocktaildb.com/api/json/v1/1/search.php?i=vodka

Lookup full cocktail details by id

https://www.thecocktaildb.com/api/json/v1/1/lookup.php?i=13060

Lookup a random cocktail

https://www.thecocktaildb.com/api/json/v1/1/random.php

Search by ingredient

https://www.thecocktaildb.com/api/json/v1/1/filter.php?i=Gin https://www.thecocktaildb.com/api/json/v1/1/filter.php?i=Vodka

Filter by alcoholic

https://www.thecocktaildb.com/api/json/v1/1/filter.php?a=Alcoholic https://www.thecocktaildb.com/api/json/v1/1/filter.php?a=Non_Alcoholic

Filter by Category

https://www.thecocktaildb.com/api/json/v1/1/filter.php?c=Ordinary_Drink https://www.thecocktaildb.com/api/json/v1/1/filter.php?c=Cocktail

Filter by Glass

https://www.thecocktaildb.com/api/json/v1/1/filter.php?g=Cocktail_glass https://www.thecocktaildb.com/api/json/v1/1/filter.php?g=Champagne_flute

List the categories, glasses, ingredients or alcoholic filters

https://www.thecocktaildb.com/api/json/v1/1/list.php?c=list https://www.thecocktaildb.com/api/json/v1/1/list.php?g=list https://www.thecocktaildb.com/api/json/v1/1/list.php?i=list https://www.thecocktaildb.com/api/json/v1/1/list.php?a=list

Package Sidebar

Install

npm i cocktail-api-search

Weekly Downloads

1

Version

1.0.21

License

ISC

Unpacked Size

3.38 kB

Total Files

3

Last publish

Collaborators

  • thisdudehenry