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

Lottery API

The Lottery API provides winning numbers, jackpots and draw history for Powerball, Mega Millions and US state lottery games, collected from official lottery publications and cross-checked against a second official source.

Available endpoints:

Game guides: Powerball API and Mega Millions API.

Covered games

RegionGamesgame values
US multi-statePowerball (with Double Play), Mega Millions, Millionaire for Lifepowerball, megamillions, millionaireforlife
US multi-state (archive)Cash4Life, retired February 2026cash4life
New YorkNY Lotto, Take 5, Pick 10, Numbers, Win 4us-ny-lotto, us-ny-take5, us-ny-pick10, us-ny-numbers, us-ny-win4
PennsylvaniaMatch 6, Cash 5, Treasure Hunt, Pick 2, Pick 3, Pick 4, Pick 5us-pa-match6, us-pa-cash5, us-pa-treasurehunt, us-pa-pick2 ... us-pa-pick5
5 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.

Parameters

  • game  required unless country is set

    Game slug, e.g. powerball, megamillions, us-ny-take5. Common spellings such as mega-millions also work. See /v1/lotterygames for every game.

  • country  required unless game is set

    ISO 3166-1 alpha-2 code (e.g. US). Returns the latest draw of every covered game in that country.

  • date  optional

    Draw date (YYYY-MM-DD). Developer plans: the last two years. Business and above: any date in the archive. Not available on the free plan.

  • session  optional

    For games with several draws a day (e.g. midday, evening). Defaults to the latest draw that day.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON object with the following fields (a JSON array of them when country is used), or an error if the request is unsuccessful.

  • game

    Game slug, e.g. powerball.

  • game_name

    Display name of the game.

  • country

    ISO 3166-1 alpha-2 country code.

  • draw_date

    Draw date in the operator's local time zone (YYYY-MM-DD).

  • session

    Only for games with several draws a day: e.g. midday or evening.

  • draw_time

    Scheduled draw time in ISO 8601 with the operator's UTC offset, or null where the operator does not publish one.

  • main_numbers

    Winning numbers as integers. Digit games (Numbers, Win 4, Pick 2-5) keep draw order; other games use the order the source publishes.

  • bonus_numbers

    Bonus ball(s), e.g. the Powerball or Mega Ball; [] for games without one.

  • bonus_name

    Name of the bonus ball, when the game has one.

  • multiplier

    Drawn multiplier (e.g. Power Play), when the game draws one.

  • multiplier_name

    Name of the multiplier.

  • secondary_draws

    Extra draws on the same ticket, e.g. Powerball Double Play.

  • jackpot

    Jackpot for this draw: currency, amount (advertised), cash_value, estimated and won.

  • next_draw

    Date, time and estimated jackpot of the next draw.

  • rules_version

    Effective date of the number format in force on this draw date. Use it to read older draws correctly when a game's format changed.

  • revision

    Starts at 1 and increases if the operator corrects the draw.

  • source

    Where the result came from: name, url, retrieved_at, and cross_checked (true once a second official source has confirmed the numbers).

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=powerball
Sample response
{
"game": "powerball",
"game_name": "Powerball",
"country": "US",
"draw_date": "2026-10-05",
"draw_time": "2026-10-05T22:59:00-04:00",
"main_numbers": [
16,
23,
32,
36,
54
],
"bonus_numbers": [
9
],
"bonus_name": "Powerball",
"multiplier": 2,
"multiplier_name": "Power Play",
"secondary_draws": [
{
"name": "Double Play",
"main_numbers": [
7,
22,
29,
35,
51
],
"bonus_numbers": [
20
]
}
],
"jackpot": {
"currency": "USD",
"amount": 467000000,
"cash_value": 192400000,
"estimated": true,
"won": false
},
"next_draw": {
"draw_date": "2026-10-07",
"draw_time": "2026-10-07T22:59:00-04:00",
"jackpot": {
"currency": "USD",
"amount": 485000000,
"cash_value": 199800000,
"estimated": true
}
},
"rules_version": "2015-10-07",
"revision": 1,
"source": {
"name": "Pennsylvania Lottery",
"url": "https://www.palottery.pa.gov/feeds/Games.aspx",
"retrieved_at": "2026-10-06T03:06:02Z",
"cross_checked": false
}
}

Code Examples

curl -X GET "https://api.api-ninjas.com/v1/lottery?game=powerball" \ -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).

Parameters

  • game  required

    Game slug.

  • start  optional

    Earliest draw date to include (YYYY-MM-DD).

  • end  optional

    Latest draw date to include (YYYY-MM-DD).

  • session  optional

    Only draws from this session, for games with several draws a day.

  • limit  optional

    Number of draws to return (1-1000). Default 100.

  • offset  optional

    Number of draws to skip, for paging. Default 0.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON array of draw objects (same fields as /v1/lottery), or an error.

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=powerball
Sample response
[
{
"game": "powerball",
"game_name": "Powerball",
"country": "US",
"draw_date": "2026-10-05",
"draw_time": "2026-10-05T22:59:00-04:00",
"main_numbers": [
16,
23,
32,
36,
54
],
"bonus_numbers": [
9
],
"bonus_name": "Powerball",
"multiplier": 2,
"multiplier_name": "Power Play",
"secondary_draws": [
{
"name": "Double Play",
"main_numbers": [
7,
22,
29,
35,
51
],
"bonus_numbers": [
20
]
}
],
"jackpot": {
"currency": "USD",
"amount": 467000000,
"cash_value": 192400000,
"estimated": true,
"won": false
},
"next_draw": {
"draw_date": "2026-10-07",
"draw_time": "2026-10-07T22:59:00-04:00",
"jackpot": {
"currency": "USD",
"amount": 485000000,
"cash_value": 199800000,
"estimated": true
}
},
"rules_version": "2015-10-07",
"revision": 1,
"source": {
"name": "Pennsylvania Lottery",
"url": "https://www.palottery.pa.gov/feeds/Games.aspx",
"retrieved_at": "2026-10-06T03:06:02Z",
"cross_checked": false
}
},
"..."
]

Code Examples

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

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

Lists the covered games with their number format, draw schedule, jackpot odds, prize tiers, rule-change history and archive range.

Parameters

  • game  optional

    Return one game.

  • country  optional

    Return the games of one country.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON array of game objects, or an error.

  • matrix

    Current number format: count and range of main and bonus numbers.

  • draw_schedule

    Draw days, local time and IANA time zone.

  • jackpot_odds

    Odds of the top prize as N in 1 in N.

  • prize_tiers

    Prize table, where the game has fixed prizes.

  • rules_history

    Every number-format change with its effective date.

  • history_start, latest_draw_date

    Range of the archive.

  • endpoints, docs

    Where to query the game and its documentation page.

Live Demo

Live demo · no API key required
Query parameters
game
country

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/lotterygames?game=powerball
Sample response
[
{
"game": "powerball",
"name": "Powerball",
"country": "US",
"subdivision": null,
"operator": "Multi-State Lottery Association",
"currency": "USD",
"ticket_price": 2,
"status": "active",
"sessions": null,
"draw_schedule": {
"days": [
"mon",
"wed",
"sat"
],
"time": "22:59",
"timezone": "America/New_York"
},
"matrix": {
"main": {
"count": 5,
"min": 1,
"max": 69,
"unique": true
},
"bonus": {
"count": 1,
"min": 1,
"max": 26,
"same_pool": false
}
},
"bonus_name": "Powerball",
"add_ons": [
"Power Play",
"Double Play"
],
"jackpot_odds": 292201338,
"prize_tiers": [
{
"tier": "5+1",
"match_main": 5,
"match_bonus": 1,
"prize": "jackpot"
},
{
"tier": "5+0",
"match_main": 5,
"match_bonus": 0,
"prize": 1000000
},
"..."
],
"prize_tiers_per_draw": false,
"rules_history": [
{
"effective": "2009-01-07",
"main": {
"count": 5,
"min": 1,
"max": 59
},
"bonus": {
"count": 1,
"min": 1,
"max": 39
}
},
{
"effective": "2012-01-15",
"main": {
"count": 5,
"min": 1,
"max": 59
},
"bonus": {
"count": 1,
"min": 1,
"max": 35
}
},
{
"effective": "2015-10-07",
"main": {
"count": 5,
"min": 1,
"max": 69
},
"bonus": {
"count": 1,
"min": 1,
"max": 26
}
}
],
"history_start": "2010-02-03",
"latest_draw_date": "2026-10-05",
"sources": [
{
"name": "Pennsylvania Lottery"
},
{
"name": "New York State Gaming Commission (data.ny.gov)"
}
],
"endpoints": [
"/v1/lottery?game=powerball",
"/v1/lotteryhistorical?game=powerball"
],
"docs": "https://api-ninjas.com/api/powerball"
}
]

Code Examples

curl -X GET "https://api.api-ninjas.com/v1/lotterygames?game=powerball" \ -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.

