Processing and the Guardian API

This post is 8 years old. It may contain facts or opinions that are no longer correct. If you spot something you think should be updated, contact me by email or Twitter.

Inspired by this article from the awesome Jer "Blprnt" Thorp, I've been experimenting with the Guardian's Open Platform API, which gives access to ten years worth of articles in XML or JSON format. You have to sign up for an API key but it's free and easy. I thought I'd put up some of the early tests I've been doing with it. I've never worked with XML before so it's been something of a learning experience! These three pieces use the same code, just different search terms. I've searched for the names of our most recent "dear leaders" in the news section, and, er, put the headlines in a circle. That's about as far as I've got at the moment...

David Cameron:

david+cameron

Gordon Brown:

gordon+brown

Tony Blair:

tony+blair

Not a lot of information we can glean from that, I think you'll agree, other than there are significantly more articles mentioning Blair (unsurprising as he was PM for much longer than the other two, so far at least), but I think there's some potential for some interesting stuff. It's also worthwhile to note that Processing's functionality has improved since Jer wrote his article, which I think makes it easier to get started with XML without having to dig into external libraries or obscure Java coding.