Install
pip install requests
Generate random integers
import requests
BASE = "https://api.provable.io"
client_seed = "my-app-user-42"
res = requests.get(
f"{BASE}/api/ints",
params={"clientSeed": client_seed, "count": 5, "min": 1, "max": 100},
)
data = res.json()
print("outcome:", data["outcome"])
print("serverHash:", data["serverHash"])
Verify the outcome later
verify = requests.get(
f"{BASE}/api/verifyServerHash",
params={"clientSeed": client_seed, "serverHash": data["serverHash"]},
)
print("verified" if verify.json() else "mismatch")
Tips
- Use the same
clientSeed per logical "session" (e.g. a user, a raffle, a game round) so verification ties back to the right state.
- Store the
serverHash wherever you store the outcome — that's your audit record.
Next steps