Skip to content

RabdeepKaur/API_python_moive_fetch

Repository files navigation

TMDB Movie Data Tool

A simple CLI tool to fetch popular movies from TMDB API, store locally in SQLite, cache raw JSON responses, and query movies with filters.


Setup

  1. Clone the repository:
git clone <your-repo-url>
cd repo

Install dependencies

Instead of pip install -r requirements.txt, you can do:

uv install -r requirements.txt

Run your CLI commands

Fetch movies:

uv run api_tool.py fetch --pages 3


Query movies:

uv run api_tool.py filter --title "Avengers" --popularity_gt 50 --limit 5

Rate-limiting & Pagination

TMDB free-tier allows 40 requests per 10 seconds.

Tool handles pagination using --pages.

Retry/backoff logic can be added for reliability.

Outputs

Raw cached JSON: cache/movie_<id>.json

Filtered JSON results: output/filtered_movies_<timestamp>.json

About

Made this to learn about Rate Limiting , Backoffs , timeouts and jitter in API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages