Python Integration

Please note these are examples. It is recommended that you make one that is more complex and adjustable to your needs.

Example Python

Copy

import requests
import json

def check_license(key, software, version):
    secret = 'PUT_YOUR_SECRET_KEY'
    type_ = 'license'
    url = f"https://<YOUR_DOMAIN>/api.php?secret={secret}&type={type_}&key={key}&product={software}&version={version}"
    
    try:
        response = requests.get(url)
        response.raise_for_status()  # Raise an exception for HTTP errors (4xx or 5xx)

        data = response.json()
        
        if data['valid']:
            print("Success!")
        else:
            print("Incorrect.")
    except requests.exceptions.RequestException as e:
        print("Error:", e)

# Example usage
check_license('LICENSE_KEY', 'PRODUCT_NAME', 'VERSION_NUMBER')

Last updated