ayoub chahid

At Regish

Regish finds a UK vehicle from part of a number plate, searching across 53.9 million vehicles. I designed and built it myself, and it's live at regish.co.uk.

Regish search results for the plate DA1 _ _ _ Z: 3,232 matching vehicles shown as cards with make, model, colour, fuel, year, engine and MOT status.

Where the idea came from

I was walking home from uni one evening when a car pulled out to overtake and crashed into another coming the other way. Instead of stopping, the driver carried on as if nothing had happened, and by the time I thought to look at the plate, all I could make out was the beginning: CF14.

The car that had been hit belonged to another student, so I stayed with them until things calmed down, told the police what I'd seen, and we swapped numbers before I headed home.

Once I got back, I wanted to do something useful with what I'd seen, so I opened the government's vehicle checker and started typing in plates by hand, one after another. After a while I did the maths. There were around 13,000 possible plates, and at the rate I was going it would have taken me the best part of two days without stopping. I try to help whenever I can, but in this case it was not viable. Still, lying in bed that night, I kept wondering whether a computer could do the boring part for me.

The next day the student messaged me to say the whole thing had been caught on CCTV, and the police already had the full plate. So that was the end of my detective career, before it had really started.

The question stayed with me, though. If there hadn't been a camera on that road, a half-remembered plate would have been all anyone had to go on. When I looked into it, I found forums full of people in exactly that position, going through possible plates one by one and hoping to get lucky. That's when the idea really took shape.

I'd love to say it has since helped solve a crime or two, but so far it hasn't saved the world. Where it does earn its keep is when I'm looking for a car to buy and the seller has blurred out the plate in the photos. A few visible characters, plus the make, model and colour, is usually enough to find the car and check its history before I waste a trip to see what turns out to be a banger.

characters I couldn't read
3
letters each one could be
24
to try them all by hand
38 h

First try: the DVLA's vehicle API

It turns out the DVLA has an API behind that same vehicle checker, so I got a key and wrote a Python script to try every possible plate for me. The catch was that it only answers one plate at a time.

The best I could get out of it was 600 plates a minute, about a hundred times faster than me on the website. But every extra missing character made things much worse. Four missing letters meant leaving it running for over nine hours, which isn't much use to anyone standing outside a car dealer.

How long a search takes
Missing lettersPossible platesBy hand (6 a minute)DVLA API (600 a minute)
1244 min2 s
25761.6 h1 min
313,82438 h23 min
4331,77638 days9 h

Looking for another way

So I went through every other way of getting hold of vehicle data I could find:

  • The DVLA's bulk data: paid, under contract, and only offered to motoring businesses, not to individuals.
  • Data resellers: also paid, and they're selling the same DVLA data anyway.
  • The DVSA's MOT API: one plate at a time again.
  • The DVSA's MOT bulk download: every vehicle that has had an MOT since 2005, with make, model, colour and fuel.

The last one was exactly what I needed. It was free, and with the whole database on my own machine, searching would be far quicker than asking an API over the internet.

From the MOT database to a first prototype

The bulk file was huge, at 53.4 GB, and it couldn't be used as it was.

Cleaning the data. The same thing had often been written in many different ways, so none of the filters would work until I'd cleaned it up. There were 31,871 different spellings of car makes alone: MERCEDES-BENZ, MERCEDES and MERCEDES BENZ, VOLKSWAGEN and VW, and my personal favourite, Volkswagon. Each one now maps to a single proper name, and models are grouped into families, so all the versions of a BMW 3 Series show up together.

Keeping what matters. There's no point searching through cars that were scrapped years ago, so I kept only the ones likely to still be on the road. That left 53.9 million.

A first prototype. My first version was a simple search on my own PC. A search that had taken 23 minutes through the API now took less than a hundredth of a second.

When I showed it to friends, they wanted to use it too. There were already a few similar sites, but the ones I tried were broken, slow or confusing. So I decided to turn the prototype into a proper website that anyone could use.

vehicles in the bulk file
138.5M
of them had never had an MOT, so I left them out
60.3M
final database on my PC
19 GB

From my PC to a live website

Rather than pay for a server, I decided to host Regish myself, on a Raspberry Pi at home. A Pi is a small, cheap computer, so making the search fast on it turned out to be the hardest part of the whole project. At first, some searches took several seconds, and some didn't work at all. After a few attempts, I changed the way the search works completely. Now a typical search takes about a fifth of a second, even if you only know a few characters from the middle of the plate.

The site also looks after itself. Several times a day it downloads the latest changes from the DVSA, and it emails me if anything goes wrong. If you're curious about how it all works, the technical details are in how it's built.

Designing the search

I wanted the search box to feel like an actual number plate, so you type into yellow tiles shaped like a real one, filling in what you can see and leaving the rest empty.

The feature I'm most pleased with is lookalikes. Nobody reads a plate perfectly from across the road, and characters like 0 and O, or 8 and B, are easy to mix up. If you turn lookalikes on for a character, Regish searches every version of it at once.

You can also search by the start, end or middle of a plate, at any length, and narrow it down by make, model, colour, fuel and year.

The Regish home page in dark mode: yellow plate tiles, a Search button, and options for plate length, lookalikes, any length and filters.

What I learned

The biggest lesson was that there's almost always more than one way to solve a problem. The DVLA API worked, technically, and I could easily have stopped there. Finding the bulk download, and later rethinking the search on the Pi, both came from looking past the first thing that worked. That's the habit I'll take with me most.

I also learned how quickly a small idea can grow, from a script to find one car to a website anyone can use. Along the way I realised how much I enjoy working with data, especially turning messy, inconsistent records into something people can rely on. That's the kind of work I want to keep doing.

What's next

Now that Regish is live, I want to hear from the people using it and improve it based on what they tell me. I also have a few new features in planning.

Try it yourself

Regish is live and free to use.

Open regish.co.uk
Regish searching for CF14 _ _ _: 1,189 matching vehicles shown as cards, starting with a brown Vauxhall Zafira.

Want the technical details? Read how Regish works under the hood.