Thanks to visit codestin.com
Credit goes to github.com

Skip to content

kami4ka/dice-scraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DICE Event Scraper

A Python scraper for extracting event listings from DICE.fm using the ScrapingAnt web scraping API.

Features

  • Scrapes event listings from DICE.fm
  • Extracts comprehensive event details:
    • Event ID
    • Event title
    • Date
    • Venue
    • Price (including "Free" events)
    • Event image URL
    • Direct event URL
  • Supports multiple cities (Berlin, London, New York, etc.)
  • Supports multiple event categories (Gigs, DJ, Podcast, Talks)
  • Exports data to CSV and JSON formats
  • Deduplicates events 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/dice-scraper.git
cd dice-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 events from DICE (default: Berlin, popular + gigs categories):

python main.py

Command Line Options

python main.py [OPTIONS]

Options:
  --city TEXT            City to scrape (default: berlin)
  --category TEXT        Scrape a specific category only
  --categories TEXT...   Scrape multiple specific categories
  --all-categories       Scrape all available categories
  -o, --output PATH      Output CSV file path (default: output/dice_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-cities          List available cities and exit
  --list-categories      List available categories and exit

Examples

Scrape with verbose output:

python main.py --verbose

Scrape gigs in Berlin:

python main.py --city berlin --category gigs --verbose

Scrape multiple categories:

python main.py --categories popular gigs dj --verbose

Scrape all categories:

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

Export to both CSV and JSON:

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

List available cities:

python main.py --list-cities

List available categories:

python main.py --list-categories

Available Cities

  • berlin - Berlin, Germany
  • london - London, UK
  • los-angeles - Los Angeles, USA
  • new-york - New York, USA
  • paris - Paris, France

Available Categories

  • popular - Popular/trending events (default browse page)
  • gigs - Live music gigs
  • dj - DJ sets and electronic music
  • podcast - Live podcast recordings
  • talks - Talks and discussions

Output Format

CSV Fields

Field Description Example
event_id Unique event identifier 2w7nk6
event_title Event name 82Major: Berlin
date Event date Wed 25 Mar
venue Venue name Columbia Theater
price Ticket price From €39.50
event_url Direct link to event https://dice.fm/event/...
image_url Event image URL https://dice-media.imgix.net/...
city City name berlin
category Event category gigs
scraped_at Timestamp of scraping 2026-01-02T10:30:00Z

Sample Output

event_id,event_title,date,venue,price,event_url,image_url,city,category,scraped_at
2w7nk6,82Major: Berlin,Wed 25 Mar,Columbia Theater,From €39.50,https://dice.fm/event/2w7nk6-82major-berlin-25th-mar-columbia-theater-berlin-tickets,https://dice-media.imgix.net/...,berlin,popular,2026-01-02T10:30:00Z

Project Structure

DiceScraper/
├── config.py          # Configuration settings
├── models.py          # Event and EventCollection 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 category pages as a form of pagination. Each category (Gigs, DJ, Podcast, etc.) shows different events. By scraping multiple categories, you can collect comprehensive event data.

The site uses React with styled-components and renders content via JavaScript. ScrapingAnt's browser rendering capability ensures complete page loading before extraction.

License

MIT License

Disclaimer

This scraper is for educational purposes only. Please respect DICE.fm'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 DICE.fm event listings using ScrapingAnt API

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages