Skip to content

randomgrace/thecocktaildb-downloader

 
 

Repository files navigation

Build

TheCocktailDB Downloader

TheCocktailDB API offers over 500 drink recipes in JSON format. The API is great for many projects, but some need an offline version of the data. This project fetches data from TheCocktailDB for offline use.

How to get the data?

For most uses, here are dumps of the data returned by TheCocktailDB API on the 23rd of May, 2021:

Directory Content
without-images TypeScript typing (types.ts) and an array of all of the drinks (drinks.ts).
with-images As above, but includes images of the drinks. The thumbnailFilename property in the drink points to the matching image.

Please support TheCocktailDB when using the data for commercial purposes.

Getting fresh data

If the above data is too old for you, run the downloader to get fresh data:

  1. Install Node.js and Yarn
  2. yarn in the root project directory to fetch all dependencies
  3. yarn start to start the download process

Converting drinks.js to SQL

If you'd rather have the data in SQL format, perform these steps after running the downloader:

  1. Open drinks.ts with a text editor.
  2. Remove the following from the beginning of the file:
import { Drink } from "./types";

export const drinks: Drink[] =
  1. The file should now start with [{ and end with }]
  2. Save the file.
  3. Feed the file to a conversion tool, e.g. Convert JSON to SQL, to create the CREATE TABLE and INSERT statements to enter the data to your database.

Feature requests and bug reports

Both are welcome, just open an issue.

Projects using this data

If you've built a public project with this data and want the project mentioned here, make a PR.

About

Data from TheCocktailDB API for offline use

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%