Skip to main content

Gumroad API Client

A Python API client for interacting with the Gumroad API (https://gumroad.com/api). Comments, suggestions, and improvements are always welcome. Be sure to follow @opsdisk on Twitter for the latest updates.

Note that not all of the endpoints and HTTP verbs supported by the Gumroad API have been added.

Installation

pip install pygumroad
git clone https://github.com/opsdisk/pygumroad.git
cd pygumroad
virtualenv -p python3.7 .venv  # If using a virtual environment.
source .venv/bin/activate  # If using a virtual environment.
pip install -r requirements.txt
python setup.py install

Update Credentials

If using a secrets file, create/update the gumroad_secrets.json file with the host and API key. See the usage section on how to pass a secrets dictionary.

cp gumroad_secrets_empty.json gumroad_secrets.json
{
    "gumroad": {
        "host": "api.gumroad.com",
        "token": "7a4d...b388",
    }
}

Usage

import pygumroad

# Pass a secrets file.
full_path_to_secrets_file_location="/home/user/gumroad_secrets.json"
gumroad_client = pygumroad.GumroadClient(secrets_file_location=full_path_to_secrets_file_location)

# Pass a secrets dictionary.
secrets_dict = {
    "gumroad": {
        "host": "api.gumroad.com",
        "token": "7a4d...b388",
    }
}

gumroad_client = pygumroad.GumroadClient(secrets_dict=secrets_dict)
all_products = gumroad_client.retrieve_all_products()

for product in all_products:
    print(f"Product Name: {product['name']} - Product ID: {product['id']}")


all_sales = gumroad_client.retrieve_all_sales()

for sale in all_sales:
    print(f"Product: {sale['product_name']} was sold on {sale['created_at']}")

Metadata

Release files for pygumroad 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygumroad 0.0.3
File Size Uploaded Provenance Actions
pygumroad-0.0.3.tar.gz 18.4 kB Without provenance Details for pygumroad-0.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pygumroad 0.0.3
File Interpreter ABI Platform Actions
pygumroad-0.0.3-py3-none-any.whl Python 3 none any Details for pygumroad-0.0.3-py3-none-any.whl

Total release size: 41.7 kB

Release files / pygumroad-0.0.3.tar.gz

Download URL pygumroad-0.0.3.tar.gz
Size 18.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d9638e1e17468b02abe9ee3dae65d7e7a89798e6d5390517a52f7f5f0950a03f
BLAKE2b-256 checksum
How to use checksums
bb2889fdf5286fca43b0acc2bc565efe26bbccbfa73b9ab617b36423fe2009ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / pygumroad-0.0.3-py3-none-any.whl

Download URL pygumroad-0.0.3-py3-none-any.whl
Size 23.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ea0bda92c317035af005bc55a109db9fe4834f9a53b5dfd84204e4b18a91c0f
BLAKE2b-256 checksum
How to use checksums
684084b1ff4b8c48f39e34d34a51da31767365db4d05db48796c11e24f71f78c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Security for pygumroad 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page