US Lottery API Logo
US Lottery API
LoginGet Free API Key
cURL / REST API5 Min Read · Beginner LevelUpdated August 2026

Getting Started with US Lottery API in 5 Minutes

The US Lottery API provides a unified, high-speed RESTful interface for querying official draw results, winning numbers, Power Play multipliers, and estimated jackpot values for Powerball, Mega Millions, and 30+ state lottery games. Follow this guide to get your free key and execute your first request in under 5 minutes.

SYSTEM ARCHITECTURE & REQUEST FLOW

💻Your ApplicationPython / Node / cURL
Bearer Header →US Lottery GatewayRate Limit & Auth Guard
Official JSON Feed< 100ms Latency
1

Obtain Your Free API Key

To query US Lottery API endpoints, you need a secret Bearer API key. Registration takes less than 30 seconds and requires no credit card.

  1. Navigate to the Free Account Registration Page.
  2. Enter your developer email address and password.
  3. Copy your unique API Key from your developer dashboard (e.g., usl_live_998877665544332211).
💡 Security Note: Keep your API key private. Never expose live keys in client-side browser JavaScript code or public GitHub repositories. Use server-side environment variables (US_LOTTERY_API_KEY).
2

Make Your First REST Request (cURL)

Pass your API key in the Authorization: Bearer YOUR_API_KEY header when executing GET requests.

cURL Terminal Commandbash
curl -X GET "https://uslotteryapi.com/v1/results/powerball?latest=true" \
  -H "Authorization: Bearer usl_live_998877665544332211" \
  -H "Accept: application/json"
3

Understand the JSON Response Schema

All API endpoints return a standardized, predictable JSON wrapper containing status, timestamp, and data payload:

HTTP 200 OK Responsejson
{
  "status": "success",
  "timestamp": "2026-08-03T01:15:00Z",
  "data": {
    "game_id": "powerball",
    "game_name": "Powerball",
    "draw_date": "2026-08-01",
    "winning_numbers": [12, 34, 45, 56, 67],
    "powerball": 10,
    "multiplier": "2x",
    "estimated_jackpot": "$1,200,000,000",
    "cash_option": "$580,400,000",
    "has_jackpot_winner": false,
    "next_draw_date": "2026-08-03",
    "next_jackpot_estimate": "$1,350,000,000"
  }
}
4

SDK Examples (JavaScript & Python)

Below are ready-to-run code snippets for integrating US Lottery API directly into your backend services.

Node.js (Fetch API)JavaScript
async function getLatestPowerball() {
  const apiKey = process.env.US_LOTTERY_API_KEY;
  const response = await fetch("https://uslotteryapi.com/v1/results/powerball?latest=true", {
    headers: {
      "Authorization": `Bearer ${apiKey}`,
      "Accept": "application/json"
    }
  });

  if (!response.ok) {
    throw new Error(`API request failed with status: ${response.status}`);
  }

  const result = await response.json();
  console.log("Powerball Winning Numbers:", result.data.winning_numbers);
  console.log("Powerball Bonus Ball:", result.data.powerball);
  console.log("Estimated Jackpot:", result.data.estimated_jackpot);
}

getLatestPowerball();
Python (requests)Python 3
import os
import requests

def fetch_mega_millions():
    api_key = os.environ.get("US_LOTTERY_API_KEY")
    headers = {"Authorization": f"Bearer {api_key}"}
    url = "https://uslotteryapi.com/v1/results/mega-millions?latest=true"
    
    response = requests.get(url, headers=headers)
    if response.status_code == 200:
        data = response.json()["data"]
        print(f"Draw Date: {data['draw_date']}")
        print(f"Numbers: {data['winning_numbers']} MegaBall: {data['mega_ball']}")
        print(f"Jackpot: {data['estimated_jackpot']}")
    else:
        print(f"Error {response.status_code}: {response.text}")

if __name__ == "__main__":
    fetch_mega_millions()
5

Rate Limits & HTTP Response Headers

Every API response includes HTTP response headers indicating your plan quota and remaining requests for the current billing minute:

Header KeyExample ValueDescription
X-RateLimit-Limit60Maximum allowed requests per minute on your plan.
X-RateLimit-Remaining58Remaining requests in the current window.
X-RateLimit-Reset1722645600Unix timestamp when the current rate limit window resets.

If your request rate exceeds your allowed quota, the API will return HTTP status 429 Too Many Requests. Upgrade to Developer or Business Plan to increase limit caps up to 300 req/min or unlimited.

Ready to Build Your Lottery Application?

Get 500 free monthly requests and full access to Powerball & Mega Millions endpoints.