Lottery results look like the easiest data in the world: five or six numbers, twice a week. Then you try to use them in an app and the trouble starts. Every operator publishes them differently. Some have a PDF, some have a page that changes layout every year, some publish late, and a few correct a draw after the fact. Scraping one lottery is a weekend. Keeping fifty of them right is a job.
In this tutorial we'll skip the scraping and read results from a REST API instead. With requests and a free key we'll:
list the latest EuroMillions draws,
check a set of numbers against past draws, and see what they would have won,
find out when the next draw is.
Each step shows its output, and the whole script is at the end, ready to copy and run.
1. Get a key
I'm using Lottevo , a lottery results API I built. Create an account, open API keys and create a sandbox key . It's free and needs no card.β¦