Discover/NY API
live

NY APInylottery.ny.gov

Access NY Lottery draw results, historical winning numbers, scratch-off games, retailer locations, and recent winners via a structured JSON API.

Endpoint health
verified 5d ago
get_number_frequency
get_latest_draws
get_game_draws
get_recent_winners
get_historical_results
7/7 passing latest checkself-healing
Endpoints
7
Updated
21d ago

What is the NY API?

This API covers 7 endpoints against nylottery.ny.gov, returning structured data for draw results, historical winning numbers, scratch-off game catalogs, retailer locations, and recent winner announcements. The get_game_draws endpoint returns the latest 10 draws per game including primary and secondary number arrays, jackpot estimates, and draw timestamps. Supported games include Powerball, Mega Millions, Cash4Life, Lotto, Take5, Win4, Numbers, Pick10, and QuickDraw.

Try it

No input parameters required.

api.parse.bot/scraper/9211b077-5bb6-4e8f-88f3-6e88cadf6d85/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Call it over HTTPgrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/9211b077-5bb6-4e8f-88f3-6e88cadf6d85/get_latest_draws' \
  -H 'X-API-Key: $PARSE_API_KEY'
Python SDK · recommended

Typed, relational, agent-ready

A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.

  • Fully typed · autocompletes
  • Objects link to objects
  • Typed errors & pagination

Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:

uv add parse-sdk
uv run parse init
uv run parse add --marketplace nylottery-ny-gov-api

uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.

"""Walkthrough: NY Lottery SDK — bounded, re-runnable; every call capped."""
from parse_apis.new_york_lottery_api import NYLottery, LotteryGame, NotFoundError

nylottery = NYLottery()

# Get all games' latest draws at once
all_draws = nylottery.games.all_draws()
if all_draws.powerball:
    print(all_draws.powerball.game_id, all_draws.powerball.next_draw)
if all_draws.megamillions:
    print(all_draws.megamillions.game_id, all_draws.megamillions.last_draw)

# Get recent draws for a single game via constructible Game resource
game = nylottery.game(name=LotteryGame.POWERBALL)
draws_report = game.draws()
print(draws_report.game_id, draws_report.next_draw, draws_report.last_draw)
for draw in draws_report.draws[:3]:
    print(draw.draw_number, draw.draw_time, draw.estimated_jackpot)
    if draw.results:
        for result in draw.results:
            print(result.primary, result.secondary, result.multiplier)

# Analyze number frequency for Mega Millions
mega = nylottery.game(name=LotteryGame.MEGAMILLIONS)
freq = mega.number_frequency(lookback=100)
print(freq.game, freq.total_records_analyzed)
for num in freq.main_numbers[:5]:
    print(num.number, num.count, num.frequency)

# List scratch-off games
for ticket in nylottery.scratchoffgames.list(limit=3):
    print(ticket.title, ticket.ticket_price, ticket.overall_odds)

# Search for nearby retailers
for retailer in nylottery.retailers.search(lat="40.7128", lon="-74.0060", miles="2", limit=3):
    print(retailer.title, retailer.field_street_address, retailer.field_city)

# Browse recent winners with typed error handling
try:
    winner = nylottery.winners.list(limit=1).first()
    if winner:
        print(winner.name, winner.prize, winner.prize_type, winner.date, winner.location)
except NotFoundError as exc:
    print(f"not found: {exc}")

print("exercised: games.all_draws / game.draws / game.number_frequency / scratchoffgames.list / retailers.search / winners.list")
All endpoints · 7 totalmissing one? ·

Get latest draw results and jackpot information for all New York Lottery draw games. Returns a map of game names to their latest draws data including cash4life, powerball, lotto, megamillions, million4life, pick10, numbers, take5, win4, quickdraw, and raffle. Each game entry contains a draws array, next_draw timestamp, and last_draw timestamp.

Input

No input parameters required.

Response
{
  "type": "object",
  "fields": {
    "lotto": "object with draws array, next_draw and last_draw timestamps for NY Lotto game",
    "cash4life": "object with draws array, next_draw and last_draw timestamps for Cash4Life game",
    "powerball": "object with draws array, next_draw and last_draw timestamps for Powerball game",
    "megamillions": "object with draws array, next_draw and last_draw timestamps for Mega Millions game"
  },
  "sample": {
    "data": {
      "powerball": {
        "draws": [
          {
            "status": 4,
            "drawTime": 1781064000000,
            "gameName": "powerball",
            "drawNumber": 1958,
            "estimatedJackpot": 238000000
          }
        ],
        "gameId": "15",
        "last_draw": 1780970415000,
        "next_draw": 1781143215000
      },
      "megamillions": {
        "draws": [
          {
            "status": 4,
            "drawTime": 1781236800000,
            "gameName": "megamillions",
            "drawNumber": 2513,
            "estimatedJackpot": 413000000
          }
        ],
        "gameId": "12",
        "last_draw": 1781056815000,
        "next_draw": 1781316015000
      }
    },
    "status": "success"
  }
}

About the NY API

Draw Results and Jackpots

get_latest_draws returns a map of game names to their current draw data — no parameters needed. Each game object includes a draws array plus next_draw and last_draw as Unix timestamps in milliseconds. For deeper per-game data, get_game_draws accepts a game string and returns the 10 most recent draws ordered descending by drawTime, with each draw object containing drawNumber, status, results.primary, results.secondary, and estimatedJackpot where applicable.

Historical Data and Frequency Analysis

get_historical_results pulls from the data.ny.gov open data dataset and supports start_date and end_date filters in YYYY-MM-DD format alongside limit and offset for pagination. Each item in the items array includes draw_date, winning_numbers as a space-separated string, and game-specific bonus fields. get_number_frequency builds on that history: supply a game name and optional lookback count to get main_numbers and bonus_numbers arrays sorted by frequency descending, each entry carrying number, count, and frequency. The response also includes total_records_analyzed so you know exactly how much data the calculation covers.

Scratch-Offs and Retailers

get_scratch_off_games returns the full active catalog via a rows array. Each row includes title, ticket_price, game_number, top_prize_amount, top_prize_remaining, and overall_odds — enough to filter by price tier or remaining top prizes. search_retailers accepts lat, lon, and miles parameters and returns paginated retailer records with title, field_street_address, field_city, field_state, field_zipcode, and field_geofield coordinates. The pager object reports total_items, total_pages, and items_per_page.

Recent Winners

get_recent_winners returns a paginated list of winner announcements. Each row includes name, prize, prize_type, date, location, a body field containing the full HTML announcement text, and image URLs for the game logo. Pages are 0-indexed with 10 items per page; the pager object provides navigation context.

Reliability & maintenanceVerified

The NY API is a managed, monitored endpoint for nylottery.ny.gov — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when nylottery.ny.gov changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.

This isn't an official nylottery.ny.gov API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.

Last verified
5d ago
Latest check
7/7 endpoints passing
Maintenance
Monitored & self-healing
Will this API break when the source site changes?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • Build a lottery results dashboard that surfaces the latest jackpot estimates and winning numbers across all NY Lottery games using get_latest_draws.
  • Create a number-frequency tracker that identifies statistically common draw numbers over a configurable lookback window with get_number_frequency.
  • Populate a scratch-off comparison tool showing ticket prices, overall odds, and remaining top prizes from get_scratch_off_games.
  • Build a retail store locator that returns nearby NY Lottery retailers within a given radius using search_retailers with lat/lon parameters.
  • Archive historical Powerball or Mega Millions draw records with date-range filtering via get_historical_results for statistical analysis.
  • Display a recent-winners feed with prize amounts, locations, and full announcement text pulled from get_recent_winners.
  • Power a game-specific results page with the 10 most recent draw outcomes, multipliers, and draw status via get_game_draws.
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 req/min

One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.

Frequently asked questions
Does nylottery.ny.gov have an official developer API?+
NY Lottery does not publish a documented public developer API. Historical draw data is available through the New York State open data portal at data.ny.gov, which provides bulk CSV and JSON downloads, but there is no official endpoint for live jackpot data, scratch-off catalogs, or retailer search.
What does get_historical_results return, and how far back does the data go?+
It returns records from the data.ny.gov open data dataset, each containing draw_date, winning_numbers as a space-separated string, and game-specific bonus fields. You can filter by start_date and end_date (YYYY-MM-DD format) and paginate with limit and offset. Coverage depth depends on how far back data.ny.gov holds records for each game, which varies by game.
Does get_game_draws return more than 10 draws per request?+
The endpoint currently returns the latest 10 draws per game ordered by drawTime descending. For larger historical datasets, use get_historical_results, which supports pagination via the offset parameter and date-range filtering.
Does the API cover Second Chance draw results or promotional draws?+
Not currently. The API covers standard draw games (Powerball, Mega Millions, Lotto, Cash4Life, Take5, Win4, Numbers, Pick10, QuickDraw, and Raffle), scratch-off game metadata, retailer locations, and recent winner announcements. You can fork this API on Parse and revise it to add an endpoint targeting Second Chance or promotional draw data.
How fresh is the draw data returned by get_latest_draws?+
The response reflects the most recently completed draw as indicated by the last_draw timestamp in each game object. NY Lottery draw schedules vary by game — some games draw multiple times daily (Win4, Numbers, QuickDraw) while others are weekly — so freshness is tied to that schedule. There is no real-time streaming; the data reflects the latest completed draw at the time of the request.
Page content last updated . Spec covers 7 endpoints from nylottery.ny.gov.
Related APIs in Government PublicSee all →
lotteryusa.com API
Check the latest winning numbers and jackpot amounts across all US lotteries, and view detailed prize breakdowns by state and game. Stay updated on lottery results instantly without visiting multiple lottery websites.
lotterypost.com API
Check daily lottery results and jackpot amounts across 20+ US states and multi-state games, plus browse historical drawing data to track past winners and prize trends. Quickly compare results from multiple states or look up specific games all in one place.
powerball.com API
Check the latest Powerball drawing results, historical winning numbers, current jackpot amounts, and prize information all in one place. Browse past draws by date, view odds and prize breakdowns, and explore stories from winners to stay informed about your favorite lottery game.
calottery.com API
Check the latest California Lottery results for Powerball and Mega Millions, including up to 120 recent draws from 2025 and historical data for all available games. Search past winning numbers and game information across California's lottery draw games.
megamillions.com API
Check the latest Mega Millions winning numbers and jackpot amounts, browse historical drawings, and discover the top jackpots across participating lottery states. Stay updated on lottery results and track winning combinations whenever you need them.
usamega.com API
Check the latest Mega Millions and Powerball results, jackpot amounts, and winning odds all in one place. Analyze drawing details and tax implications to make smarter lottery decisions.
sportstoto.com.my API
Access Sports Toto Malaysia lottery jackpots, draw results, and past results calendars. Retrieve winning numbers, prize amounts, and comprehensive 4D frequency statistics for historical analysis.
bet.hkjc.com API
Check the latest Hong Kong Jockey Club Mark Six lottery results with prize breakdowns and view historical frequency statistics for all 49 numbers to analyze winning patterns. Find out when the next draw is scheduled and see detailed information about completed draws.