Option 1: Iframe Embed
The simplest way to add lottery results to your site is to embed the server-rendered results page in an iframe. Each state has a results page at /{state}/results (e.g., /california/results) that renders as lightweight HTML with the latest drawing numbers, hot/cold indicators, and next draw dates. Because these pages are server-rendered, they load quickly and do not require JavaScript on the embedding page.
Set the iframe to a reasonable size (e.g., 100% width, 600-800px height) and allow it to scroll if content overflows. The results page is styled with a dark background, so it blends well with dark-themed sites. For light-themed sites, you may want to use the API approach instead to match your own styling.
Option 2: API Integration
For full control over presentation, fetch data from the DrawAnalytics API and render it yourself. A GET request to /api/{state}/drawings?game={gameId}&limit=1 returns the most recent drawing as a JSON object. You can then display the numbers, date, and jackpot using your own components and styling.
This approach works well for single-page apps, WordPress plugins, or any environment where you need the data separate from the presentation. Refresh the data on a timer (every 5-15 minutes after known draw times) to keep results current without excessive API calls.
Attribution
If you embed or integrate DrawAnalytics data, a link back to drawanalytics.com is appreciated but not required. The API is free for non-commercial and commercial use. For high-volume or specialized needs, see the API documentation for rate limits and best practices.
DrawAnalytics is an informational service. We do not sell predictions or guarantee outcomes. Lottery drawings are random — past results do not predict future drawings. Play responsibly. 1-800-GAMBLER.