GET /v1/mega-millions/history · 2010–2026 Archive
Mega Millions Historical Data API (US) Endpoint
Access over 1,600+ Mega Millions draw records. Filter by year, date range, or request bulk JSON/CSV exports for statistical research and algorithm training.
API Endpoint
GET
https://api.uslotteryapi.com/v1/mega-millions/historyRecords: 1,600+ Draws
Request Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| from | string | Optional | Start draw date (YYYY-MM-DD). |
| to | string | Optional | End draw date (YYYY-MM-DD). |
| year | integer | Optional | Filter results by year (e.g. 2023). |
| limit | integer | Optional | Number of records per response (1 to 100). Default: 20. |
Sample Historical Payload
{
"status": "success",
"pagination": {
"current_page": 1,
"per_page": 2,
"total_records": 1620,
"total_pages": 810
},
"data": [
{
"draw_date": "2026-07-31",
"white_balls": [8, 17, 29, 41, 55],
"mega_ball": 14,
"megaplier": "4x",
"jackpot": "$280,000,000"
},
{
"draw_date": "2026-07-28",
"white_balls": [2, 11, 23, 39, 64],
"mega_ball": 8,
"megaplier": "3x",
"jackpot": "$262,000,000"
}
]
}Python (Pandas)Data Science
import requests
import pandas as pd
url = "https://api.uslotteryapi.com/v1/mega-millions/history?year=2024"
headers = {"X-API-Key": "YOUR_API_KEY"}
res = requests.get(url, headers=headers).json()
df = pd.DataFrame(res['data'])
print("Total 2024 Mega Millions Draws:", len(df))cURL RequestCLI / Terminal
curl -X GET "https://api.uslotteryapi.com/v1/mega-millions/history?limit=50&format=json" \ -H "X-API-Key: YOUR_API_KEY"
Access Historical Datasets Free
Create a free developer account to query 2010–2026 Mega Millions draw history.
Get Free API KeyFrequently Asked Questions
What historical date range is available for Mega Millions?
The Mega Millions historical API dataset spans from 2010 through the most recent draw date.
How are rule matrix changes handled in historical payloads?
All historical records include a `matrix_version` attribute detailing white ball and Mega Ball pools at the time of drawing.
Can I export historical Mega Millions records to CSV?
Yes. Set the query parameter `format=csv` to receive raw downloadable CSV data instead of JSON.