Automatically rent mining rigs from MiningRigRentals.com based on your criteria using their API v2.
- ✅ Full MRR API v2 authentication (HMAC-SHA1 signing)
- ✅ Search for rigs by algorithm, hashrate, price, RPI score
- ✅ Automatically rent the best matching rigs
- ✅ Support for all currencies (BTC, LTC, ETH, DOGE, BCH)
- ✅ Dry-run mode for testing
- ✅ Multi-rig rental support
- ✅ Pool profile management
- Python 3.6+
requestslibrary
- Install dependencies:
pip install -r requirements.txt- Get your API credentials:
- Go to https://www.miningrigrentals.com/account/apikey
- Create a new API key with appropriate permissions (rent, rigs)
- Copy your API Key and API Secret
Edit mrr_auto_rent.py and update the configuration section:
# API credentials
API_KEY = "your_api_key_here"
API_SECRET = "your_api_secret_here"
# Rental configuration
RENTAL_CONFIG = {
'algo': 'scrypt', # Algorithm: scrypt, sha256, x11, etc.
'min_hashrate': 100, # Minimum hashrate (in hash_type units)
'max_price': 0.00001, # Maximum price per unit per day
'duration_hours': 3, # Rental duration in hours
'profile_id': profile_id, # Pool profile ID (auto-detected)
'min_rpi': 80, # Minimum RPI score (0-100)
'hash_type': 'mh', # Hash units: hash, kh, mh, gh, th, ph, eh
'price_type': 'mh', # Price units (same as hash_type)
'currency': 'BTC', # BTC, LTC, ETH, DOGE, or BCH
'max_rigs': 1, # Maximum number of rigs to rent
'dry_run': True # Set False to actually rent
}Run the script with default configuration:
python mrr_auto_rent.pyThe script defaults to dry-run mode (dry_run: True), which will:
- Search for matching rigs
- Show what would be rented
- NOT actually create rentals or spend funds
To actually rent rigs, set dry_run: False in the configuration.
You can also use the classes programmatically:
from mrr_auto_rent import MRRClient, AutoRenter
# Initialize
client = MRRClient("your_api_key", "your_api_secret")
auto_renter = AutoRenter(client)
# Search for rigs
rigs = auto_renter.find_best_rigs(
algo='scrypt',
min_hashrate=100,
max_price=0.00001,
min_rpi=80,
hash_type='mh',
price_type='mh',
count=10
)
# Rent rigs
rentals = auto_renter.auto_rent(
algo='scrypt',
min_hashrate=100,
max_price=0.00001,
duration_hours=3,
profile_id=12345,
currency='BTC',
max_rigs=1,
dry_run=False # Set to True for testing
)The MRRClient class provides access to all MRR API endpoints:
whoami()- Test connectivity and get account infoget_account_balance()- Get account balancesget_algos(currency)- Get available algorithmsget_pool_profiles(algo)- Get pool profiles
search_rigs(algo, **filters)- Search for available rigsget_rig_details(rig_ids)- Get detailed rig information
rent_rig(rig_id, length_hours, profile_id, ...)- Rent a rigget_rentals(rental_type, history, ...)- Get rental history
get(endpoint, params)- GET requestpost(endpoint, data)- POST requestput(endpoint, data)- PUT requestdelete(endpoint, data)- DELETE request
Available filters for search_rigs():
currency- Filter by currency (BTC, LTC, ETH, DOGE, BCH)minhours_min/max- Filter minimum rental hoursmaxhours_min/max- Filter maximum rental hoursrpi_min/max- Filter RPI score (0-100)hash_min/max/type- Filter hashrateprice_min/max/type- Filter pricecount- Number of results (max 100)offset- Pagination offsetorderby- Sort field (price, hashrate, rpi, etc.)orderdir- Sort direction (asc/desc)rented- Show rented rigs (true/false)offline- Show offline rigs (true/false)region- Filter by region
Before renting, you need at least one pool profile configured:
- Go to https://www.miningrigrentals.com/account/pools
- Create a pool profile with your mining pool details
- The script will auto-detect your first profile, or specify
profile_id
Common algorithms available:
scrypt- Litecoin, Dogecoinsha256- Bitcoinx11- Dashequihash- Zcashethash- Ethereum Classicrandomx- Monero- And many more...
Get the full list with:
client.get_algos()Connected as: 123456789
Permissions: {'withdraw': 'yes', 'rent': 'yes', 'rigs': 'yes'}
Account balances:
BTC: 0.00500000
LTC: 0.00000000
ETH: 0.00000000
Using pool profile ID: 40073
============================================================
AUTO-RENT CONFIGURATION
============================================================
algo : scrypt
min_hashrate : 100
max_price : 0.00001
duration_hours : 3
profile_id : 40073
min_rpi : 80
hash_type : mh
price_type : mh
currency : BTC
max_rigs : 1
dry_run : True
============================================================
Searching for scrypt rigs...
Min hashrate: 100 mh
Max price: 0.00001 mh/day
Min RPI: 80
Found 5 matching rigs
[DRY RUN] Renting rig 1/1:
ID: 41784
Name: Antminer L3+ 540MH/s
Hashrate: 540.00M
Price: 0.00000587 BTC/mh/day
Duration: 3 hours
[DRY RUN - Skipping actual rental]
============================================================
SUMMARY: DRY RUN - Rented 1 rig(s)
============================================================
- ✅ Dry-run mode by default - Test before spending
- ✅ Price filtering - Never pay more than your max price
- ✅ RPI filtering - Only rent from reliable providers
- ✅ Balance checking - Verify funds before renting
- Verify your API key and secret are correct
- Check API permissions include "rent" and "rigs"
- Ensure nonce is working (system time is correct)
- Adjust search criteria (lower min_hashrate, increase max_price)
- Check if rigs are available for your algorithm
- Try different RPI thresholds
- Verify sufficient balance in the specified currency
- Check if rig is still available (may have been rented)
- Ensure pool profile is configured correctly
Be mindful of API rate limits:
- Don't make excessive requests
- Use reasonable polling intervals
- Cache results when possible
- Never commit API keys to version control
- Use environment variables for production
- Set minimal required permissions
- Rotate keys periodically
This script is provided as-is for educational purposes. Use at your own risk.
- MRR API Documentation: https://www.miningrigrentals.com/apidocv2
- MRR Support: https://support.miningrigrentals.com
This is an unofficial script. The author is not affiliated with MiningRigRentals.com. Always test with small amounts first and verify rentals are working as expected.