open apis - concepts. applications. visualizations

33
Open APIs Concepts. Applications. Visualizations.

Upload: christian-dalager

Post on 14-Jul-2015

231 views

Category:

Internet


6 download

TRANSCRIPT

Open APIsConcepts. Applications. Visualizations.

Me. Christian Dalager

Coding for fun & profit

Web. Not design.

Eksponent.com

@dalager

We really need to talk about... stuff

● Short story of closed and open.● What is APIs?● Applications● Implications

https://www.flickr.com/photos/mlrs193/6015396482

The Internet - Open Information

Democratization of media and information

● blogging (early 00s)● citizen journalism / knowledge● disrupting monopolistic structures ● cracks in the walls of organizations● whistleblowing/wikileaks

Open Source

Software Ecosystem

● Linux - open operating system● Wordpress - open publishing platform● Github - open source distribution platform

Open Data

“Open data is the idea that certain data should be freely available to everyone to use and republish as they wish, without restrictions from copyright, patents or other mechanisms of control” http://en.wikipedia.org/wiki/Open_data

● Wikipedia● Creative Commons● OpenStreetMap● http://data.kk.dk

Open Hardware

Taking the “open movement” into the real

● Maker / Tinker Movement● Arduino / Raspberry PI● 3D Printing

So. Friendship across borders.

API TimeUnderstanding APIs

Application Programming Interface

Updating data“Hey fitbit, update dalagers weight to 91.3 kg”

Or “the way that machines talk to each other”

Reading information“Hey twitter, give me a list of @dalagers last five tweets”

