# NY Scratch-Off Prize Status & Changes (`zinin/ny-scratch-off-prize-status`) Actor

Collect official New York scratch-off paid, unpaid and total prize counts. Compare complete snapshots to track observed changes, with source revision and game-level filtering.

- **URL**: https://apify.com/zinin/ny-scratch-off-prize-status.md
- **Developed by:** [Tim Zinin](https://apify.com/zinin) (community)
- **Categories:** Games, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.85 / 1,000 prize status delivereds

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## NY Scratch-Off Prize Status & Changes

Get official New York scratch-off prize counts for industry research, data feeds and prize-status content. Each result preserves the game number, game name, original prize label and the provider's paid, unpaid and total counts. Supply an earlier complete snapshot to see which prize records changed between observations.

The source is the [New York State Gaming Commission daily prize-status dataset](https://data.ny.gov/Government-Finance/Scratch-Off-Game-Daily-Prize-Status-Report/nzqa-7unk). This independent tool is not affiliated with the Commission or NY Lottery. It does not place bets, validate tickets, predict results or recommend purchases.

### Quick start

```json
{"gameNumbers":["1606"]}
```

Use the NY game number, not the game name. The example selects game 1606; if that game disappears from the current feed, the result may be empty. Use `{"gameNumbers":[]}` or `{}` for all current games. You can select up to 50 unique numbers as strings. No API key, proxy or source URL is required.

The source is a current observation. It does not supply historical daily snapshots through this Actor. Save your own complete snapshots to build a history.

### Results

Dataset rows with `recordType: "scratch_prize_status"` contain:

| Field | Meaning |
|---|---|
| `gameNumber`, `gameName` | Original NY game identifier and title |
| `prizeLabel` | Original prize-level label, including annuities |
| `prizeAmountCents` | Plain cash amount in USD cents; null for annuity or other non-cash labels |
| `paid`, `unpaid`, `total` | Reported counts; paid + unpaid must equal total |
| `id` | Stable digest of game number and literal prize label |
| `source` | Official URL, dataset ID, publisher, provider revision and observation time |
| `billing` | Whether a result event was requested for this row |

Rows are sorted by numeric game number and literal prize label. Do not infer prize value ordering from that order. Diagnostic rows have a different `recordType`, a `code` and no requested result event.

The `OUTPUT` record describes the outcome, coverage, delivered rows and confirmed result events. `SNAPSHOT` contains the complete normalized observation, game filter, timestamps, source URLs, revision and digest. It is saved only after complete current delivery.

### Compare two observations

1. Run the Actor and download the complete `SNAPSHOT` JSON.
2. On a later run, use the same `gameNumbers` and set `previousSnapshot` to a JSON **string** containing that snapshot. With an API client, use `JSON.stringify(snapshot)`.
3. Download `COMPARISON`. It records `newly_observed`, `changed` and `no_longer_observed` rows, before/after values, and paid/unpaid/total deltas. `unchanged` counts identical rows.

Changing a literal prize label creates a different identity. Game renames are reported as field changes. An empty current observation may make all previous rows no longer observed; this does not establish closure. Comparisons report provider revision order and flag changed facts under an unchanged revision.

Both snapshots must have the same filter, valid counts and a verified structure. Observation windows must not overlap. Previous JSON is limited to 4 MiB in UTF-8; comparisons to 9 MiB. A digest detects consistency errors, but does not authenticate a buyer-supplied snapshot.

### Pricing and run limits

The initial FREE-tier price is $0.001 per delivered prize-status row, plus $0.005 per Actor start; the current Pricing tab is authoritative and account-tier discounts may apply. A game usually has multiple prize levels. A run with 10 delivered levels therefore requests 10 result events, not one game event. Current rows are charged on every run, including when their values are unchanged. The comparison adds no separate event.

Set **Max total charge** in run options to bound paid delivery. A verified unset limit permits delivery up to this Actor's source and size bounds. An explicit zero prevents prize delivery. The platform start charge may still apply even if the run returns no prize rows or fails. Diagnostic rows request no result event.

If the remaining budget cannot cover another prize row, the Actor stops with `budget_stopped`. Already delivered rows remain, but the full snapshot and comparison are withheld. A confirmed event counter is the settlement evidence; the billing field on a Dataset row records intent at write time and is not a receipt.

A storage or charging acknowledgement can fail after a write was applied. The Actor stops without retrying that row. A failed run may contain rows and charges but no `OUTPUT`, or may contain earlier exports before a later error. Inspect the Dataset, status message and settled run counters. Automatic resurrection/replay of the same run is deliberately unsupported to avoid duplicate delivery.

### Source checks and limitations

The Actor verifies required source columns, reconciles rows against a count query with the same filter and checks that the provider revision did not change during collection. It rejects duplicate identities, inconsistent counts, more than 10,000 rows, or an oversized response. Each request has a 20-second timeout and a 5 MiB decoded-response limit. Provider errors or a changing feed produce no paid prize observation from that collection; retry as a new run after investigating the diagnostic.

Unpaid prizes are not available ticket inventory. Counts and count changes cannot establish current winning odds, ticket sales, expected returns or proof that a particular prize was claimed. Provider corrections may increase unpaid counts, decrease paid counts or alter totals. The source revision is not a transactional snapshot guarantee, and absence of a game or prize does not prove it closed. This version covers New York only.

# Actor input Schema

## `gameNumbers` (type: `array`):

Up to 50 unique NY numeric game identifiers as strings. Empty means all games in the current feed. Results are sorted by game number and literal prize label.

## `previousSnapshot` (type: `string`):

Paste the complete SNAPSHOT JSON from an earlier successful run using the same game filter. Maximum 4 MiB in UTF-8. Leave blank to collect without comparison. Use JSON.stringify(snapshot) when calling the API.

## Actor input object example

```json
{
  "gameNumbers": [
    "1606"
  ]
}
```

# Actor output Schema

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

Filter recordType=scratch\_prize\_status for prize data. Dataset rows carry per-row provenance and billing intent; settled run counters confirm charges.

## `summary` (type: `string`):

When present, check deliveryComplete, sourceComplete and confirmedResultEvents. Late failures can leave rows charged and OUTPUT absent; inspect the run and Dataset.

## `snapshot` (type: `string`):

Saved after all current prize rows are delivered and confirmed. Withheld for partial budgets or uncertain delivery. Paste its complete JSON into previousSnapshot next time.

## `comparison` (type: `string`):

Saved only when a valid prior snapshot was supplied and current delivery completed. Counts can change because of provider corrections. Missing rows do not prove game closure.

# 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 = {
    "gameNumbers": [
        "1606"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("zinin/ny-scratch-off-prize-status").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 = { "gameNumbers": ["1606"] }

# Run the Actor and wait for it to finish
run = client.actor("zinin/ny-scratch-off-prize-status").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 '{
  "gameNumbers": [
    "1606"
  ]
}' |
apify call zinin/ny-scratch-off-prize-status --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,zinin/ny-scratch-off-prize-status"
        }
    }
}
```

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/murllYxixyf2QXoLo/builds/NVTYl7VufG7eQVxaU/openapi.json
