calottery APIcalottery.com ↗
Retrieve California Lottery draw results for Powerball, Mega Millions, SuperLotto Plus, Fantasy 5, Daily 3, Daily 4, and Daily Derby via a simple 2-endpoint API.
What is the calottery API?
The California Lottery API provides draw results across 7 supported games through 2 endpoints. Use get_all_draw_games_list to retrieve numeric game IDs, then pass any ID to get_draw_game_past_results to get the most recent draw, upcoming jackpot info, and a paginated history of past draws — each with full winning numbers and prize breakdowns.
No input parameters required.
curl -X GET 'https://api.parse.bot/scraper/c59a13d8-9bcd-46f1-ac0d-b46305ac45f2/get_all_draw_games_list' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace calottery-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""California Lottery draw results — list games, fetch results, inspect draws."""
from parse_apis.california_lottery_api import CaliforniaLottery, GameId, GameNotFound
client = CaliforniaLottery()
# List all available draw games
for game in client.games.list(limit=7):
print(game.name, game.game_id)
# Construct a game by enum ID and fetch its past results
powerball = client.game(game_id=GameId.POWERBALL)
results = powerball.past_results(page=1, page_size=3)
print(results.name, results.total_previous_draws, results.has_jackpot)
# Inspect the most recent draw's winning numbers and prizes
if results.most_recent_draw:
draw = results.most_recent_draw
print(draw.draw_number, draw.draw_date)
for pos, ball in draw.winning_numbers.items():
print(pos, ball.number, ball.is_special)
for tier, prize in draw.prizes.items():
print(tier, prize.prize_type_description, prize.amount, prize.count)
# Typed error handling
try:
mega = client.game(game_id=GameId.MEGA_MILLIONS)
mega.past_results()
except GameNotFound as exc:
print(f"Game not found: {exc}")
print("exercised: games.list / game().past_results / Draw.winning_numbers / Draw.prizes")
Returns all available California Lottery draw games with their numeric IDs. These IDs are required input for get_draw_game_past_results. The list is static and covers Powerball, Mega Millions, SuperLotto Plus, Fantasy 5, Daily 3, Daily 4, and Daily Derby.
No input parameters required.
{
"type": "object",
"fields": {
"games": "array of game objects each containing name (string) and game_id (integer)"
},
"sample": {
"data": {
"games": [
{
"name": "Powerball",
"game_id": 12
},
{
"name": "Mega Millions",
"game_id": 15
},
{
"name": "Superlotto Plus",
"game_id": 8
},
{
"name": "Fantasy 5",
"game_id": 10
},
{
"name": "Daily 3",
"game_id": 9
},
{
"name": "Daily 4",
"game_id": 14
},
{
"name": "Daily Derby",
"game_id": 11
}
]
},
"status": "success"
}
}About the calottery API
Endpoints Overview
The API exposes two endpoints. get_all_draw_games_list takes no inputs and returns an array of game objects, each with a name (string) and game_id (integer). These IDs are stable references used as the required game_id parameter in the second endpoint. Supported games include Powerball (12), Mega Millions (15), SuperLotto Plus (8), Fantasy 5, Daily 3, Daily 4, and Daily Derby.
Draw Results and Pagination
get_draw_game_past_results accepts a required game_id integer and optional page and page_size parameters (maximum 50 results per page). The response includes a MostRecentDraw object with DrawNumber, DrawDate, WinningNumbers, and Prizes. It also returns a NextDraw object covering the upcoming draw's DrawNumber, DrawDate, JackpotAmount, and EstimatedCashValue. TotalPreviousDraws tells you the full count of historical records available for pagination.
Response Shape Details
Each entry in the PreviousDraws array mirrors the MostRecentDraw structure: DrawNumber, DrawDate, WinningNumbers, and Prizes. The top-level HasJackpot boolean indicates whether the selected game carries a progressive jackpot, which is useful for filtering display logic when building interfaces that handle both jackpot and non-jackpot games. DrawGameId echoes back the integer ID you supplied, confirming which game the results belong to.
The calottery API is a managed, monitored endpoint for calottery.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when calottery.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official calottery.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Display the latest Powerball or Mega Millions winning numbers on a news or results aggregator site.
- Build a historical lottery number frequency analyzer using paginated PreviousDraws data.
- Send push notifications when a new MostRecentDraw is available for a user-selected game.
- Populate a jackpot tracker showing NextDraw JackpotAmount and EstimatedCashValue for multiple games.
- Archive draw history by paginating through TotalPreviousDraws across all game IDs.
- Build a prize breakdown display using the Prizes array from MostRecentDraw for any supported game.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does the California Lottery have an official developer API?+
What does get_draw_game_past_results return beyond the latest draw?+
MostRecentDraw (the last completed draw with winning numbers and prize tiers), NextDraw (upcoming draw date, jackpot amount, and estimated cash value), and a paginated PreviousDraws array. Use page and page_size (up to 50) to page through historical results. TotalPreviousDraws tells you how many records exist in total.Does the API cover scratch-off tickets or second-chance promotions?+
How far back does the historical draw data go?+
TotalPreviousDraws field in each response tells you exactly how many historical records are available for that game. The depth varies by game — longer-running games like SuperLotto Plus have more history than newer multi-state games. Paginate using page and page_size to retrieve the full set.Can I look up results for a specific draw date rather than paginating through all results?+
page and page_size to locate a specific historical draw. There is no date-range filter or draw-number lookup parameter. You can fork this API on Parse and revise it to add date-filtered or draw-number-specific endpoints.