CoolFace
Apppublic

sakethdevx/movie-details-scraper

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
App README

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

  1. 1.Clone the repository:
bash
   git clone https://github.com/sakethdevx/movie-details-scraper.git
   cd movie-details-scraper
  1. 1.Create and activate a virtual environment:
bash
   python -m venv venv
   source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. 1.Install dependencies:
bash
   pip install fastapi uvicorn playwright beautifulsoup4
   playwright install chromium

๐Ÿ–ฅ๏ธ Usage

  1. 1.Start the API server:
bash
   python main.py

The server will run locally at http://127.0.0.1:8000.

  1. 1.Endpoints:
  2. 2.Get Available Cities: GET /get-cities
  3. 3.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.

json
{
  "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.

json
{
  "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