Skip to main content

Asynchronous EarnApp API wrapper written in Python using asyncio.

Project description

EarnAPI

EarnApp API wrapper written in Python using asyncio, inspired from pyEarnapp (which does not use asyncio).

Be careful how you use this library!

This library is not officially supported by EarnApp. Use it at your own risk. I am not responsible for any damage caused by using this library.
Also, please do not spam the API with requests. It is not nice and can get you banned or rate limited, and EarnApp rate limits last a lot.

Installation

pip install earnapi

Example usage

import asyncio
from earnapi import Client

loop = asyncio.get_event_loop()
client = Client("your_auth_token_cookie")
async def main():
    # Get user information
    userdata = await client.get_user_data()
    print("User data:", userdata)
    # Get information about earnings
    earnings = await client.get_earnings()
    print("Earnings:", earnings)
    # Get a list of devices
    devices = await client.get_devices()
    print("Devices:", devices)
    # Get your transactions
    transactions = await client.get_transactions()
    print("Transactions:", transactions)
    # Get referrals
    referrals = await client.get_referrals()
    print("Referrals:", referrals)
    # Device statuses
    device_statuses = await client.get_device_statuses()
    print("Device statuses:", device_statuses)
    # IP check
    ip_allowed = await client.is_ip_allowed("your_ip_address_here")
    print("IP", "is" if ip_allowed else "is not", "allowed to use EarnApp")
    # Redeem to PayPal, may raise an exception
    redeemed = await client.redeem_to_paypal("your_paypal@email_he.re")
    print("Redeemed" if redeemed else "Could not redeem", "your balance to PayPal.")
    # Add a device (not tested)
    #await client.add_device("sdk-xxxxx-xxxxxxxxxxxx")
    # Delete a device (not tested)
    #await client.delete_device("sdk-xxxxx-xxxxxxxxxxxx")

loop.run_until_complete(main())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

earnapi-1.1.2.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

earnapi-1.1.2-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file earnapi-1.1.2.tar.gz.

File metadata

  • Download URL: earnapi-1.1.2.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for earnapi-1.1.2.tar.gz
Algorithm Hash digest
SHA256 4ce2d305e1dc5bf083a7356f3d5c1065b5dba352cc4bfad80f9cf67566558771
MD5 0cc00ae7f9ca4a7372cd09f04ccf9dbf
BLAKE2b-256 dd25cccf92140827b94d3b50ec06d1dfadc88214106ed75da816449b610a73d8

See more details on using hashes here.

File details

Details for the file earnapi-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: earnapi-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for earnapi-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c0a28567a07e7f7a8ee105bf3411b6867b1ff6c2450d937849f801864c538457
MD5 b2c8f39df7c5aeb5e926133bba25a67f
BLAKE2b-256 aeb662e331d8e8b48df948dbe19387c5a3aba1b6e0ce466656926acac624d021

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page