Parliamentary data, in a can

Public Whip and TheyWorkForYou have been around for a few years now, grabbing data from the UK Parliament website and making it more useful, and accessible with better navigation, search and email alerts.

It’s little known, but we also make all that open data available in a separate screen scraping project called parlparse. Rufus first got in contact with me years ago because he was excited by that possibility, of really useful new data being made available. Then he went on to set up KnowledgeForge which is where parlparse is now hosted. Thanks Rufus!

Unfortunately we’ve had relatively little take up. Not many people have made use of the data. To use a bunch of XML files you still need quite a lot of skills, which most people don’t have. So this time, we’re trying something different. Earlier this year mySociety won a grant from the Department for Constitutional Affairs (yay for the DCA!) to build an Application Programming Interface (API) for TheyWorkForYou. It’s now available, have a look at the TheyWorkForYou API page.

Now, API and XML are both three letter acronyms, and it’s not completely clear that one is easier than the other. But one of them is easier – you not only need code to use XML files, you also need somewhere to store data yourself, index it and so on (a non trivial job, for gigabytes of data). To use a rich API, you can just write code. Even just in-browser Javascript, as the TheyWorkForYou API can return Javascript data structures.

Amongst other things, the new TheyWorkForYou API lets you search Hansard, convert a postcode into a constituency and hence an MP, and even extract user contributed data from comments (shhh! don’t tell me, as I don’t like tagging, but you could always add comments with code words and use them as tags for speeches).

I’m hoping some people will use this to make focussed campaigns websites. For example, a site could take your postcode, look up your MP using the API and give you advice on what to write to your MP on a particular issue according to their party. I’m sure you can come up with lots of other ideas. Meanwhile though, content yourself with a fun but silly example. There are more examples at the bottom of the API front page.

The bad side of an API, as Rufus explained earlier this month, is that you don’t get hold of the actual data. In this case, it is all available as data from the parlparse project, apart from the postcode database (which we don’t have the license to republish). And that’s important. Having access to a free API is no security for the future, whereas having the data itself is.

P.S. We have a mySociety event this Friday in Liverpool. Come along, we pay for your transport (via DCA) if you are in the North West.