Skip to content

API for picking a random restaurant from Just Eat to order from

License

Notifications You must be signed in to change notification settings

CalemRoelofs/just-eat-roulette

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Just Eat Roulette

Hungry but don't know what you want?
Sick of scrolling endlessly through that white and orange page?
Then this is the API for you!
Just Eat Roulette will pick a semi-random* restaurant from Just Eat within your area for you, eliminating choice paralysis and letting you get food ASAP.

* Results are weighted on a combination of restaurant rating and expected delivery times

A demo of this API can be found at https://just-eat-roulette-api.fly.dev/

DISCLAIMER: This project is in no way affiliated with JUST EAT LIMITED or any subsidiaries

Features

  • Picks a restaurant to order from for you
    • (/restaurants/roulette?lat=<latitude>&lon=<longitude>&country_code=<see below>)
  • Supports all countries where Just Eat is available
    • Ireland (ie)
    • United Kingdom (uk)
    • Denmark (dk)
    • Spain (es)
    • Italy (it)
    • Norway (no)
    • Australia (au)
    • New Zealand (nz)
  • Supports pulling a list of all restaurants nearby with the /restaurants endpoint, sorting by
    • Average delivery time (sort_method=delivery_time)
    • Average rating (sort_method=rating)
  • OpenAPI documentation thanks to FastAPI (try /docs)

Quick start

Installation

It's recommended to run this application using Docker like so:

$ docker build -t calemroelofs/just-eat-roulette:latest .
$ docker run -p 8000:8000 calemroelofs/just-eat-roulette:latest

For running locally, see Developing and contributing

Usage

Once the application is up an running, you can access the API documention via the /docs endpoint.

However, to demonstrate some basic usage:

$ curl "http://localhost:8000/restaurants/roulette?lat=53.34979241036657&lon=-6.260254383087159&country_code=ie" | jq .

{
  "name": "Honey Bun Bakery & Coffee",
  "url": "https://www.just-eat.ie/restaurants-honey-bun-bakery-and-coffee-dublin-1",
  "rating": 4.6,
  "cuisines": [
    "Sandwiches / Wraps",
    "Coffee"
  ],
  "delivery_time": 45
}

Developing and contributing

PRs are more than welcome! Please include tests for your changes :)

The package uses poetry to manage dependencies. To setup your dev env:

$ poetry install && poetry shell

To then run the application with hot reloading:

$ poetry run uvicorn just_eat_roulette.server.server:app --reload

To run the tests:

$ poetry run pytest

About

API for picking a random restaurant from Just Eat to order from

Resources

License

Stars

Watchers

Forks

Packages

No packages published