{ "coordinates": null, "favorited": false, "truncated": false, "created_at": "Wed Aug 29 17:12:

58 +0000 2012", "id_str": "240859602684612608", "entities": { "urls": [ { "expanded_url": "https:

//dev.twitter.com/blog/twitter-certified-products", "url": "https://t.

co/MjJ8xAnT", "indices": [ 52, 73 ], "display_url": "dev.

twitter.com/blog/twitter-c\u2026" } ], "hashtags": [ ], "user_mentions": [ ] }, "in_reply_to_user_id_str": null, "contributors": null, "text": "Introducing the Twitter

Certified Products Program: https://t.co/MjJ8xAnT", "retweet_count": 121, "in_reply_to_status_id_str":

null, "id": 240859602684612608, "geo": null, "retweeted": false,

"possibly_sensitive": false, "in_reply_to_user_id": null, "place": null, "user": { "profile_sidebar_fill_color":

"DDEEF6",

"profile_sidebar_border_color": "C0DEED", "profile_background_tile":

false, "name": "Twitter API", "profile_image_url": "http:

//a0.twimg.com/profile_images/2284174872/7df3h38zabcvjylnyfe3_normal.png",

"created_at": "Wed May 23 06:01:13 +0000 2007",

"location": "San Francisco, CA",

"follow_request_sent": false, "profile_link_color":

"0084B4", "is_translator": false, "id_str": "6253282", "entities": { "url": { "urls": [ { "expanded_url": null, "url": "http://dev.

twitter.com", "indices": [ 0, 22 ] } ] }, "description": { "urls": [ ] } },

"default_profile": true, "contributors_enabled": true, "favourites_count": 24, "url": "http://dev.twitter.com", "profile_image_url_https": "https://si0.

twimg.com/profile_images/2284174872/7df3h38zabcvjylnyfe3_normal.png",

"utc_offset": -28800, "id": 6253282, "profile_use_background_image": true, "listed_count": 10775, "profile_text_color": "333333", "lang": "en", "followers_count": 1212864, "protected": false, "notifications": null, "profile_background_image_url_https":

"https://si0.twimg.com/images/themes/theme1/bg.png", "profile_background_color": "C0DEED", "verified": true, "geo_enabled": true, "time_zone": "Pacific Time (US &

Canada)", "description": "The Real Twitter API. I

tweet about API changes, service issues and happily answer questions about Twitter and our API. Don't get an answer? It's on my website.",

"default_profile_image": false, "profile_background_image_url": "http:

//a0.twimg.com/images/themes/theme1/bg.png", "statuses_count": 3333, "friends_count": 31, "following": null, "show_all_inline_media": false, "screen_name": "twitterapi" }, "in_reply_to_screen_name": null, "source": "<a href="//sites.google.

com/site/yorufukurou/\"" rel="\"nofollow\"">YoruFukurou</a>", "in_reply_to_status_id": null }

Tweet: “Introducing the Twitter Certified Products Program: https://t.co/MjJ8xAnT”

Open APIs

● Setting data free● Holes in the garden walls● Categories

○ Embedding - Twitter widgets, like buttons○ Datafeeds - JSON/RSS (Really Simple Syndication)

○ Full access (read/write/delete) “on behalf of” - typically w OAuth2 or similar security.

Where can I find an API?

● Discover it: programmableweb.com● Ask it: “Do you have an API?”

Why create an API for a service?

● Open APIs are the shoulders of digital giants○ users will build value (for free) on top of your stuff

● participate in internet ecosystem● help users use their own data / your data● create ties to your API consumers● let 3rd party mobile apps use your service

ApplicationsWhat people are using it for

Mashing it up / Mixing the openness

● Innovative services, creating new value through APIs - Uber,Mechanical Turk, IFTTT● Visualisations - http://variable.io/ (Martin Ignac, CIID alumni), D3.js cases● Activism - ggautoblocker, visitationszone.dk, face-to-facebook, They Rule, Please rob me, Buycott● Journalism - dk national budget 2015, Million dollars blocks● Websites - ie twitter widgets● Art - seb.ly, various installations (activism list is also arty)● Tools - gazillion examples. But Slack does A LOT.

On visualizations

No data, nothing to visualize.

(big) Data

Visualization

Existing data? Need to collect? How?Sources: CSV, GeoJSON, Txt, Databases, Google Fusion Tables

Target audience?Tech: Excel/GoogleChart, D3.js, Graph tools, JavaScript, Html/CSS3, Plask

Intent Solving a problem? (reducing/communicating complexity)Exploring unknown territory?

A few samples

wordle.net +kea.dk content

Sociallytic.dk + HipChat + D3.js

Implications Life in the algorithmic and API-driven world

“If the product is free, you are the product.”

Open APIs are an investment. You are the ROI.

Dark side of open APIs

● There is ALWAYS a price: every external API you use will tie you up one way or another

● As a service you also tie close bonds to your consumers. ○ They depend on you. ○ If you die they die.

APIs as interfaces to human labor

● Mechanical turk, TaskRabbit, Uber, Translation services● "Jobs above the api vs jobs below the API"● Making it hard to advance through the API layer.● Decoupling human labor from business layer will make

the next step trivial: replacing humans with robots or software.

http://rein.pk/replacing-middle-management-with-apis/

Get started

How to get started...

● ARGH I’m not a programmer!!!!○ There are online services.○ Code ‘n paste will get you far

But...

Everyone should learn to code

● At some point you need to get dirty hands.● Empower yourself● Find your pain points and start there● JavaScript can do everything

○ button click on website, alert(“you clicked me!”)○ unity3d scripting○ advanced visualization stuff○ control your Philips Hue lightbulb○ enhance your google spreadsheet

On working with maps

Map visualizations are cool.

But consider if geography is a core part of what you are trying to communicate.

Maplinkshttp://geojson.org/

http://geojson.io/ - simple map editor

http://leafletjs.com/ - styling

http://mapbox.com

https://mangomap.com/

http://openlayers.org/

Geojson data for countries:

http://geojson-maps.kyd.com.au/

Links

37 tools for datavisualizations

- http://www.creativebloq.com/design-tools/data-visualization-712402

D3 example gallery

- https://github.com/mbostock/d3/wiki/Gallery