# Lottery Number Checker (`lottery.check`)

Compare your numbers with a Powerball, Mega Millions or New York lottery draw: which numbers matched, whether the special ball matched, and the match pattern.

Docs: https://primaryapi.com/docs/api-reference/lottery/check

- Endpoint: `POST https://api.primaryapi.com/v1/run/lottery.check`
- Category: Knowledge & Data · Platform: `lottery` · Kind: lookup · Status: live
- Price: 1 credit per call. Every call costs the same, including calls that were retried automatically.
- Billing unit: per successful call
- Reliability: routed to a healthy upstream and retried automatically when an attempt fails; live 30-day status: `GET https://api.primaryapi.com/v1/status/apis?sku=lottery.check`
- Execution: synchronous (answers 202 only if it outlives the wait window)

## Input

| Field | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
| `game` | enum | yes |  | one of: powerball, mega-millions, millionaire-for-life, ny-lotto, take5-evening, take5-midday, cash4life | Lottery game to check. One of: powerball, mega-millions, millionaire-for-life, ny-lotto, take5-evening, take5-midday, cash4life (see lottery.games). |
| `numbers` | integer[] | yes |  | min 1 items; max 10 items; items 0–99 | Your main numbers (5 for Powerball and Mega Millions, 6 for NY Lotto), without the special ball. |
| `specialBall` | integer | no |  | 0–99 | Your Powerball, Mega Ball, Cash Ball or Millionaire Ball. Omit for games without one. |
| `drawDate` | string | no |  | pattern: ^\d{4}-\d{2}-\d{2}$ | Draw to check against (YYYY-MM-DD). Omit for the latest draw. |

Unknown fields are rejected with `400 invalid_input`. The routing controls `preferLatencyUnderMs` and `maxCredits` may be sent in the same JSON body.

## Output

When `output.found` is `true`, `output.data` has this shape:

| Field | Type | Description |
|---|---|---|
| `game` | string |  |
| `gameName` | string |  |
| `draw` | object |  |
| `draw.game` | string | Game key, e.g. "powerball". |
| `draw.drawDate` | string | Draw date (YYYY-MM-DD), the calendar date of the draw in New York. |
| `draw.drawTime` | enum \| null | Which daily draw, for games drawn twice a day. |
| `draw.numbers` | integer[] | Main winning numbers in the published order (digit games: each digit in order). |
| `draw.specialBall` | integer \| null | Powerball, Mega Ball, Bonus, Cash Ball or Millionaire Ball; null when the game has none. |
| `draw.specialBallName` | string \| null | Name of the special ball, e.g. "Powerball". |
| `draw.multiplier` | integer \| null | Power Play or Megaplier drawn with the numbers; null when none was drawn. |
| `draw.multiplierName` | string \| null |  |
| `draw.doublePlay` | object \| null | Powerball Double Play draw, when one was held. |
| `draw.doublePlay.numbers` | integer[] |  |
| `draw.doublePlay.specialBall` | integer \| null |  |
| `yourNumbers` | integer[] | Your numbers, ascending. |
| `yourSpecialBall` | integer \| null |  |
| `matchedNumbers` | integer[] | Your numbers that were drawn, ascending. |
| `matchCount` | integer |  |
| `specialBallMatched` | boolean \| null | null when the game has no special ball or you did not give one. |
| `matchLabel` | string | e.g. "4 + Powerball", "3", "Powerball only" or "no match". |
| `doublePlay` | object \| null | The same check against the Powerball Double Play draw, when held. |
| `doublePlay.matchedNumbers` | integer[] | Your numbers that were drawn, ascending. |
| `doublePlay.matchCount` | integer |  |
| `doublePlay.specialBallMatched` | boolean \| null | null when the game has no special ball or you did not give one. |
| `doublePlay.matchLabel` | string | e.g. "4 + Powerball", "3", "Powerball only" or "no match". |

When the thing you asked about does not exist (or a search matches nothing) the call still succeeds: `output.found` is `false`, `output.data` is `null` and `output.reason` says why (`not_found`, `private`, `no_results`, …). Misses are free unless the notes below say misses are billed.

## Example request

```bash
curl -sS -X POST "https://api.primaryapi.com/v1/run/lottery.check" \
  -H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"game":"powerball","numbers":[9,12,44,51,60],"specialBall":4}'
```

## Example response

_Values are placeholders that follow the output schema; `credits` is what this call would cost at the usual price._

```json
{
  "output": {
    "found": true,
    "data": {
      "game": "powerball",
      "gameName": "Powerball",
      "draw": {
        "game": "powerball",
        "drawDate": "2026-11-14",
        "drawTime": "evening",
        "numbers": [
          9,
          44,
          49,
          51,
          68
        ],
        "specialBall": 4,
        "specialBallName": "Powerball",
        "multiplier": 2,
        "multiplierName": "Power Play",
        "doublePlay": {
          "numbers": [
            15,
            25,
            30,
            32,
            67
          ],
          "specialBall": 1
        }
      },
      "yourNumbers": [
        9,
        12,
        44,
        51,
        60
      ],
      "yourSpecialBall": 4,
      "matchedNumbers": [
        9,
        44,
        51
      ],
      "matchCount": 3,
      "specialBallMatched": true,
      "matchLabel": "3 + Powerball",
      "doublePlay": {
        "matchedNumbers": [],
        "matchCount": 0,
        "specialBallMatched": false,
        "matchLabel": "no match"
      }
    }
  },
  "provider": "PrimaryAPI",
  "credits": 1,
  "items": 1,
  "requestId": "req_01JBXK6Y2N9V8T4R3Q2P1M0A7Z"
}
```

## Pricing and reliability

- Usual price: 1 credit per call
- Price ceiling: the usual price, even when a call is retried. A quote’s `maxCredits` is the most a given call can cost; the `maxCredits` routing control caps it per call
- Live 30-day status, success rate, uptime and latency: `GET https://api.primaryapi.com/v1/status/apis?sku=lottery.check`

## Errors to handle

`invalid_input`, `unauthorized`, `insufficient_balance`, `key_limit_reached`, `trial_cap_reached`, `forbidden`, `not_found`, `idempotency_conflict`, `rate_limited`, `all_sources_failed`, `service_unavailable`, `timeout`. See https://primaryapi.com/docs/errors.

## Notes

A pure comparison: it reports which of your numbers were drawn and the match pattern (for example "4 + Powerball"). It does not say what a ticket won: prize amounts depend on the game rules, multipliers and state, so check them with the official lottery. A date with no draw returns found=false.

## Legal

Results come from official state lottery open data; in a discrepancy, the lottery’s certified drawing results prevail. Always confirm numbers with the official lottery before acting on them. Informational only: no prize amounts, odds advice or ticket sales. Powerball and Mega Millions are trademarks of their owners.

