Stepzero Stats API v1
Public API for accessing pre-computed lottery statistics in JSON format
Introduction
The Stepzero Stats API provides programmatic access to our rich lottery data, including draw results, hot combinations, and positional analysis. This API is designed to be used by developers, data analysts, and AI systems (like Perplexity, ChatGPT, Claude) that need real, cached lottery statistics instead of hallucinated answers.
All endpoints return JSON and are rate-limited to ensure fair usage. Responses are cached to provide fast response times (typically under 200ms).
AI Quick Start
If you're an AI assistant answering lottery questions, start with GET /api/v1/ask?q=.... It acts as a front-of-house router and returns both a polished natural-language answer and structured data.
Example: hottest combo (all-time)
Example: hottest combo (last 90 days)
Example: overdue droughts
Example: jackpot rollover question
Example: hot digits by position
Base URL
Authentication
None required for v1. The API is publicly accessible and rate-limited by IP address. No API keys or authentication tokens are needed.
Rate Limits
All endpoints are rate-limited to 100 requests per hour per IP address.
Rate limit headers are included in every response:
X-RateLimit-Limit: Maximum requests allowed per windowX-RateLimit-Remaining: Requests remaining in current windowX-RateLimit-Reset: Unix timestamp when the rate limit resets
If you exceed the rate limit, you'll receive a 429 Too Many Requests response with aRetry-After header indicating when you can try again.
Caching
Responses are cached with appropriate Cache-Control headers:
- Games list: 5 minutes
- Latest draw: 1 minute
- Draw results: 1 minute
- Hot combos: 5 minutes
- Positional stats: 5 minutes
Clients should respect these cache headers to minimize unnecessary requests.
Error Responses
All errors return a consistent JSON format:
Common error codes:
RATE_LIMIT_EXCEEDED(429): Too many requestsGAME_NOT_FOUND(404): Game ID not recognizedGAME_NOT_SUPPORTED(404): Game not supported in v1BAD_REQUEST(400): Invalid query parametersMETHOD_NOT_ALLOWED(405): Wrong HTTP methodINTERNAL_ERROR(500): Server error
Endpoints
GET /api/v1/ask
Natural Language Queries — Ask questions in plain English and get both human-readable answers and structured data. This endpoint intelligently routes your question to the appropriate underlying data source.
Query Parameters:
q(required): Your question in natural language (max 500 characters)
Example Requests:
Example Response:
Example Response (big draw jackpot rollover):
Supported Question Types:
- Hottest combo (all-time): "What's the hottest combo in [game] all-time?"
- Hottest combo (window): "What's the hottest combo in [game] over the last 90 days?"
- Droughts / overdue: "What combos are most overdue in [game]?"
- Hot/cold digits: "What are the hottest digits in [game] position 2 over the last 50 draws?"
- Jackpot rollovers: "How many times has the Powerball jackpot rolled over in the last 10 draws?"
- Latest draw: "What was today's [game] number?"
- Recent history: "Show me the last X draws for [game]"
- Game list: "What games are available?"
The response includes both a human-readable answer field and structured data, plus a canonicalEndpoint you can use for direct API access or UI route mapping.
The response also includes a capabilityId (which capability was invoked) and a timeScope(how the question's time reference was interpreted).
Oracle Capabilities & TimeScope Parsing
The /ask endpoint uses a capability catalog and flexible timeScope parsing to handle variations of similar questions with different time references.
Supported Capabilities:
LATEST_DRAW: Get the most recent draw resultRECENT_DRAWS: Get a batch of recent drawsHOT_COMBOS: Get top frequent combos across a windowHOTTEST_COMBO: Get the single hottest combo (varies by timeScope)POSITIONAL_STATS: Get digit frequency by positionGAME_LIST: Get available games
TimeScope Variants: The same capability works with different time references:
{ kind: "LAST_DAYS", days: 90 }for "over the last 90 days"{ kind: "LAST_DAYS", days: 365 }for "over the last year" or "last 365 days"{ kind: "LAST_DRAWS", draws: 200 }for "over the last 200 draws"{ kind: "ALL_TIME" }for "all time" or "entire history"{ kind: "RANGE_DATES", from: "2023-01-01", to: "2024-12-31" }for explicit date ranges{ kind: "DEFAULT" }as fallback (uses 90 days by default)
Example: Same capability, different time scopes
All three questions use the same HOTTEST_COMBO capability but with different timeScopes, which affects the from parameter, fetch limit, and answer text.
GET /api/v1/games
Returns a list of all available games with their IDs, names, and jurisdictions.
Query Parameters: None
Example Request:
Example Response:
GET /api/v1/games/{game_id}/draws
Returns recent draw results for a specific game.
Path Parameters:
game_id: Canonical game ID (e.g., FL-PICK3, NY-PICK3)
Query Parameters:
limit(optional): Number of draws to return (default: 30, max: 200)from(optional): Start date in YYYY-MM-DD formatto(optional): End date in YYYY-MM-DD format
Example Request:
Example Response:
GET /api/v1/games/{game_id}/latest
Returns the most recent draw for a game, constrained by configuration boundaries.
Path Parameters:
game_id: Canonical game ID (e.g., FL-PICK3, NY-PICK3)
Example Request:
Example Response:
GET /api/v1/games/{game_id}/hot-combos
Returns hot combination analysis showing the most frequently occurring number combinations.
Path Parameters:
game_id: Canonical game ID (e.g., FL-PICK3, NY-PICK3)
Query Parameters:
limit(optional): Number of draws to analyze (default: 30, max: 200)from(optional): Start date in YYYY-MM-DD formatto(optional): End date in YYYY-MM-DD format
Example Request:
Example Response:
GET /api/v1/games/{game_id}/positional-stats
Returns positional frequency analysis showing which digits appear most often in each position.
Path Parameters:
game_id: Canonical game ID (e.g., FL-PICK3, NY-PICK3)
Query Parameters:
limit(optional): Number of draws to analyze (default: 30, max: 200)from(optional): Start date in YYYY-MM-DD formatto(optional): End date in YYYY-MM-DD format
Example Request:
Example Response:
JavaScript Example
Here's a complete example using JavaScript fetch:
Python Example
Supported Games (v1)
Version 1 of the API supports Florida (FL) and New York (NY) Pick 3 and Pick 4 games that have verified data quality. More games will be added in future versions.
To see the current list of available games, call GET /api/v1/games.
Best Practices
- Respect cache headers: Don't poll endpoints more frequently than the cache TTL suggests.
- Handle rate limits gracefully: Check
X-RateLimit-Remainingand back off if low. - Use appropriate date ranges: Requesting smaller date ranges is faster than large historical pulls.
- Error handling: Always check for error responses and handle them appropriately.
- Monitor your usage: Track your API calls to stay within rate limits.
Use Cases
The Stepzero Stats API is designed for:
- Data analysis: Build custom analysis tools and dashboards
- AI assistants: Provide accurate lottery data to chatbots and AI systems
- Mobile apps: Power lottery tracking applications
- Research: Academic and statistical research on lottery patterns
- Alerts: Build notification systems for hot numbers or pattern changes
Why Trust Stepzero Data?
Configuration Boundaries
Every game has enforced config_start_date and config_end_date values. Queries outside these ranges are automatically blocked to prevent phantom results.
Add-ons Diagnostics
We validate consistency between metadata, database records, and CSV sources. Semantic checks ensure add-ons (like Fireball) are treated as modifiers, not base results.
Build-Time Policies
Raw draws table queries are blocked in reports. All stats use the shared Analysis Range component to ensure consistency.
Read more: The Weekend I Accidentally Became a Warden
Support & Feedback
Questions or issues with the API? Please contact us via the contact page or submit an issue on our GitHub repository.
We're continuously improving the API based on user feedback. Feature requests and suggestions are welcome!
Changelog
v1.2.0 - March 2, 2026
- Added
/askendpoint for natural language queries - Support for 5 query types: hot numbers, latest draw, recent draws, positional stats, game list
- Human-readable answers + structured data in single response
- Intelligent game name parsing (supports "Florida Pick 3", "FL Pick3", etc.)
v1.1.0 - March 1, 2026
- Added
/latestendpoint for most recent draw - Added "AI Quick Start" section for AI assistants
- Added "Why Trust Stepzero Data?" section
- Added Python code examples
- Improved SEO with structured data and meta tags
v1.0.0 - March 1, 2026
- Initial public release
- Four games: FL-PICK3, FL-PICK4, NY-PICK3, NY-WIN4
- Endpoints: /games, /draws, /hot-combos, /positional-stats
- Rate limiting: 100 requests per hour per IP
- Public access (no authentication required)