Skip to content

Repository files navigation

ResultsZA SDK - the official Python and Node/TypeScript client for the ResultsZA lottery API and webhooks (Lotto, Powerball, EuroMillions, UK49s, horse racing)

MIT License PyPI version npm version GitHub stars

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.

Languages

Language Status Package
Python ✅ Available python/ - pip install resultsza-sdk
Node / TypeScript ✅ Available node/ - npm install resultsza-sdk

Quickstart (Python)

pip install resultsza-sdk
import 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 used

Your 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.

Quickstart (Node / TypeScript)

npm install resultsza-sdk
import { 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 used

Ships ESM + CommonJS with TypeScript types, and has zero runtime dependencies. Full usage in the Node README.

What's covered

  • 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.

Webhooks

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.

API keys & pricing

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.

FAQ

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.

Contributing

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 && pytest

Security issues: please see SECURITY.md rather than opening a public issue.

License

MIT

About

Official Python & Node/TypeScript client for the ResultsZA lottery API: Lotto, Powerball, EuroMillions, UK49s and horse racing results, plus lottery webhook verification. South Africa, Africa, the UK, Europe and the US.

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages