print $title;
print $subtitle;print $author;print $position;print $institution;
$title = “harnessing free content with web service apis”;$subtitle = “an ala editions workshop”;$author = “jason paul michel”;$position = “user experience librarian”;$institution = “miami university libraries”;
agenda
• Discuss open web ecosystem • Place of APIs in that ecosystem• What is exactly is an API?• An example from the programmer’s
perspective• Real World examples• Slice of available APIs• What is needed for development• Where to find and keep up with information
the “open” web ecosystem
• social web services are not social merely because of the interactions between users they facilitate.
• social web services are social because they also are able to talk to one another on a programmatic level.
the “open” web ecosystem
• thus, If This Then That (ifttt.com)
the “open” web ecosystem
• thus,
the “open” web ecosystem
• Achieved largely through the use of APIs• API = Application Programming Interface• Method of data transfer via HTTP
neighbor’s garage analogy
Open Source: take whatever you want, modify however you want,
use however you want
Proprietary: pay for each tool in the garage, use them as designed
API: utilize the services of the garage,
if you have authorization and ask the right way
Why APIs?
• Increase visibility of data / service• Take advantage of the crowdsourcing
model to improve service, e.g. Tweetdeck
• From libraries’ perspective: its important to integrate with wider web environment
Typical API Process
• Request API Key from Service• Choose scripting language: PHP, Ruby on Rails
etc.• Using chosen language, submit data request via
available API methods• Ingest that data in JSON, XML or other data type• Transform the data to make it usable with
scripting language• Upload data to a database • Wrap data in HTML, CSS for user interface
api request example
https://api.twitter.com/1.1/search/tweet.json?q=book%20OR%20research
Base url
Each Web Service typically has several base urls depending on the type of information you are seeking and each resource type has its own set of parameters, e.g.:
https://api.twitter.com/1.1/followers/ids,https://api.twitter.com/1.1/friendships/lookup
Data type
Parameters
api request example [statuses] => Array ( [0] => stdClass Object ( [metadata] => stdClass Object ( [result_type] => recent [iso_language_code] => en )
[created_at] => Sat Jul 20 16:25:22 +0000 2013 [id] => 3.58623679498E+17 [id_str] => 358623679497777153 [text] => This book just got too good! She said yes!! #christiangrey👏👰
[source] => Twitter for iPhone [truncated] => [in_reply_to_status_id] => [in_reply_to_status_id_str] => [in_reply_to_user_id] => [in_reply_to_user_id_str] => [in_reply_to_screen_name] => [user] => stdClass Object ( [id] => 307066025 [id_str] => 307066025 [name] => Alicia Reece [screen_name] => aaliciaaaajo [location] => etc…..
api request example
• At this point you can send the data received to a database or create a dynamic web application on top of the live data.
try it
• https://graph.facebook.com/username or
• https://graph.facebook.com/pageid
working examples
• Programmatically capture, store & display potentially relevant tweets in specific geolocation to serve as a springboard for proactive info services and social interaction.
https://api.twitter.com/1.1/search/tweet.json?q=book%20OR%20research&geocode=39.5069974,-84.745231,2mi&rpp=100
working examples
vimeo
• Upload video tutorials to Vimeo• Utilizing API, bring your own video tutorials in
to your own web interface.
http://vimeo.com/api/v2/miamiulibraries/videos.json
working examples
vimeoworking examples
• Create a patron-generated gallery of instagram images based on a pre-determined hashtag or keyword
https://api.instagram.com/v1/tags/miamioh/media/recent
working examples
http://d.lib.ncsu.edu/myhuntlibrary
working examples
instagramworking examples
movieDB
• Utilizing the movieDB API, create a Netflix-style application with available Movie posters
http://themoviedb.apiary.io/3/search/movie
working examples
movieDBworking examples
worldcat
• Utilizing OCLC’s WorldCat Basic API, pull in citation information for catalog records.
http://www.worldcat.org/webservices/catalog/content/citations/isbn/1250012570?cformat=turabian&wskey=key
working examples
worldcatworking examples
goodreads
• Utilizing goodreads API, enhance catalog records with goodreads reviews.
http://www.goodreads.com/book/show?format=json&key=key&id=bookid
working examples
goodreads exampleworking examples
openlibrary/hathi/google books
• You don’t need to limit your catalog to what you own / subscribe to…
• There are web services out there with open content that your catalog can tap in to.
http://openlibrary.org/api/books?bibkeys=OCLC:4942988&jscmd=data&format=json
http://catalog.hathitrust.org/api/volumes/full/oclc/381593.json
working examples
openlibrary/hathi/google booksworking examples
openlibrary
• Enhance catalog with book covers.
http://covers.openlibrary.org/b/olid/OL7440033M-S.jpg
http://covers.openlibrary.org/b/$key/$value-$size.jpg
working examples
flickr
• Bulk uploading images and metadata from repositories to flickr for wider audience
• Embedding flickr slideshows of own imagery stored in flickr
• Bringing in safe flickr content from current events / subjects
working examples
Possible API Usages
Social TrackingPossible API Usages
Catalog Enhancements
Possible API Usages
evernote & dropbox
• Export catalog records / lists of catalog records out to Evernote/Dropbox
• Export articles to Evernote/Dropbox
Possible API Usages
Catalog Enhancements
rotten tomatoes
• Enhance movie records with Rotten Tomatoes reviews
• Retrieve cast, directors and movie posters
Possible API Usages
Catalog Enhancements
ny times bestseller
• Get links to reviews of NY Times Bestsellers
• Get current NY Times Bestseller Lists and link to catalog records if available..
Possible API Usages
Catalog Enhancements
DPLA
• Enhancing catalog records with DPLA content• DPLA content includes images, text, video
and sound• “an open, distributed network of
comprehensive online resources that would draw on the nation’s living heritage from libraries, universities, archives, and museums in order to educate, inform, and empower everyone in current and future generations.”
Possible API Usages
Catalog Enhancements
hoover’s
• Get Company data to match potential company queries in catalog
Possible API Usages
Catalog Enhancements
cambridge dictionaries online/oed
• Get definitions as an additional piece of content in catalog search
Possible API Usages
Catalog Enhancements
mendeley
• export citation data from catalog
Possible API Usages
Catalog Enhancements
OA APIs
• CORE Project – Open University• ArXiv• Hathi • Open Library
Possible API Usages
Catalog Enhancements
Single Interface Utopia?
Possible API Usages
ILS & Discovery Layer APIs
• ILSs and Discover Layers are increasingly adding APIs…
• Ebsco EDS• Summon• VUFind• Koha• These APIs allow developers to
create their own interfaces..
Possible API Usages
Single Interface
Publisher APIs
• IEEE Xplore • Springer• Elsevier: SciVerse (Scopus,
ScienceDirect, SciVerse Hub)• Cambridge Journals• Cambridge Dictionaries• And more….
Possible API Usages
Single Interface
Vendor APIs
• Factiva – integrate all of factiva’s content
• Hoover’s – integrate company information
• And more…
Possible API Usages
Single Interface
OA APIs
• CORE Project – Open University• arXiv• Open Library• Hathi Trust
Possible API Usages
Single User Interface
API Development : what is needed?
• Programming expertise: PHP, Ruby, Python, Javascript, XML, JSON, SQL, HTML, CSS
• Invest subject librarians in the process: what APIs are available per discipline, which offers value?
• Usability assessment• Development tools: programming
software and hardware
Further resources
• Programmable Web• Zite(app): APIs• Web Service APIs and Libraries, ALA
Editions• eCourse in October• Twitter: @kinlane, @hackernews
References• http://ifttt.com• https://dev.twitter.com/• https://developers.facebook.com/docs/reference/api/• https://developer.vimeo.com/• http://instagram.com/developer/• http://www.themoviedb.org/• http://oclc.org/developer/documentation/worldcat-basic-api/using-
api• http://www.goodreads.com/api• http://openlibrary.org/developers/api• http://www.hathitrust.org/data_api• http://www.flickr.com/services/api/• http://dev.evernote.com/• https://www.dropbox.com/developers• http://developer.rottentomatoes.com/• http://developer.nytimes.com/docs
References• http://dp.la/info/developers/codex/• http://developer.hoovers.com/• http://core.kmi.open.ac.uk/intro/api• http://arxiv.org/help/api/index• http://dictionary-api.cambridge.org/• http://public.oed.com/subscriber-services/sru-service/• http://dev.mendeley.com/• https://www.ebscohost.com/discovery/api• http://api.summon.serialssolutions.com/• http://vufind.org/features.php• http://dev.springer.com/• http://ieeexplore.ieee.org/gateway/• http://www.developers.elsevier.com/devcms/scopusintegration• http://journals.cambridge.org/action/stream?pageId=9048&level=2• http://www.factiva.com/CP_Developer/ProductHelp/FDK/FDK20/
fdk_overview/index.htm