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