Hunt for the cheapest Deutsche Bahn train tickets with flexible routing, time preferences, and fun train emoji animations. Never overpay for train travel again!
- Flexible routing: Return from different cities (Berlin β Munich, Dortmund β Berlin)
- Multiple trip types: Same-day returns, multi-day trips, one-way journeys
- Time preferences: Early (04:00-07:59), Morning, Afternoon, Evening, Late departures
- Custom time constraints: Arrive before/after specific times, time ranges
- Parallel search: Configurable concurrency (1-8 parallel searches) for faster results
- Fun train animations: Animated emoji trains while searching ππ¨
- Progress indicators: Real-time search progress with elapsed time
- Color-coded results: Clear visual feedback for all operations
- Date-by-date progress: See results as they're found
- Interactive CLI: Guided prompts for easy use
- Command-line mode: Direct arguments for automation
- Multiple output formats: Console, table, JSON, CSV
- File export: Save results for further analysis
- Persistent settings: Save preferences in
~/.db-price-hunter/config.json
- Common routes: Pre-configured popular routes (Berlin-Munich, etc.)
- Favorite stations: Bookmark frequently used stations
- Saved searches: Save and reuse search parameters for frequent trips
- Retry logic: Automatic retry with exponential backoff
- Performance tuning: Configurable batch processing and API rate limiting
# Clone and install
git clone https://github.com/yourusername/db-price-hunter.git
cd db-price-hunter
npm install
# Interactive mode (guided prompts)
node db-price-analyzer.js
# Quick search with predefined route
node db-price-analyzer.js --route berlin-munich --date 08-15
# Morning departures with JSON export
node db-price-analyzer.js --route hamburg-frankfurt --date 2025-08-20 --morning --output json
# Basic searches
node db-price-analyzer.js --route berlin-munich --date 08-15
node db-price-analyzer.js --route hamburg-frankfurt --date 08-15 --trip-type one-way
# With time preferences
node db-price-analyzer.js --route berlin-munich --date 08-15 --morning
node db-price-analyzer.js --route cologne-dortmund --date 08-15 --evening
# Performance options
node db-price-analyzer.js --route berlin-munich --date 08-15 --concurrency 6
node db-price-analyzer.js --route hamburg-frankfurt --date 08-15 --concurrency 2
# Output formats
node db-price-analyzer.js --route berlin-munich --date 08-15 --output table
node db-price-analyzer.js --route berlin-munich --date 08-15 --output json --output-file results.json
# Save and reuse searches
node db-price-analyzer.js --route berlin-munich --date 08-15 --save-search "weekend-trip"
node db-price-analyzer.js --load-search "weekend-trip"
node db-price-analyzer.js --list-searches
node db-price-analyzer.js --delete-search "old-search"
# Utility commands
node db-price-analyzer.js --list-routes
node db-price-analyzer.js --help
npm run demo # Watch train animations
π― DB Price Hunter
π
Checking Sat, Aug 15, 2025... β
Found: β¬89.90
π Checking Sun, Aug 16, 2025... β
Found: β¬76.90
1. π° β¬76.90 - Available on 1 date:
π
Sun, Aug 16, 2025
π Out: ICE 587 | 08:34 β 12:28 | β¬38.45 | Direct
π Ret: ICE 1006 | 18:32 β 22:28 | β¬38.45 | Direct
βββββββββββββββ¬βββββββββββ¬βββββββββ¬βββββββββ¬βββββββββββ¬βββββββββ¬βββββββββ¬ββββββββββββββ
β Date β Out Trainβ Out Depβ Out Arrβ Ret Trainβ Ret Depβ Ret Arrβ Total Price β
βββββββββββββββΌβββββββββββΌβββββββββΌβββββββββΌβββββββββββΌβββββββββΌβββββββββΌββββββββββββββ€
β Aug 16 β ICE 587 β 08:34 β 12:28 β ICE 1006 β 18:32 β 22:28 β β¬76.90 β
βββββββββββββββ΄βββββββββββ΄βββββββββ΄βββββββββ΄βββββββββββ΄βββββββββ΄βββββββββ΄ββββββββββββββ
Auto-generated config at ~/.db-price-hunter/config.json
:
{
"preferences": {
"outputFormat": "console",
"useTrainAnimations": true,
"maxResults": 10,
"defaultTripType": "same-day",
"maxConcurrency": 3
},
"commonRoutes": {
"berlin-munich": {
"departure": { "id": "8011160", "name": "Berlin Hbf" },
"destination": { "id": "8000261", "name": "MΓΌnchen Hbf" }
}
},
"savedSearches": {
"weekend-trip": {
"departureStation": { "id": "8011160", "name": "Berlin Hbf" },
"destinationStation": { "id": "8000261", "name": "MΓΌnchen Hbf" },
"tripType": "same-day",
"savedAt": "2025-06-25T10:30:00.000Z"
}
}
}
db-price-hunter/
βββ db-price-analyzer.js # Main CLI application
βββ src/ # Core modules
β βββ journey-search.js # All search functions (same-day, one-way, multi-day)
β βββ user-interface.js # Interactive prompts & input handling
β βββ results-display.js # Results formatting & output
β βββ cli-handler.js # Command-line mode processing
β βββ journey-utils.js # Date/time utilities & journey extraction
β βββ cli-args.js # Command-line parsing & concurrency options
β βββ config.js # Configuration management
β βββ search-management.js # Save/load search functionality
β βββ output-formatters.js # Output formats & parallel search progress
β βββ error-handler.js # Parallel search with batch processing
β βββ time-preferences.js # Time filtering logic
β βββ time-selector.js # Time preference UI
β βββ station-selector.js # Station selection UI
β βββ cities.js # City/station data & search
βββ examples/ # Demo scripts
β βββ animation-demo.js # Train animation showcase
β βββ ... # Debug utilities
βββ README.md
Contributions welcome! Please open an issue or submit a Pull Request.
MIT License - see LICENSE file.
- Built with db-vendo-client
- Train emoji animations make CLI tools fun! πβ¨
Happy train travels! ππ«