NewConnect Claude, Gemini, ChatGPT, and other AI agents to API Ninjas via our MCP server →

Mega Millions API

Get Mega Millions winning numbers within minutes of each draw on paid plans (about an hour after the draw on the free plan), with the jackpot, and on paid plans the cash value and next jackpot estimate. The Business tier and above includes every draw since 17 May 2002. There is no official public Mega Millions API; this data comes from official state lottery publications and is cross-checked against a second source.

Mega Millions is served by the Lottery API with game=megamillions.

Available endpoints:

Mega Millions at a glance

Format5 white balls from 1-70 + 1 Mega Ball from 1-24
DrawsTuesday and Friday, 11:00 pm ET
Ticket price$5, with a built-in 2x-10x multiplier
Jackpot odds1 in 290,472,336
ArchiveFrom 17 May 2002

Number-format history

EffectiveFormat
2025-04-085 from 1-70 + Mega Ball 1-24; $5 with built-in multiplier
2017-10-315 from 1-70 + Mega Ball 1-25
2013-10-225 from 1-75 + Mega Ball 1-15
2005-06-225 from 1-56 + Mega Ball 1-46
2002-05-155 from 1-52 + Mega Ball 1-52
3 endpoints

https://api.api-ninjas.com/v1/lottery

Returns the latest draw for a game, the draw on a given date, or the latest draw of every game in a US state or a country. On paid plans results usually appear within minutes of the official publication; on the free plan they appear about 60 minutes later.

Full parameter and response reference: /v1/lottery.

Live Demo

Live demo · no API key required
Query parameters
game
state
country
date
session
draw_number

Get a free API key to get started — no credit card required.

Headers
X-Api-KeyLog in or sign up to get your API key
GET
https://api.api-ninjas.com/v1/lottery?game=megamillions
Sample response
{
"game": "megamillions",
"game_name": "Mega Millions",
"country": "US",
"draw_date": "2026-10-02",
"draw_time": "2026-10-02T23:00:00-04:00",
"main_numbers": [
6,
37,
40,
41,
55
],
"bonus_numbers": [
10
],
"bonus_name": "Mega Ball",
"jackpot": {
"currency": "USD",
"amount": 321000000,
"cash_value": 131100000,
"estimated": true,
"won": false
},
"next_draw": {
"draw_date": "2026-10-06",
"draw_time": "2026-10-06T23:00:00-04:00",
"jackpot": {
"currency": "USD",
"amount": 345000000,
"cash_value": 139600000,
"estimated": true
}
},
"rules_version": "2025-04-08",
"revision": 1,
"source": {
"name": "New York State Gaming Commission (data.ny.gov)",
"url": "https://data.ny.gov/resource/5xaw-6ayf.json",
"retrieved_at": "2026-10-06T01:00:56Z",
"cross_checked": true
}
}

Code Examples

curl -X GET "https://api.api-ninjas.com/v1/lottery?game=megamillions" \ -H "X-Api-Key: YOUR_API_KEY"

https://api.api-ninjas.com/v1/lotteryhistorical

Returns past draws for a game, newest first. The free plan gets the latest 10 draws (each visible about 60 minutes after the draw); Developer plans a rolling two years; Business tier and above the full archive.

Full parameter and response reference: /v1/lotteryhistorical.

Live Demo

Live demo · no API key required
Query parameters
game
start
end
session
limit
offset

Get a free API key to get started — no credit card required.

