A content-based movie recommendation web app built with Streamlit, pandas, and scikit-learn, using The Movie Database (TMDB) API to fetch posters and metadata.
Users select a movie title and instantly receive similar movie recommendations displayed in a clean grid layout with posters.
https://movie-recommendator-eab5e0de6981.herokuapp.com


User
β
Streamlit UI
β
Content-Based Model (Cosine Similarity)
β
Pickle Files (movies.pkl + similarity.pkl)
β
TMDB API β Poster Images- Content-based recommendation using cosine similarity
- Interactive Streamlit UI
- Poster images fetched from TMDB API
- Responsive grid layout
- Ready for cloud deployment (Heroku-style Procfile included)
https://www.kaggle.com/datasets/tmdb/tmdb-movie-metadata?resource=download.
βββ app.py # Streamlit application
βββ movies.pkl # Movie metadata
βββ similarity.pkl # Precomputed similarity matrix
βββ movies_recommender_system.ipynb # Model training / preprocessing notebook
βββ Procfile # Deployment entrypoint
βββ requirements.txt # Python dependencies
βββ screenshots/ # App images
βββ README.md- Movie metadata is loaded from
movies.pkl. - A cosine-similarity matrix (
similarity.pkl) stores how close movies are to each other. - When a user selects a movie:
- The app finds the most similar titles.
- TMDBβs API is called to fetch poster images.
- Results are displayed in rows of five movies with titles and posters.
This project requires an API key from The Movie Database.
- Create an account at:
https://www.themoviedb.org - Generate an API key.
- Set it as an environment variable.
export TMDB_TOKEN="your_api_key_here"heroku config:set TMDB_TOKEN="your_api_key_here"TMDB_TOKEN = os.getenv("TMDB_TOKEN")pip install -r requirements.txt
streamlit run app.pyhttp://localhost:8501web: streamlit run app.py --server.port=$PORT --server.address=0.0.0.0git push heroku mainheroku logs --tail- Posters Not Showing
- Check TMDB key is valid
- Ensure HTTPS is used for images
- Confirm poster_path exists in the API response
- Restart Streamlit cache
- similarity.pkl may be too large for free dynos
- Missing dependencies in requirements.txt
- Wrong port binding in Procfile
- Streamlit config typos (server, not sever)
- Add movie overviews and ratings
- Cache poster URLs
- Show release year & genres
- Hybrid recommender with collaborative filtering
- Search instead of dropdown
- Database backend
- Python
- Streamlit
- pandas / NumPy
- scikit-learn
- Requests
- TMDB API
- Heroku
AI / Data Science Enthusiast Movie Recommendation Systems | NLP | ML Engineering