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:
- /v1/lottery - Latest or dated draw for a game or country
- /v1/lotteryhistorical - Past draws
- /v1/lotterygames - Game rules, schedules and odds
- /v1/lotterycheck - Check a ticket
- /v1/lotteryjackpots - Upcoming jackpots
Game guides: Powerball API and Mega Millions API.
Covered games
| Region | Games | game values |
|---|---|---|
| US multi-state | Powerball (with Double Play), Mega Millions, Millionaire for Life | powerball, megamillions, millionaireforlife |
| US multi-state (archive) | Cash4Life, retired February 2026 | cash4life |
| New York | NY Lotto, Take 5, Pick 10, Numbers, Win 4 | us-ny-lotto, us-ny-take5, us-ny-pick10, us-ny-numbers, us-ny-win4 |
| Pennsylvania | Match 6, Cash 5, Treasure Hunt, Pick 2, Pick 3, Pick 4, Pick 5 | us-pa-match6, us-pa-cash5, us-pa-treasurehunt, us-pa-pick2 ... us-pa-pick5 |
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
gamerequired unless country is setGame slug, e.g.
powerball,megamillions,us-ny-take5. Common spellings such asmega-millionsalso work. See /v1/lotterygames for every game.countryrequired unless game is setISO 3166-1 alpha-2 code (e.g.
US). Returns the latest draw of every covered game in that country.dateoptionalDraw date (YYYY-MM-DD). Developer plans: the last two years. Business and above: any date in the archive. Not available on the free plan.
sessionoptionalFor games with several draws a day (e.g.
midday,evening). Defaults to the latest draw that day.
Headers
X-Api-KeyrequiredAPI 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.
gameGame slug, e.g.
powerball.game_nameDisplay name of the game.
countryISO 3166-1 alpha-2 country code.
draw_dateDraw date in the operator's local time zone (YYYY-MM-DD).
sessionOnly for games with several draws a day: e.g.
middayorevening.draw_timeScheduled draw time in ISO 8601 with the operator's UTC offset, or null where the operator does not publish one.
main_numbersWinning numbers as integers. Digit games (Numbers, Win 4, Pick 2-5) keep draw order; other games use the order the source publishes.
bonus_numbersBonus ball(s), e.g. the Powerball or Mega Ball;
[]for games without one.bonus_nameName of the bonus ball, when the game has one.
multiplierDrawn multiplier (e.g. Power Play), when the game draws one.
multiplier_nameName of the multiplier.
secondary_drawsExtra draws on the same ticket, e.g. Powerball
Double Play.jackpotJackpot for this draw:
currency,amount(advertised),cash_value,estimatedandwon.next_drawDate, time and estimated jackpot of the next draw.
rules_versionEffective date of the number format in force on this draw date. Use it to read older draws correctly when a game's format changed.
revisionStarts at 1 and increases if the operator corrects the draw.
sourceWhere the result came from:
name,url,retrieved_at, andcross_checked(true once a second official source has confirmed the numbers).
Live Demo
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
gamerequiredGame slug.
startoptionalEarliest draw date to include (YYYY-MM-DD).
endoptionalLatest draw date to include (YYYY-MM-DD).
sessionoptionalOnly draws from this session, for games with several draws a day.
limitoptionalNumber of draws to return (1-1000). Default
100.offsetoptionalNumber of draws to skip, for paging. Default
0.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON array of draw objects (same fields as /v1/lottery), or an error.
Live Demo
Get a free API key to get started — no credit card required.
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
gameoptionalReturn one game.
countryoptionalReturn the games of one country.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON array of game objects, or an error.
matrixCurrent number format: count and range of main and bonus numbers.
draw_scheduleDraw days, local time and IANA time zone.
jackpot_oddsOdds of the top prize as N in 1 in N.
prize_tiersPrize table, where the game has fixed prizes.
rules_historyEvery number-format change with its effective date.
history_start, latest_draw_dateRange of the archive.
endpoints, docsWhere to query the game and its documentation page.
Live Demo
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
gamerequiredpowerball,megamillionsormillionaireforlife.daterequiredDraw date (YYYY-MM-DD). Developer plans: the last two years.
numbersrequiredMain numbers on the ticket, comma separated.
bonusrequiredBonus ball on the ticket (Powerball, Mega Ball or Millionaire Ball).
power_playoptionalPowerball only:
trueif the ticket has Power Play.double_playoptionalPowerball only:
trueto also score the Double Play draw.multiplieroptionalMega Millions only: the 2x-10x multiplier printed on the ticket (
2,3,4,5or10). Without it, the prize range is returned.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON object with the following fields, or an error.
matched_main, matched_bonusHow many main and bonus numbers matched.
tierPrize tier, e.g.
3+1, or null for no prize.prizePrize amount,
"jackpot", or null. Mega Millions withoutmultiplierreturnsprize_minandprize_maxinstead.double_playResult of the Double Play draw, when requested.
disclaimerReminder that only the official lottery pays prizes.
Live Demo
Get a free API key to get started — no credit card required.
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
countryoptionalISO 3166-1 alpha-2 code, e.g.
US.currencyoptionalISO 4217 code, e.g.
USD.minoptionalOnly jackpots of at least this amount.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON array of jackpot objects, or an error.
game, game_name, countryThe game.
draw_date, draw_timeWhen the jackpot will be drawn.
amount, cash_value, currencyAdvertised jackpot and its cash value, where published.
last_draw_dateDate of the draw that set this estimate.
Live Demo
Code Examples
curl -X GET "https://api.api-ninjas.com/v1/lotteryjackpots" \
-H "X-Api-Key: YOUR_API_KEY"Frequently Asked Questions
Can I use the Lottery API for commercial purposes?
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.How do I get an API key and start using the Lottery API?
Sign up for a free account to instantly get your API key, then pass it in theX-Api-Keyheader on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.What happens if I exceed my quota for the month?
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.What happens if a request to the Lottery API fails?
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.Which lotteries does the Lottery API cover?
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/lotterygamesfor the live list with each game's number format, draw schedule and odds. Game pages: Powerball API, Mega Millions API.How quickly are new results available?
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_checkedtells you whether that has happened yet.How much history can I access?
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.Can I check whether a ticket won?
Yes./v1/lotterycheckscores 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.Is API Ninjas affiliated with any lottery?
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.
Explore API integration use cases for recommended APIs and workflow examples.
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.