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, with the jackpot and cash value, the next jackpot estimate, and 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:

  • /v1/lottery?game=megamillions - latest draw, or any date with date
  • /v1/lotteryhistorical?game=megamillions - past draws
  • /v1/lotterycheck?game=megamillions - check a ticket

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 latest draw of every game in a country, or the draw on a given date. Results usually appear within minutes of the official publication.

Full parameter and response reference: /v1/lottery.

Live Demo

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

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. Free plans get the latest 10 draws; Developer plans a rolling two years; Business and above the full archive (Powerball from 2010, Mega Millions from 2002, New York's Numbers and Win 4 from 1980).

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 · premium API key required
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, the jackpot for that draw and the estimated jackpot for the next 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 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. Full history is available on Business and Professional plans; 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 collected from official public lottery publications; in any discrepancy the official lottery's records prevail, so always verify winning tickets with the official lottery.