API Documentation

Free, read-only lottery data API. No authentication required.

Base URL

https://www.drawanalytics.com/api/v1
Rate Limit: 60 requests per minute per IP address. Standard rate limit headers (RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset) are included in every response.

Response Format

All endpoints return a consistent JSON wrapper:

{
  "success": true,
  "data": [ ... ],
  "meta": {
    "timestamp": "2026-04-12T12:00:00.000Z",
    "api_version": "1.0",
    "count": 45
  }
}

Error responses use the same shape:

{
  "success": false,
  "error": "State not found"
}

Endpoints

GET /api/v1/states

List all supported states with their available games and timezone.

// Response data item
{
  "id": "california",
  "name": "California",
  "abbreviation": "CA",
  "slug": "california",
  "games": ["daily3", "daily4", "fantasy5", "powerball", "mega_millions", "superlotto_plus"],
  "timezone": "America/Los_Angeles"
}
GET /api/v1/:state/games

List games for a specific state with configuration details.

ParamTypeDescription
:statepathState slug, ID, or abbreviation (e.g. california, CA)
// Response data item
{
  "id": "powerball",
  "name": "Powerball",
  "type": "pick5plus1",
  "mainBalls": 5,
  "mainRange": [1, 69],
  "bonusBalls": 1,
  "bonusRange": [1, 26],
  "bonusName": "Powerball",
  "drawDays": [1, 3, 6],
  "drawTimes": null
}
GET /api/v1/:state/:game/latest

Get the most recent draw result for a game.

ParamTypeDescription
:statepathState slug or abbreviation
:gamepathGame ID (e.g. powerball, daily3)
// Lotto-style response
{
  "draw_date": "2026-04-11",
  "draw_number": 1234,
  "numbers": [5, 12, 28, 43, 61],
  "bonus_ball": 17,
  "jackpot": 250000000,
  "multiplier": 3,
  "sum": 149
}

// Digit-game response
{
  "draw_date": "2026-04-11",
  "draw_time": "evening",
  "draw_number": 5678,
  "numbers": [3, 7, 1],
  "combo": "137",
  "sum": 11
}
GET /api/v1/:state/:game/results

Get historical draw results with date range filtering and pagination.

ParamTypeDescription
:statepathState slug or abbreviation
:gamepathGame ID
start_datequeryStart date, YYYY-MM-DD (default: 30 days ago)
end_datequeryEnd date, YYYY-MM-DD (default: today)
limitqueryResults per page, 1-100 (default: 50)
offsetqueryPagination offset (default: 0)

Meta includes total, limit, and offset for pagination.

GET /api/v1/:state/:game/frequency

Number frequency counts over a configurable time window.

ParamTypeDescription
:statepathState slug or abbreviation
:gamepathGame ID
daysqueryLookback window in days, 1-365 (default: 30)
// Lotto-style: sorted by count descending
[{ "ball": 7, "count": 12, "pct": 40.0 }, ...]

// Digit-game: one entry per digit 0-9
[{ "digit": 0, "count": 45, "pct": 15.0 }, ...]
GET /api/v1/:state/:game/hot-cold

Top hot and cold numbers based on frequency over a time window.

ParamTypeDescription
:statepathState slug or abbreviation
:gamepathGame ID
daysqueryLookback window in days, 1-365 (default: 30)
countqueryNumber of hot/cold entries, 1-20 (default: 5)
{
  "hot": [{ "number": 7, "count": 12 }, ...],
  "cold": [{ "number": 42, "count": 1 }, ...]
}
GET /api/v1/:state/:game/gaps

Current gap (draws since last appearance) for each number. Higher gap = more overdue.

ParamTypeDescription
:statepathState slug or abbreviation
:gamepathGame ID
// Sorted by gap descending (most overdue first, lotto-style)
[{ "number": 55, "gap": 42 }, { "number": 12, "gap": 38 }, ...]

Code Examples

# List all states
curl https://www.drawanalytics.com/api/v1/states

# Get California Powerball latest draw
curl https://www.drawanalytics.com/api/v1/california/powerball/latest

# Get last 30 days of results with pagination
curl "https://www.drawanalytics.com/api/v1/california/powerball/results?limit=20&offset=0"

# Frequency analysis (last 60 days)
curl "https://www.drawanalytics.com/api/v1/california/powerball/frequency?days=60"

# Hot and cold numbers
curl "https://www.drawanalytics.com/api/v1/california/powerball/hot-cold?days=30&count=5"

# Check rate limit headers
curl -I https://www.drawanalytics.com/api/v1/states
const BASE = 'https://www.drawanalytics.com/api/v1';

// Fetch latest Powerball draw
const res = await fetch(`${BASE}/california/powerball/latest`);
const { success, data, meta } = await res.json();

if (success) {
  console.log('Draw date:', data.draw_date);
  console.log('Numbers:', data.numbers.join(', '));
  console.log('Bonus:', data.bonus_ball);
}

// Paginate through results
async function getAllResults(state, game, startDate) {
  let offset = 0;
  const all = [];
  while (true) {
    const url = `${BASE}/${state}/${game}/results?start_date=${startDate}&limit=100&offset=${offset}`;
    const r = await fetch(url);
    const json = await r.json();
    all.push(...json.data);
    if (all.length >= json.meta.total) break;
    offset += 100;
  }
  return all;
}
import requests

BASE = "https://www.drawanalytics.com/api/v1"

# Fetch latest Powerball draw
r = requests.get(f"{BASE}/california/powerball/latest")
data = r.json()

if data["success"]:
    draw = data["data"]
    print(f"Draw: {draw['draw_date']}")
    print(f"Numbers: {draw['numbers']}")
    print(f"Bonus: {draw['bonus_ball']}")

# Get hot/cold numbers for last 60 days
r = requests.get(f"{BASE}/california/powerball/hot-cold", params={"days": 60, "count": 10})
hc = r.json()["data"]
print("Hot:", [n["number"] for n in hc["hot"]])
print("Cold:", [n["number"] for n in hc["cold"]])

Notes

  • All dates are in YYYY-MM-DD format (UTC).
  • State can be referenced by slug (california), ID, or abbreviation (CA).
  • Game IDs match the internal registry (e.g. powerball, mega_millions, daily3). Use the /states or /:state/games endpoint to discover valid IDs.
  • The API is read-only. No authentication or API keys are required.
  • Data is updated automatically after each lottery draw (typically within a few hours).
  • CORS is fully open (Access-Control-Allow-Origin: *).
  • The frequency endpoint returns percentage relative to total draws (lotto) or total digit slots (digit games).
  • The gaps endpoint scans the most recent 200 draws.