A JavaScript version of the Foodish API to GET a random picture of food dishes.
Visit https://foodish-js.netlify.app/
Include the JS scripts in the <head>
tag of the HTML -
<script src="https://foodish-js.netlify.app/js/images.js"></script>
<script src="https://foodish-js.netlify.app/js/foodish.js"></script>
Add an <img>
with id='foodish'
to the HTML -
<img id="foodish" alt="foodish" />
Add a <script>
in the <body>
and get a random Foodish with getFoodish()
-
<script type="text/javascript">
getFoodish("random");
</script>
or get a random Foodish from food
category -
<script type="text/javascript">
getFoodish(foodCategory);
</script>
Please visit the demo website to view the list of available food
categories.
To get a random burger
-
<html>
<head>
<script src="https://foodish-js.netlify.app/js/images.js"></script>
<script src="https://foodish-js.netlify.app/js/foodish.js"></script>
</head>
<body>
<img id="foodish" alt="foodish" />
<script type="text/javascript">
getFoodish("burger");
</script>
</body>
</html>
- You are designing a restaurant website and you want to add random food pictures as placeholders.
- You are creating a guess the food dish game.
- You are ordering a pizza but you just want a random choice, visit https://foodish-js.netlify.app/?foodish=pizza because that's fun! Didn't like the pizza? Just hit refresh!
- You just like to see food pictures (visual hunger) because you eat with your eyes first.
Please note that I do not own any of the Foodish dataset images. All Foodish images and their ownership belong to their original creators.
Please create a new issue for support and issues.
Please read the CONTRIBUTING for details on adding images to the Foodish Database.
The project is licensed under MIT. Please read the LICENSE for details.