Find it useful? Give it a ⭐ to help more developers discover the ResultsZA lottery API.
The ResultsZA SDK is the official Python and Node/TypeScript client for the ResultsZA lottery API. Fetch Lotto, Powerball, EuroMillions, UK49s and horse racing results, generate numbers, check played lines, and verify lottery webhooks in a few lines of code - across South Africa, Kenya, Nigeria, Ghana, the UK, Europe and the US.
Bring your own API key - get one here.
Disclaimer: This is tooling for the ResultsZA API. It is not affiliated with the South African National Lottery, UK 49's, or any national lottery or horse racing operator. Results are provided for convenience, so always verify on the official operator's site before claiming a prize.
| Language | Status | Package |
|---|---|---|
| Python | ✅ Available | python/ - pip install resultsza-sdk |
| Node / TypeScript | ✅ Available | node/ - npm install resultsza-sdk |
pip install resultsza-sdkimport os
from resultsza import ResultsZA
client = ResultsZA(api_key=os.environ["RESULTSZA_API_KEY"])
client.get_lotto_results() # latest SA Lotto draw
client.get_us_powerball_results(date="2026-07-08")
client.generate_random_numbers(game="Powerball", lines=5)
client.get_hot_cold_numbers(product="Lotto")
client.check_balance() # free - no calls usedYour API key is read from an argument or your own environment variable, never hardcoded, and it's redacted if it ever reaches a log or error. Full usage in the Python README.
npm install resultsza-sdkimport { ResultsZA } from "resultsza-sdk";
const client = new ResultsZA({ apiKey: process.env.RESULTSZA_API_KEY! });
await client.getLottoResults(); // latest SA Lotto draw
await client.generateRandomNumbers({ game: "Powerball", lines: 5 });
await client.checkBalance(); // free - no calls usedShips ESM + CommonJS with TypeScript types, and has zero runtime dependencies. Full usage in the Node README.
- Lottery results - SA (Daily Lotto, Lotto, Lotto Plus 1, Lotto 5 Max, Powerball, Powerball Xtra), Kenya, Nigeria, Ghana, UK 49's, EuroMillions, Irish Lotto, US Powerball, Mega Millions
- Horse racing - meetings, full race cards, single-race runner tables
- Number tools - random generator, deterministic text-to-lucky, hot/cold, frequencies, pairs
- Checkers - single (up to 10 lines) and bulk (up to 500 lines)
- Account - free balance & subscription status check
- Webhooks - HMAC-SHA256 signature verification and envelope parsing for consuming result pushes
See the full endpoints table.
ResultsZA can push results to your endpoint the moment they're published. Register your endpoint URL and get your signing secret in the subscriber portal under Push Settings; this SDK helps you receive and verify those deliveries safely: verify against raw bytes, respond within 10 seconds, and deduplicate at-least-once deliveries. See the webhook docs and the Flask receiver example.
Every request needs an API key tied to an active subscription. Tiers range from Starter through Unlimited (60 req/min). Check current usage any time with client.check_balance(), which is free.
- 🔑 Get an API key
- 🔔 Set up webhooks (portal Push Settings)
- 📚 API documentation
- 📬 Webhook documentation
- 🌍 resultsza.co.za (pricing & plans)
Is there a lottery API for South African and international results? Yes. The ResultsZA API is a lottery results API covering SA Lotto, Lotto Plus 1, Lotto 5 Max, Daily Lotto, Powerball and Powerball Xtra, plus UK49s, EuroMillions, Irish Lotto, US Powerball, Mega Millions, and lotteries in Kenya, Nigeria and Ghana - as well as South African horse racing. This repository is the official Python and Node/TypeScript client for it.
How do I get Lotto or Powerball results via API?
Get an API key, install the SDK (pip install resultsza-sdk or npm install resultsza-sdk), and call a method such as get_lotto_results() or get_sa_powerball_results(). See the Quickstart above.
How do I verify a ResultsZA lottery webhook?
The SDK ships HMAC-SHA256 webhook signature verification. Pass the raw request bytes and the X-ResultsZA-Signature header to verify_webhook_signature(...) (or verify_and_parse(...)) - see the Webhooks section. This is the safe way to consume a lottery results webhook.
Which languages does the SDK support? Python (3.9+) and Node / TypeScript (20+), from a single repository, with matching features and typed clients.
Issues and pull requests are welcome. Tests mock the HTTP layer, so you can run the full suite without an API key:
pip install -e "python/[dev]"
cd python && pytestSecurity issues: please see SECURITY.md rather than opening a public issue.
