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
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.
- Navigate to the Free Account Registration Page.
- Enter your developer email address and password.
- Copy your unique API Key from your developer dashboard (e.g.,
usl_live_998877665544332211).
US_LOTTERY_API_KEY).Make Your First REST Request (cURL)
Pass your API key in the Authorization: Bearer YOUR_API_KEY header when executing GET requests.
curl -X GET "https://uslotteryapi.com/v1/results/powerball?latest=true" \
-H "Authorization: Bearer usl_live_998877665544332211" \
-H "Accept: application/json"
Understand the JSON Response Schema
All API endpoints return a standardized, predictable JSON wrapper containing status, timestamp, and data payload:
{
"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"
}
}SDK Examples (JavaScript & Python)
Below are ready-to-run code snippets for integrating US Lottery API directly into your backend services.
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();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()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 Key | Example Value | Description |
|---|---|---|
| X-RateLimit-Limit | 60 | Maximum allowed requests per minute on your plan. |
| X-RateLimit-Remaining | 58 | Remaining requests in the current window. |
| X-RateLimit-Reset | 1722645600 | Unix 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.