Getting Started Guide
Get up and running with the US Lottery API in under 5 minutes. Learn how to acquire an API key, format HTTP headers, and execute your first REST request.
3-Step Integration Workflow
01
Obtain Your API Key
Register for a free account on the portal to instantly generate your unique x-api-key credential.
02
Configure Request Headers
Attach the x-api-key header to all HTTPS requests targeting uslotteryapi.com.
03
Fetch Live Data
Query our endpoints for real-time Powerball, Mega Millions, state lottery numbers, and jackpot estimates.
HTTP Request Headers Specification
The following HTTP headers should be included with every API request:
| Header Name | Requirement | Example Value | Description |
|---|---|---|---|
| x-api-key | Required | uslot_live_9a8b7c6d5e4f... | Your confidential API authentication token. |
| Accept | Recommended | application/json | Specifies that the client expects a JSON payload response. |
| User-Agent | Optional | MyAppName/1.0.0 | Identifies your application name and version for logging. |
Complete Code Snippets
First API Call Code Examples
# Step 1: Execute request using cURL with x-api-key header
curl -X GET "https://uslotteryapi.com/api/v1/draws/latest?game=powerball" \
-H "x-api-key: your_api_key_here" \
-H "Accept: application/json"Ready to explore endpoints?
Check out our endpoint reference for detailed query parameters and response formats.