New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
APIs, Web Services, and Mashups: What they are and how they can be used
1. APIs, Web Services, and
Mashups
What they are and how they can be used
by Shane Nackerud
University of Minnesota Libraries
snackeru@umn.edu
2. Agenda
What is an API?
What is a Web
Service?
What is a mashup?
What are some
examples?
Look at an API
A little code ...
3. What is an API?
“An application programming interface (API) is a
particular set of rules and specifications that a software
program can follow to access and make use of the
services and resources provided by another software
program.”
http://en.wikipedia.org/wiki/Application_programming_interface
4.
5. Break it down
Interface for software apps and servers
Application to Application interaction and exchange of
data
Real time communication and data exchange
Allows software programs to interact with other
software programs data through means other than the
normal main interface
9. Web Service
TweetDeck is a client application
Web services are APIs that work primarily through the
web, web servers, or a network
Server to server APIs
Google Maps API is a good example
10.
11. Add the code to include the Google Maps API:
<script src="http://maps.google.com/maps?
file=api&v=2&
key=ABQIAAAA6JBCuUc9hZU7FVhzHksqsxSFThBmb0Wg
HbIO-PDXl2-6njl54hRynCyYgHJZbbA1K1ChW7zdIcbMwA"
type="text/javascript"></script>
12. Add the code to include library locations data and mark
them on the map:
var request = GXmlHttp.create();
request.open("GET", "/libinc/libraries.xml", true);
request.onreadystatechange = function() {
if (request.readyState == 4) {
var xmlDoc = GXml.parse(request.responseText);
// obtain the array of markers and loop through it
var markers =
xmlDoc.documentElement.getElementsByTagName("mar
ker");
13. Library Location XML Data:
<markers>
<marker lat="44.970971" lng="-93.243633" html="Ames Library (in
Wilson Library)<br />309 19th Ave. S.<br />
Minneapolis, MN 55455<br />612-624-4857<br /><a href='http://
www.lib.umn.edu/site/fetch_hours.phtml?LibID=2'>
Hours</a><br />" label="Ames Library (in Wilson Library)"/>
<marker lat="44.973191" lng="-93.243083" html="Andersen
Library<br />222 21st Ave. S.<br />
Minneapolis, MN 55455<br />612-625-9825<br /><a href='http://
www.lib.umn.edu/site/fetch_hours.phtml?LibID=14'>
Hours</a><br />" label="Elmer L. Andersen Library"/>
14. Mashups
A website that combines information/data from more
than one source creating an integrated experience
Speaking of Google Maps ...
21. Why?
Developers
Get at important data/services not locally held
Quicker creation of common tasks and services
Learn more about their users
Create whizz-bang gizmos and gadgets
22. Why?
Providers
Create more visibility for services offered
Create more traffic for services offered
Make money (some APIs aren’t free)
Make customers happy and be amazed at how they
use your data
35. Query Protocol Record Formats
xISBN - can query the API through REST and OpenURL
Data - comes back as XML, JSON, TEXT, PHP,
HTML
36. Query Protocol Record Formats
xISBN - can query the API through REST and OpenURL
Data - comes back as XML, JSON, TEXT, PHP,
HTML
Say what?
37. REST
Representational State Transfer (REST) is a style of
software architecture for distributed hypermedia
systems such as the World Wide Web.
For our purposes: RESTful APIs use HTTP to request
the data
Data is requested through a URL call
Similar to OpenURL
54. Course Specific
Resource
Suggestions API
Subject Guide API
Course Reserves API
55. In conclusion
Old and Busted New Hotness
Web Server Web Server
API
API
API
Database Database
56. In conclusion
With APIs the Web can truly become a networked
database (of sorts)
Always ask a vendor if the application has an API
Start noticing APIs that are available and think ...
Be a provider, too
Editor's Notes
\n
\n
\n
\n
\n
\n
\n
\n
\n
How does it work?\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
It uses the WorldCat Search API to fill in citation information for books, magazines, newspapers, Web sites, journals, films and more. Started at Carnegie Mellon, now contains over 25 million citations.\n
The code gathers related ISSN from the xISSN web service and then uses these to gather relevant subject headings from the Worldcat Search API. It then uses these subject headings to search for and display other titles that the library has that have similar subjects, allowing users to "Find Similar Journals" to the ones they are browsing.\n
The code gathers related ISSN from the xISSN web service and then uses these to gather relevant subject headings from the Worldcat Search API. It then uses these subject headings to search for and display other titles that the library has that have similar subjects, allowing users to "Find Similar Journals" to the ones they are browsing.\n