Giter Club home page Giter Club logo

flask-imdb's Introduction

Prerequisites

Before running this API, ensure you have the following software installed:

  • Python 3.x
  • SQLite (for the database)

Installation

  • Clone this and move to the folder where you have cloned it.

  • pip install -r requirements.txt

  • python3 app.py

Curls

  • Register or log in a user by providing an email and password. The endpoint returns a JWT token for accessing protected endpoints. Movies
curl -X POST -H "Content-Type: application/json" -d '{
 "email": "[email protected]",
 "password": "password"
}' http://localhost:5000/auth
  • Retrieve a list of movies. You can use query parameters to filter and search for movies by name, director, genre, IMDb rating, and popularity.
curl http://localhost:5000/movies
  • Add a new movie (authentication required).
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <JWT-access-token>" -d '{
  "99popularity": 88.0,
  "director": "George Lucas",
  "genre": ["Action", "Adventure", "Fantasy", "Sci-Fi"],
  "imdb_score": 8.8,
  "name": "Star Wars"
}' http://localhost:5000/movies/add
  • Edit an existing movie (authentication required) No need to pass all the values if some fields are not passed it will use the previous ones.
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer <JWT-access-token>" -d '{
  "99popularity": 89.0,
  "director": "George Lucas",
  "genre": ["Action", "Adventure", "Sci-Fi"],
  "imdb_score": 9.0,
  "name": "Star Wars: Updated"
}' http://localhost:5000/movies/edit/<movie_id>
  • Remove a movie by ID (authentication required).
curl -X DELETE -H "Authorization: Bearer <JWT-access-token>" http://localhost:5000/movies/remove/<movie_id>
  • Searching Search for movies based on various criteria, including name, director, genre, IMDb rating , and popularity/popularity range.

  • Search Movies by Name

curl "http://localhost:5000/search?name=Star%20Wars"
  • Search movies by director:
curl "http://localhost:5000/search?director=George%20Lucas"
  • Search movies by multiple genres or a genre:
curl "http://localhost:5000/search?genre=Adventure&genre=Fantasy"

Search movies by IMDb rating range or wih just maximum and minimum:

curl "http://localhost:5000/search?min_rating=8.0&max_rating=9.0"
curl http://localhost:5000/search?max_rating=9.0
curl http://localhost:5000/search?min_rating=8.0

Search movies by popularity range or wih just maximum and minimum:

curl "http://localhost:5000/search?min_popularity=80.0&max_popularity=90.0"
curl "http://localhost:5000/search?min_popularity=80.0
curl "http://localhost:5000/search?max_popularity=80.0

flask-imdb's People

Contributors

chityanj avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.