During my trip to Glacier National Park we quickly realized the good hikes were gated by a reservation system that opens at exactly 7PM and sells out within seconds. I created this bot in order to secure a reservation for Iceberg Lake Trail before selling out. Since the bot uses multiple instances and is able to make a reservation several hundred milliseconds after the reservation opens, it was able to secure a reservation for me and my family.
This project provides an automated bot for making reservations on recreation.gov. It uses Selenium for web automation and can handle multiple reservation attempts in parallel. Since some recreation.gov reservations are in high demand and can sell out quickly, this bot can help increase your chances of securing a spot. Here is an example of a reservation that can be made by this bot.
- Automated login to recreation.gov
- Automatic date selection
- Reservation attempt automation
- Multi-threaded execution for multiple reservations
- Python 3.7+
- Selenium
- ChromeDriver
- Install the required Python packages:
pip install -r requirements.txt
-
Download and install ChromeDriver:
- Visit the ChromeDriver downloads page
- Download the version that matches your Chrome browser
- Place the ChromeDriver executable in a directory in your system PATH
-
Update the
DRIVER_PATH
in the script to point to your ChromeDriver location:
export DRIVER_PATH = '/path/to/your/chromedriver'
Create a JSON file with your reservation options. The structure should be as follows:
[
{
"url": "https://www.recreation.gov/timed-entry/10087086/ticket/10087087",
"email": "your_email@example.com",
"password": "your_password",
"date": "1/1/2024"
},
{
// Add more reservation attempts here
}
]
Each object in the JSON array represents a reservation state machine that will run on a separate thread. To maximize your chances of securing a reservation, ~4 reservation instances are recommended. To specify the number of duplicate instances, use the --instances flag.
Run the script with the path to your options JSON file:
python rec_gov_bot.py path/to/your/options.json --instances 4
The bot operates as a state machine with the following states:
- LOGGED_OUT: Attempts to log in
- RESERVING: Tries to make a reservation
- PURCHASING: Prompts the user to complete the purchase manually
The bot will continuously attempt to make reservations until successful or stopped.
- The purchasing process is not automated. The bot will stop and prompt for user input when a reservation is successfully made.
- The bot includes error handling and will retry operations in case of failures.
- This bot is for educational purposes only. Be sure to comply with recreation.gov's terms of service when using automated tools.
This project is not affiliated with or endorsed by recreation.gov. Use at your own risk and in compliance with all applicable terms of service and laws.