Application Programme Interface (APIs) How to?

As part of my series on passing on the baton of knowledge, I will be looking at API, which stands for Application Programming Interface.

It is a way a website or service can allow integration of its content into other websites.

News organizations can develop APIs so their content can be customized with additional information at other web sites. It’s one more way for a news organization to participate in and make its content available to a larger online network.

See for example:

As part of the City journalism MA we have been learning how to use APIs with data journalist Paul Bradshaw.

Today I am going to show you how to use APIs using Google refine:

USING GOOGLE REFINE (don’t close the black box, and open using Chrome or Firefox without any other applications running)

We created a simple excel doc with 3 postcodes, and downloaded it into Google refine

Image

Quotation Marks

Image

+value, a command without the quotation marks

Need another plus before remaining string, +.json

Image

Click OK

Image

Edit Json

Go to OJ blog

http://onlinejournalismblog.com/2010/12/16/adding-geographical-information-to-a-spreadsheet-based-on-postcodes-google-refine-and-apis/

Image

Add [“geo”]

Image

What’s changed in Json? Focused on geo branch

Add Lat

Image

Copy expressions, call it latitude, click ok

value.parseJson()[“geo”][“lat”]

do longitude now

Image

Image

Image

You are able to combine this with the Police API data and find out even more information, such as crimes in a specific location.

Image

Image

Advertisements
Image

Rape reports versus people proceeded against (2008-2013) from the Metropolitan police

rape 222Very interesting set of data showing the number of people who have reported rape versus the number of people who have been charged. This is a useful and challenging set of data as it shows that less than 50% of people have actually been charged, but those people reporting rape or sexual assault over the last five years has increased by 17 per cent.