Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twickets Ticket Scraper

A Python scraper for extracting ticket listings from Twickets.live using the ScrapingAnt web scraping API.

Features

  • Scrapes ticket listings from Twickets browse page
  • Extracts comprehensive ticket details:
    • Event title
    • Event date/time (ISO format + readable components)
    • Venue name
    • City/location
    • Section type (e.g., Stalls, Standing, Circle)
    • Seat details (section, row)
    • Ticket count
    • Price
    • Price declaration (face value, discounted, etc.)
    • Category
  • Supports multiple category filters for pagination
  • Exports data to CSV and JSON formats
  • Handles JavaScript-rendered content via ScrapingAnt
  • Deduplicates tickets automatically

Prerequisites

Note: The ScrapingAnt free plan has a concurrency limit of 1 thread. For higher throughput, consider upgrading to a paid plan.

Installation

  1. Clone this repository:
git clone https://github.com/kami4ka/twickets-scraper.git
cd twickets-scraper
  1. Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Set your ScrapingAnt API key:
export SCRAPINGANT_API_KEY="your_api_key_here"

Usage

Basic Usage

Scrape tickets from the browse page:

python main.py

Command Line Options

python main.py [OPTIONS]

Options:
  --category TEXT      Category filter: music, sports, theatre-arts, attractions, special-events
  --multi-category     Scrape multiple categories for more results
  -o, --output PATH    Output CSV file path (default: output/twickets_tickets.csv)
  --json               Also export to JSON format
  -v, --verbose        Enable verbose output
  --api-key TEXT       ScrapingAnt API key (or set SCRAPINGANT_API_KEY env var)

Examples

Scrape with verbose output:

python main.py --verbose

Scrape music events only:

python main.py --category music

Scrape multiple categories for more tickets:

python main.py --multi-category --verbose

Export to both CSV and JSON:

python main.py --json -o output/tickets.csv

Output Format

CSV Fields

Field Description Example
event_title Event name TINA: The Tina Turner Musical
datetime ISO datetime 2026-01-15T14:30:00Z
day_name Day of week Thu
day_number Day of month 15
month Month abbreviation Jan
venue Venue name Norwich Theatre Royal
city City/location Norwich
section_type Seat category Rear circle
seat_details Section and row Section REAR CIRCLE Row ROW L
ticket_count Number of tickets 2
price Price per ticket £47.65
price_declaration Pricing info Face value (+fees)
category Event category music

Sample Output

event_title,datetime,day_name,day_number,month,venue,city,section_type,seat_details,ticket_count,price,price_declaration,category
TINA: The Tina Turner Musical,2026-01-15T14:30:00Z,Thu,15,Jan,Norwich Theatre Royal,Norwich,Rear circle,Section REAR CIRCLE Row ROW L,2,£47.65,Face value (+fees),all
Biffy Clyro,2026-01-14T19:00:00Z,Wed,14,Jan,The O2 Arena,London,SEATS,Section 101 Row V,2,£88.15,Face value (+fees),music

Project Structure

TwicketsScraper/
├── config.py          # Configuration settings and CSS selectors
├── models.py          # Ticket and TicketCollection data classes
├── utils.py           # Utility functions for parsing
├── scraper.py         # Main scraper class
├── main.py            # CLI entry point
├── requirements.txt   # Python dependencies
├── .gitignore         # Git ignore patterns
├── output/            # Output directory for scraped data
│   └── .gitkeep
└── README.md          # This file

Pagination Note

Twickets uses JavaScript-based "Load more" pagination. Each page load shows approximately 10 tickets. To get more tickets, this scraper:

  1. Uses the --multi-category option to scrape different categories (music, sports, theatre-arts, attractions, special-events, all)
  2. Automatically deduplicates tickets across categories

For comprehensive ticket collection, use:

python main.py --multi-category --verbose

License

MIT License

Disclaimer

This scraper is for educational purposes only. Please respect Twickets' terms of service and rate limits when using this tool. Always ensure your scraping activities comply with applicable laws and website policies.

About

Python scraper for Twickets.live ticket listings using ScrapingAnt API

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages