sakethdevx/movie-details-scraper
0
TicketNew Movie Details Scraper API
A Python-based web scraper and FastAPI wrapper for TicketNew.com. It extracts currently playing movies, theater names, categorized showtimes, and booking links for over 1,100 cities across India.
๐ Features
- Automated Scraping: Uses Playwright to handle dynamic Next.js content and internal API interceptions.
- Comprehensive Data:
- Movie Titles & Movie Details
- Theater Names & Locations
- Categorized Showtimes: Automatically grouped into Morning, Afternoon, and Evening slots.
- Booking Links: Direct links to seat selection for each showtime.
- Dynamic Locations: Support for all 1,100+ cities supported by TicketNew.
- FastAPI Wrapper: Asynchronous API endpoints for high performance.
- Error Handling: Graceful 404/500 responses for invalid cities or connectivity issues.
๐ ๏ธ Tech Stack
- Python 3.10+
- FastAPI: API Framework
- Playwright: Browser automation and network interception
- BeautifulSoup4: HTML parsing
- Uvicorn: ASGI Server
โ๏ธ Installation
- Clone the repository:
git clone https://github.com/sakethdevx/movie-details-scraper.git
cd movie-details-scraper- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install fastapi uvicorn playwright beautifulsoup4
playwright install chromium๐ฅ๏ธ Usage
- Start the API server:
python main.py The server will run locally at http://127.0.0.1:8000.
- Endpoints:
- Get Available Cities:
GET /get-cities - Get Movie Showtimes:
GET /get-movies?city={city_slug}(e.g.,chennai,mumbai)
๐ Sample Outputs
1. Available Cities (/get-cities)
Returns a list of all supported locations.
{
"cities": [
{
"name": "Ahmedabad",
"slug": "ahmedabad",
"id": 1
},
{
"name": "Bengaluru",
"slug": "bengaluru",
"id": 2
},
...
],
"count": 1137
}2. Movie Details & Showtimes (/get-movies?city=chennai)
Returns categorized showtimes for each currently running movie.
{
"city": "chennai",
"listing_date": "2026-03-17",
"movies": [
{
"title": "Youth",
"theaters": [
{
"theatre_name": "Murugan Cinemas PLF 4K, Ambattur, Chennai",
"show_timings": {
"Morning": [],
"Afternoon": [],
"Evening": [
{
"time": "10:15 PM",
"link": "https://ticketnew.com/movies/seat-layout/..."
}
]
}
}
],
"movie_link": "https://ticketnew.com/movies/youth-movie-detail-213456"
}
],
"count": 12
}๐ค Contributing
Feel free to fork the repository and submit pull requests. For major changes, please open an issue first to discuss what you would like to change.
๐ License
MIT