Parameters

  • game  required

    powerball, megamillions or millionaireforlife.

  • date  required

    Draw date (YYYY-MM-DD). Developer plans: the last two years.

  • numbers  required

    Main numbers on the ticket, comma separated.

  • bonus  required

    Bonus ball on the ticket (Powerball, Mega Ball or Millionaire Ball).

  • power_play  optional

    Powerball only: true if the ticket has Power Play.

  • double_play  optional

    Powerball only: true to also score the Double Play draw.

  • multiplier  optional

    Mega Millions only: the 2x-10x multiplier printed on the ticket (2, 3, 4, 5 or 10). Without it, the prize range is returned.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON object with the following fields, or an error.

  • matched_main, matched_bonus

    How many main and bonus numbers matched.

  • tier

    Prize tier, e.g. 3+1, or null for no prize.

  • prize

    Prize amount, "jackpot", or null. Mega Millions without multiplier returns prize_min and prize_max instead.

  • double_play

    Result of the Double Play draw, when requested.

  • disclaimer

    Reminder that only the official lottery pays prizes.

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=powerball&date=2026-10-05&numbers=16,23,32,1,2&bonus=9&power_play=true&double_play=true
Sample response
{
"game": "powerball",
"draw_date": "2026-10-05",
"numbers": [
16,
23,
32,
1,
2
],
"bonus": [
9
],
"matched_main": 3,
"matched_bonus": 1,
"tier": "3+1",
"prize": 200,
"currency": "USD",
"double_play": {
"matched_main": 0,
"matched_bonus": 0,
"tier": null,
"prize": null
},
"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=powerball&date=2026-10-05&numbers=16,23,32,1,2&bonus=9&power_play=true&double_play=true" \ -H "X-Api-Key: YOUR_API_KEY"

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

Lists the next advertised jackpot for every active game that publishes one, largest first within each currency.

Parameters

  • country  optional

    ISO 3166-1 alpha-2 code, e.g. US.

  • currency  optional

    ISO 4217 code, e.g. USD.

  • min  optional

    Only jackpots of at least this amount.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON array of jackpot objects, or an error.

  • game, game_name, country

    The game.

  • draw_date, draw_time

    When the jackpot will be drawn.

  • amount, cash_value, currency

    Advertised jackpot and its cash value, where published.

  • last_draw_date

    Date of the draw that set this estimate.

Live Demo

Live demo · no API key required
Query parameters
country
currency
min

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/lotteryjackpots
Sample response
[
{
"game": "powerball",
"game_name": "Powerball",
"country": "US",
"draw_date": "2026-10-07",
"draw_time": "2026-10-07T22:59:00-04:00",
"currency": "USD",
"amount": 485000000,
"cash_value": 199800000,
"estimated": true,
"last_draw_date": "2026-10-05"
},
{
"game": "megamillions",
"game_name": "Mega Millions",
"country": "US",
"draw_date": "2026-10-06",
"draw_time": "2026-10-06T23:00:00-04:00",
"currency": "USD",
"amount": 345000000,
"cash_value": 139600000,
"estimated": true,
"last_draw_date": "2026-10-02"
},
"..."
]

Code Examples

curl -X GET "https://api.api-ninjas.com/v1/lotteryjackpots" \ -H "X-Api-Key: YOUR_API_KEY"

Frequently Asked Questions

  • Yes, but you must have a premium subscription. Commercial use of the Lottery 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.
  • Powerball, Mega Millions and Millionaire for Life; New York's NY Lotto, Take 5, Pick 10, Numbers and Win 4; Pennsylvania's Match 6, Cash 5, Treasure Hunt and Pick 2 to Pick 5; and the retired Cash4Life archive. Call /v1/lotterygames for the live list with each game's number format, draw schedule and odds. Game pages: Powerball API, Mega Millions API.
  • Results are collected every two minutes from official lottery publications. A Powerball draw at 10:59 pm ET is typically available within about ten minutes. Each draw is cross-checked against a second official source; source.cross_checked tells you whether that has happened yet.
  • Free plans get the latest 10 draws per game. Developer plans get a rolling two years. Business and Professional plans get the full archive: Powerball from 2010, Mega Millions from 2002, and New York's Numbers and Win 4 from 1980. See the pricing page.
  • Yes. /v1/lotterycheck scores a ticket against a draw and returns the matched tier and prize, including Power Play, Double Play and the Mega Millions multiplier. It is available on paid plans for Powerball, Mega Millions and Millionaire for Life. It is not a prize claim: only the official lottery pays prizes, under its own rules and deadlines.
  • No. API Ninjas is not affiliated with or endorsed by any lottery operator. Results come from official public lottery publications, but in any discrepancy the official lottery's records prevail, so always verify winning tickets with the official lottery.

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.