Headers
X-Api-KeyLog in or sign up to get your API key
GET
https://api.api-ninjas.com/v1/lotteryhistorical?game=megamillions
Sample response
[
{
"game": "megamillions",
"game_name": "Mega Millions",
"country": "US",
"draw_date": "2026-10-02",
"draw_time": "2026-10-02T23:00:00-04:00",
"main_numbers": [
6,
37,
40,
41,
55
],
"bonus_numbers": [
10
],
"bonus_name": "Mega Ball",
"jackpot": {
"currency": "USD",
"amount": 321000000,
"cash_value": 131100000,
"estimated": true,
"won": false
},
"next_draw": {
"draw_date": "2026-10-06",
"draw_time": "2026-10-06T23:00:00-04:00",
"jackpot": {
"currency": "USD",
"amount": 345000000,
"cash_value": 139600000,
"estimated": true
}
},
"rules_version": "2025-04-08",
"revision": 1,
"source": {
"name": "New York State Gaming Commission (data.ny.gov)",
"url": "https://data.ny.gov/resource/5xaw-6ayf.json",
"retrieved_at": "2026-10-06T01:00:56Z",
"cross_checked": true
}
},
"..."
]

Code Examples

curl -X GET "https://api.api-ninjas.com/v1/lotteryhistorical?game=megamillions" \ -H "X-Api-Key: YOUR_API_KEY"

Premium only

https://api.api-ninjas.com/v1/lotterycheck

Scores a ticket against a draw and returns the matched prize tier and prize. Supports Powerball (with Power Play and Double Play), Mega Millions (with the ticket's built-in multiplier) and Millionaire for Life. Ticket numbers are never stored. The result is not a prize claim.

Full parameter and response reference: /v1/lotterycheck.

Live Demo

Live demo
Query parameters
game
date
numbers
bonus
power_play
double_play
multiplier

Get a free API key to get started — no credit card required.

Headers
X-Api-KeyLog in or sign up to get your API key
GET
https://api.api-ninjas.com/v1/lotterycheck?game=megamillions&date=2026-10-02&numbers=6,37,40,1,2&bonus=10
Sample response
{
"game": "megamillions",
"draw_date": "2026-10-02",
"numbers": [
6,
37,
40,
1,
2
],
"bonus": [
10
],
"matched_main": 3,
"matched_bonus": 1,
"tier": "3+1",
"prize": null,
"currency": "USD",
"prize_min": 400,
"prize_max": 2000,
"prize_note": "Every ticket has a built-in 2x-10x multiplier; pass multiplier to get the exact prize",
"disclaimer": "This is not a prize claim. Prizes are paid only by the official lottery, under its rules and claim deadlines."
}

Code Examples

curl -X GET "https://api.api-ninjas.com/v1/lotterycheck?game=megamillions&date=2026-10-02&numbers=6,37,40,1,2&bonus=10" \ -H "X-Api-Key: YOUR_API_KEY"

Frequently Asked Questions

  • Yes, but you must have a premium subscription. Commercial use of the Mega Millions API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.
  • Sign up for a free account to instantly get your API key, then pass it in the X-Api-Key header on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.
  • Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.
  • The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.
  • No. Mega Millions does not publish a public developer API. The API Ninjas Lottery API provides Mega Millions results, jackpots and history from official state lottery publications. API Ninjas is not affiliated with or endorsed by Mega Millions.
  • Call /v1/lottery?game=megamillions. The response includes the five white balls, the Mega Ball and the jackpot for that draw. Paid plans also get the cash value and the estimated jackpot for the next draw, within minutes of the draw; on the free plan results appear about an hour after the draw.
  • Since 8 April 2025 tickets cost $5, the Mega Ball range is 1 to 24, and every ticket carries a built-in 2x to 10x multiplier instead of the optional Megaplier. Each draw's rules_version tells you which rules applied. The ticket checker (paid plans) takes the ticket's printed multiplier; without it, it returns the prize range.
  • Our archive starts with the draw of 17 May 2002, covering every change of number format since. The full history is available on the Business tier and above; Developer plans get the last two years.

API Ninjas is not affiliated with or endorsed by any lottery operator. Powerball and Mega Millions are trademarks of their respective owners. Results are compiled from publicly available lottery results; in any discrepancy the official lottery's records prevail, so always verify winning tickets with the official lottery.