How to get an MP name from a post code? I fancy doing this, Obviously “they work for you” have this? Could I write a script or copy their code? I had a look and on first review their database is obfuscated. Can I build my own and how and where to host it? I would also need a javascript or html interface. Here are my notes ….


Where to get the data?  See  and . The file has too many rows for excel and has been broken up into chunks.

I think we need a database and SQL seems the obvious choice. On inspection of the data, I think the implementation schema looks like this.

Constituency – Postcode ERM

The ONS data uses a constituency code as a surrogate key. The database would probably be easier to implement using this as the foreign key, but the solution would be more compact if the name was used as the foreign key. (Does this mean that constituency name needs to be fixed length, I mean I think not.) postcode.constituencyname is the foreign key to constituency table.

An alternative to an SQL database might by a javascript or python daemon.

Which Database?

I need to choose a database and hosting provider.  I could host my own at, but, I ran a google query, free database service and the answers focused on free software not a free service, but I found, 14 best free database hosting/ by Laura Bernheim at, which while offering some free services reminds me I have the capacity to build the database within my ionos account. And there’s this, 6 databases for Raspberry Pi. and this which recommends a more traditional five i.e. I have heard of all of them.

Queries on the net

Yeah, not sure! The best answer would seem to be javascript, but there maybe other solutions, python or PHP, maybe even RDF & SPARQL although that would take a lot of skill that I don’t currently posses.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.