Read your Stripe revenue from Python
Connect your own Stripe account or Lemon Squeezy store, read only, and ask for the numbers a solo founder checks: MRR, who started paying, who cancelled, and what was collected. It is deliberately small. It is also what lets Launch tell you which waitlist signups became customers.
Keys
Secret key (nv_live_…) on your server only. There is no browser part: revenue and contact data must not reach a page a visitor can read. Create both under Dashboard → API keys.
Publishable key pasted into the page that embeds the form
NORDVA_SECRET_KEY=nv_live_… 01Server: Python
revenue.py
import os
import httpx
res = httpx.get(
"https://api.nordva.dev/v1/revenue/summary?period_days=30",
headers={"Authorization": f"Bearer {os.environ['NORDVA_SECRET_KEY']}"},
)
if res.status_code >= 400:
err = res.json()["error"]
raise RuntimeError(f"{err['code']}: {err['message']}")
data = res.json()["data"]
for m in data["by_currency"]:
print(m["currency"], m["mrr_minor"] / 100, "MRR;", m["new_subscriptions"], "new,", m["churned_subscriptions"], "churned") Amounts are in the smallest currency unit and never converted between currencies. Connect Stripe first, read-only, under Dashboard → Revenue; without a connection the API answers STRIPE_NOT_CONNECTED. Indie and up.
02Verify from a terminal
curl -s "https://api.nordva.dev/v1/revenue/summary?period_days=30" \
-H "Authorization: Bearer nv_live_…" | jq '.data.by_currency[] | {currency, mrr_minor, paying_customers}' Behaviour worth knowing
- Every response is
{ data, error, meta }. On failureerror.codeis a stable string such as VALIDATION_ERROR, PLAN_LIMIT_REACHED or RATE_LIMITED, with a remediation message. - POST and PATCH requests accept an
Idempotency-Keyheader; the same key with the same body returns the original response for 24 hours. - Rate limits per key: 30 requests a minute on Free, 120 on Indie, 500 on Builder. A 429 carries Retry-After.
- Browser calls with a publishable key must come from an origin registered on the project, otherwise the API answers ORIGIN_NOT_ALLOWED.