Package: pyHoneygain
HoneyGain APIA Python binding to interact with HoneyGain Dashboard API.InstallationpipinstallpyHoneygainUsageLogin with username and password:frompyHoneygainimportHoneyGain# Your HoneyGain (HG) login username and passwordUSERNAME=""PASSWORD=""# Initialise the HoneyGain objectuser=HoneyGain()# Optionally, when instantiating you can pass in the following attributes to the HoneyGain class:AttributeDescriptionDefault ValueAPI_PREFIX_URLThe API Prefix URL/apiAPI_VERSIONThe API Version/v1API_DOMAINThe API Domainhttps://dashboard.honeygain.com# Call the login methoduser.login(USERNAME,PASSWORD)Create a new Honeygain account:frompyHoneygainimportHoneyGain# Your HoneyGain (HG) login username and passwordEMAIL=""PASSWORD=""# Initialise the HoneyGain objectuser=HoneyGain()# Call the signup methoduser.signup(EMAIL,PASSWORD)Optionally you can also set the referral codeREFERRAL="REFERRAL CODE"user.signup(EMAIL,PASSWORD,REFERRAL)Login with access token (JWT token):frompyHoneygainimportHoneyGain# Your HG's JWT TokenJWT_TOKEN="eyeiufhuegjdvniu85yhjdfseu487y5urhjdfkseiwu89347yrjfdskiu8y4rjk"# Initialise the HoneyGain objectuser=HoneyGain()# Call the login methoduser.set_jwt_token(JWT_TOKEN)Add proxies for future requests:frompyHoneygainimportHoneyGain# With authenticationuser.set_proxy("ip:port:username:password")# Without authenticationuser.set_proxy("ip:port")FunctionsGet user infouser.me()Get devices infouser.devices()Note: The /v1 and /v2 endpoint return different information as of 16th Feb 2022.Get stats# Returns 30 days stats (earnings/credits info).user.stats()Get JumpTask (JT) stats# Returns 30 days JT stats (earnings/credits info).user.stats()Get today's stats# Returns today's earnings/credits info..user.stats_today()Get today's JT stats# Returns today's JT earnings/credits info..user.stats_today_jt()Get notifications# Returns notifications (if any)user.notifications()Get payouts# Returns pending payouts as per shown as dashboarduser.payouts()Request payout for BTC# Requests payout, method as BTC to a BTC wallet address.BTC_ADDRESS="bc1qr7twnwulkhd6gqwmkesvj5825kyz9mggy3mvcz"try:user.payout_to_btc(BTC_ADDRESS)exceptUserConfirmationRequiredError:# Sometimes HG will ask for user confirmation before accepting the payout request.# So check your email and use the `add_user_confirmation` method on the user object to authenticate the user.# Then you can call the payout_to_btc method again.code=input("Enter the code: ")ifuser.add_user_confirmation(code):result=user.payout_to_btc(BTC_WALLET_ADDRESS)print("Withdrawal successful:",result)Add user verification code# Adds a user verification code as per the emailcode=input("Enter the verification code: ")user.add_user_confirmation(code)# Returns a booleanRemove a proxy# Removes a proxy for future requests.user.remove_proxy()Change password# Changes the password for the logged in user.user.change_password("oldpassword","newpassword")Get balances# Gets balances infouser.balances()Open Honeypot# Attempts to open Honeypotuser.open_honeypot()Link BSC Walletwallet_address="0x00000000000000000000"user.link_bsc_wallet(wallet_address)Verify emailtoken="dI00qX00U006B000lK000z0000a600rt00x00000F"# Token is such kind of code sent on emailuser.confirm_email(token)Check for a coupon codefrompyHoneygainimportHoneyGainHoneyGain.coupon("freemoney")# valid (as of Apr 25, 2022)HoneyGain.coupon("get5")# expired (as of Apr 25, 2022)HoneyGain.coupon("get6")# invalid (as of Apr 25, 2022)ExceptionsThe following exceptions are defined.ExceptionReasonNotLoggedInErrorRaised when you try to access protected routes (devices, payouts, etc).UserConfirmationRequiredErrorRaised when you call an endpoint which requires user authentication.Note onUserConfirmationRequiredError: In case you get an error, you should check your email, add a user confirmation by using theadd_user_confirmationmethod and then try to use the original method again.