Automate booking your Covid vaccine with Python

Daniele Gentili
2 min readJun 5, 2021
Photo by Sigmund (detail)

I am in the late twenties age bracket and spent last week compulsively checking on the NHS website to book my first vaccination as soon as it would be open for my age group.

During my lunch break on Thursday I had enough and decided to automate it, so that my iPhone would get a notification when I could book my first dose.

What you will need:

  • iPhone / iPad / iPod
  • Pythonista3 (link) from the AppStore, an awesome and versatile Python environment
  • A few lines of code

What do we want to automate?

  1. Checking the NHS page to see who can get vaccinated
  2. Sending a notification when the age group of choice can book

For the first point, googling “who can get vaccinated UK?” shows us the NHS page: https://www.nhs.uk/conditions/coronavirus-covid-19/coronavirus-vaccination/who-can-get-the-vaccine/.

Having a quick look at this page shows:

https://www.nhs.uk/conditions/coronavirus-covid-19/coronavirus-vaccination/who-can-get-the-vaccine/

So let’s write some code to read the big writing in bold:

Ok so now we know the age, but what about sending the notification? Conveniently with Pythonista3 there is a notification library, it works like so:

This will create a notification that will look like this and that will take us to the vaccine booking page:

All that is left to do is to create a function that can be called to check the NHS website every now and then and send the notification, plus some error handling (returning another notification maybe).

Let’s put it all together:

And that’s it! Now all we need is a bit of patience and we’ll hear that ping!

--

--

Daniele Gentili

Science’s neutrality must be questioned when it affects people. The Qs we seek to answer show our interests. Knowledge isn’t accumulated but surfaced/submerged