Skip to content

kami4ka/ticket-compare-scraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ticket-Compare Football Scraper

A Python scraper for extracting football match listings from Ticket-Compare.com using the ScrapingAnt web scraping API.

Features

  • Scrapes football match listings from Ticket-Compare.com
  • Extracts comprehensive match details:
    • Match title (teams playing)
    • Event date/time
    • Competition (Premier League, Champions League, etc.)
    • Venue name
    • Location (city, country)
    • Ticket price (when available)
    • Available ticket count (when available)
    • Direct event URL
  • Supports multiple competition categories as pagination
  • Filter by specific competition category
  • Exports data to CSV and JSON formats
  • Deduplicates matches 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/ticket-compare-scraper.git
cd ticket-compare-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 football matches from Ticket-Compare (default: 2 competition categories):

python main.py

Command Line Options

python main.py [OPTIONS]

Options:
  --pages INT            Number of competition categories to scrape (default: 2)
  --category TEXT        Scrape a specific competition category only
  --main-page            Scrape the main football page only
  --all-categories       Scrape all available competition categories
  -o, --output PATH      Output CSV file path (default: output/ticket_compare_events.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)
  --list-categories      List available competition categories and exit

Examples

Scrape with verbose output:

python main.py --verbose

Scrape Premier League matches only:

python main.py --category premier-league --verbose

Scrape multiple competition categories:

python main.py --pages 3 --verbose

Scrape all available categories:

python main.py --all-categories --verbose

Export to both CSV and JSON:

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

List available competition categories:

python main.py --list-categories

Available Competition Categories

  • premier-league - English Premier League
  • uefa-champions-league - UEFA Champions League
  • la-liga - Spanish La Liga
  • serie-a - Italian Serie A
  • bundesliga - German Bundesliga
  • the-fa-cup - English FA Cup
  • uefa-europa-league - UEFA Europa League
  • efl-cup - EFL Cup (Carabao Cup)

Output Format

CSV Fields

Field Description Example
match_id Unique match identifier a1b2c3d4e5f6g7h8
match_title Teams playing Chelsea vs Arsenal
datetime Event date/time (ISO format) 2026-01-14T00:00:00Z
day_of_week Day of the week Wed
competition Competition name EFL Cup - Carabao Cup
venue Venue name Stamford Bridge
location City, Country London, United Kingdom
start_price Starting ticket price (EUR) 120.0
tickets_available Number of tickets available 1678
event_url Direct link to event https://ticket-compare.com/...

Sample Output

match_id,match_title,datetime,day_of_week,competition,venue,location,start_price,tickets_available,event_url
a1b2c3d4e5f6g7h8,Chelsea vs Arsenal,2026-01-14T00:00:00Z,Wed,EFL Cup - Carabao Cup,Stamford Bridge,"London, United Kingdom",120.0,1678,https://ticket-compare.com/football/efl-cup/chelsea-vs-arsenal-14-jan-2026/

Project Structure

TicketCompareScraper/
├── config.py          # Configuration settings
├── models.py          # Match and MatchCollection data classes
├── utils.py           # Utility functions
├── 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

How It Works

This scraper uses competition category pages as a form of pagination. Each category page (like Premier League, Champions League) contains a different set of matches. By scraping multiple categories, you can collect comprehensive match data across different competitions.

The site renders content server-side, so ScrapingAnt's browser rendering capability is used to ensure complete page loading.

License

MIT License

Disclaimer

This scraper is for educational purposes only. Please respect Ticket-Compare.com's 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 ticket-compare.com football matches using ScrapingAnt API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages