Aziz Berkay Yesilyurt

aziz@appvisor.dev

Monetizing APIs with Gumroad

Gumroad provides key features for API management like license key validation, usage tracking and access management through their License API.

The /licenses/verify endpoint is particularly useful for tracking API usage. Each request to your API can be logged and compared against a user's allocation.

Implementation Example

Here's a basic implementation of usage tracking through Gumroad License API:

url = "https://api.gumroad.com/v2/licenses/verify"
data = {
    "product_id": "YOUR_PRODUCT_ID",
    "license_key": "CUSTOMERS_LICENSE_KEY",
    "increment_uses_count": "true",
}

response = requests.post(url, data=data)
uses = response.json()["uses"]
assert uses < 100, "Usage limit exceeded"

The fields are: