# Lottery Results API - Powerball, Mega Millions, History (`martin10291/lottery-results-api`) Actor

No API key. Official lottery results as clean JSON from New York State Gaming Commission open data: Powerball (2010+), Mega Millions (2002+), Millionaire for Life (2026), Cash4Life, NY Lotto, Take 5, Numbers, Win 4, Pick 10, Quick Draw. Latest drawing, one date, full history, ticket check with match

- **URL**: https://apify.com/martin10291/lottery-results-api.md
- **Developed by:** [Martin Petrov](https://apify.com/martin10291) (community)
- **Categories:** Developer tools, Automation, Business
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Lottery Results API - Powerball, Mega Millions, History

**Problem:** your lottery app, results widget, number-statistics site or AI agent needs last night's Powerball or Mega Millions numbers, a past drawing, or a check of a ticket. Results sit on lottery web pages in different formats, history is hard to get in one piece, and scraped feeds break.

**This API:** one JSON call, no API key, answers from a maintained copy of the official New York State Gaming Commission open data (refreshed every 20 minutes).

- **Games:** Powerball (since 2010, with Power Play and Double Play), Mega Millions (since 2002), Millionaire for Life (the new 2026 national game), Cash4Life (retired 2026, full history), and New York games: Lotto, Take 5, Numbers (Pick 3), Win 4 (Pick 4), Pick 10, Quick Draw.
- **Modes:** `latest`, `date`, `history` (date range, newest first), `check` (your numbers vs one drawing or every drawing in a range: matched numbers, tier like `4 + Powerball`, prize in USD where the official prize table is fixed), `frequency` (hot / cold numbers over a date range or the last N drawings), `games` (every game with first/last draw and number ranges).
- **Clean rows:** numbers as integers, bonus ball and multiplier in their own fields, midday/evening drawings as separate rows, digit order kept for Numbers and Win 4.
- **Source:** New York State Gaming Commission via data.ny.gov (OPEN-NY terms). Every row carries `source` and `sourceUrl`. Jackpot amounts are not part of the official data and are not returned.

### Example (API)

```bash
curl -X POST "https://api.apify.com/v2/acts/martin10291~lottery-results-api/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"game": "powerball", "mode": "latest"}'
```

Output row (measured 2026-11-16):

```json
{"game": "powerball", "gameName": "Powerball", "drawDate": "2026-11-14", "drawTime": null,
 "numbers": [9, 44, 49, 51, 68], "bonusName": "Powerball", "bonus": 4, "multiplier": 2,
 "doublePlay": {"numbers": [15, 25, 30, 32, 67], "bonus": 1},
 "source": "New York State Gaming Commission via data.ny.gov", "sourceUrl": "https://data.ny.gov/d/d6yy-54nr"}
```

Check a Mega Millions ticket (`{"game": "megamillions", "mode": "check", "numbers": "10 22 33 49 57", "bonus": 1, "date": "2026-11-13", "multiplier": 3}`):

```json
{"drawDate": "2026-11-13", "numbers": [10, 22, 33, 49, 57], "bonus": 18,
 "matchedNumbers": [10, 22, 33, 49, 57], "matchCount": 5, "bonusMatched": false,
 "tier": "5", "prizeBaseUSD": 1000000, "prizeUSD": 3000000}
```

Hot numbers over the last 100 Powerball drawings (`{"game": "powerball", "mode": "frequency", "draws": 100}`):

```json
{"number": 42, "kind": "main", "count": 13, "percent": 13.0, "lastDrawn": "2026-11-11", "drawsSinceLast": 1, "rank": 1, "heat": "hot"}
```

More inputs:

- `{"game": "megamillions", "mode": "history", "startDate": "2025-01-01", "endDate": "2025-12-31", "limit": 200}`
- `{"game": "win4", "mode": "date", "date": "2026-11-10"}` -> midday and evening rows, digits in order.
- `{"game": "powerball", "mode": "check", "numbers": "3 12 42 44 61", "bonus": 9, "startDate": "2025-01-01"}` -> only drawings where the ticket matched.
- `{"mode": "games"}` -> every game, number ranges, draw days.

### Use from agents (MCP)

Add the Apify MCP server (`https://mcp.apify.com?tools=martin10291/lottery-results-api`) to Claude, Cursor or any MCP client and ask: "What were the last Powerball numbers, and did 9 44 49 51 68 with Powerball 4 win anything?".

### Schedule it

Set `onlyNew: true` and a `monitorId`, schedule the actor after each draw day: each run returns only the drawings that are new since the last run with that Monitor ID.

### Notes

- Results are official data republished by New York State; always confirm a winning ticket with the official lottery before you act on it.
- Prize amounts: Powerball tiers since 2015-10-07 and Mega Millions tiers since 2025-04-08 (with the ticket multiplier). Other games and older drawings return the tier and `prizeNote`.

### FAQ

- **How fresh is the data?** Our copy refreshes every 20 minutes. New York usually posts a drawing within hours (Powerball and Mega Millions results the next morning, New York time). Each game's newest date is in `{"mode": "games"}`.
- **Limits?** Up to 5000 rows per call; history goes back to 2002 (Mega Millions), 2010 (Powerball), 1980 (Numbers / Win 4). Quick Draw (every 4 minutes) is served by date range, up to 5000 drawings.
- **Errors?** Bad input returns a clear message starting with `invalid input:` (for example a number out of range or an unknown game). If data.ny.gov is down, the last saved copy is served and rows carry `"stale": true`.
- **Jackpots?** Jackpot amounts and winners per tier are not in the official open data, so they are not returned.

# Actor input Schema

## `game` (type: `string`):

Which lottery game: powerball (since 2010), megamillions (since 2002) and millionaireforlife (since 2026) are multi-state games; nylotto, take5, numbers, win4, pick10, quickdraw are New York State games; cash4life is retired (history 2014-2026). Use the exact value, for example megamillions.

## `mode` (type: `string`):

latest = newest drawing (Quick Draw: newest 10); date = drawings on one day (no drawing that day returns the nearest earlier one with a note); history = every drawing between Start and End date, newest first; check = compare your numbers with one drawing or every drawing in a range (matches, tier, prize where the official table is fixed); frequency = how often each number was drawn, with rank and hot/cold; games = every game with dates and number ranges. The example input (and an empty Apify run) shows the last 30 Powerball drawings.

## `date` (type: `string`):

For mode date, or the drawing to check in mode check: YYYY-MM-DD, for example 2026-11-14. Empty in check mode = the latest drawing.

## `startDate` (type: `string`):

For history, frequency and range checks: first day, YYYY-MM-DD. Default: 90 days back (history) or 365 days back (frequency).

## `endDate` (type: `string`):

For history, frequency and range checks: last day, YYYY-MM-DD. Default: the game's latest drawing.

## `numbers` (type: `string`):

For mode check: your main numbers separated by spaces or commas, for example 10 22 33 49 57. Digit games (Numbers, Win 4): the digits in order, for example 0863.

## `bonus` (type: `integer`):

For mode check: your Powerball, Mega Ball, Millionaire Ball or Cash Ball number. Leave empty for games without a bonus ball.

## `multiplier` (type: `integer`):

For Mega Millions checks since 2025-04-08: the multiplier printed on your ticket (2, 3, 4, 5 or 10), so non-jackpot prizes are returned in USD. Without it you get the base prize and the min-max range.

## `draws` (type: `integer`):

For mode frequency: count the last N drawings instead of a date range, for example 100.

## `drawTime` (type: `string`):

Take 5, Numbers and Win 4 draw twice a day. Empty = both drawings.

## `limit` (type: `integer`):

Maximum rows returned, newest first. Between 1 and 5000.

## `onlyNew` (type: `boolean`):

Return only drawings newer than the last run with this Monitor ID. Schedule it after each draw day to get every new result once.

## `monitorId` (type: `string`):

Name of the watch for only-new mode, for example my-app. Each Monitor ID keeps its own last drawing per game.

## Actor input object example

```json
{
  "game": "powerball",
  "mode": "history",
  "limit": 30,
  "onlyNew": false,
  "monitorId": "default"
}
```

# Actor output Schema

## `results` (type: `string`):

One row per drawing: game, draw date and time, winning numbers, bonus ball, multiplier, source link. Check mode adds matched numbers, tier and prize; frequency mode returns one row per number.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "game": "powerball",
    "mode": "history",
    "limit": 30
};

// Run the Actor and wait for it to finish
const run = await client.actor("martin10291/lottery-results-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "game": "powerball",
    "mode": "history",
    "limit": 30,
}

# Run the Actor and wait for it to finish
run = client.actor("martin10291/lottery-results-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "game": "powerball",
  "mode": "history",
  "limit": 30
}' |
apify call martin10291/lottery-results-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,martin10291/lottery-results-api"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/d6pTbuLrh2hF3XVlc/builds/g8kUr5XpzEm6UobGQ/openapi.json
