This is a simple API for movie recommendation based on user ratings. It provides endpoints to get movie recommendations and retrieve all available movie names.
- Python 3.7 or higher
- pip (Python package installer)
-
Clone the repository:
git clone https://github.com/your-username/movie-recommender-api.git
-
Navigate to the project directory:
cd movie-recommender-api
-
Install dependencies:
pip install -r requirements.txt
Run the following command to start the FastAPI server:
```bash
uvicorn api:app --reload
```
The API will be available at http://localhost:8000.
- URL:
/recommendations/{movie_name}
- Method: GET
- Description: Get a movie recommendation based on the provided movie name.
- Parameters:
movie_name
(str): The name of the movie for which to get a recommendation.
- Response:
movie_recommendation
(str): The recommended movie name.
- URL:
/movies
- Method: GET
- Description: Get all movie names available in the dataset.
- Response: List of movie names (List[str]).
To get a recommendation for the movie "Toy Story", you can send a GET request to the /recommendations/Toy Story
endpoint:
```bash
curl http://localhost:8000/recommendations/Tiy%20Story
```