|API stands for Application Programming Interface which allows external applications to access software or Web services data, in the latter case by using HTTP request messages, for recombination (mashup) or custom presentation by the external application.|
Why use an API?
An application programming interface essentially allows programs and online services to talk to each other. APIs provide a set of definitions and protocols for services to request and exchange data. Many library vendors provide public and key-based APIs to their services in order to allow customers to pull bibliographic and other data into local systems and websites.
APIs may seem daunting if you have no programming skills, but Richard Manly Adams Jr found in his article “Overcoming disintermediation: a call for librarians to learn to use web service APIs“:
The implementation of web service APIs is within the reach of librarians who are not trained as software developers. Online documentation and free courses offer sufficient training for librarians to learn these new ways of sharing and curating digital content.
For our purposes, we’ll only look at Web service APIs.
You may see an application programming interface described as a RESTful API. REST stands for representational state transfer. The REST architecture can be complicated, but essentially it indicates data sent over Web protocols using HTTP commands POST, GET, PUT, and DELETE.
Some APIs are “retrieval only” allowing only the GET command to retrieve data from the Web service. Others allow full access to get and write data to the Web service using all four of the HTTP commands.
You can also access a Web API using a URL containing a query string. The URL will include the domain, path, and the query terms after a question mark. The query terms can often use Boolean AND, OR, and wildcards (*). Multiple fields can be requested, separated by an ampersand (&).
The example below is an API URL which retrieves records from the Virtual International Authority File (VIAF) where the authority includes the term “Mark Twain” and returns a maximum of five records.
Below is a good introduction to Web applications and APIs by Mark Breedlove from the Digital Public Library of America (DPLA). [40 minutes + Q&A]
Springshare has been very proactive in providing APIs to its LibGuides product since launch. Users can access the API tool right from the menu. With the LibGuides APIs, users can pull any content and data from their LibGuides site to display in their library website, blog, learning management system (LMS), and OPAC through four GET options: GET guides, GET accounts, GET subjects, and GET assets.
Website widgets and plugins take advantage of APIs to pull data from Web services and also to write to them (using the POST command). For example, most social media sites provide APIs to display feeds, provide “Follow” or “Like” buttons, and even leave comments from external applications and websites.
Probably the most common API is the familiar RSS feed seen on many blog sites. The RSS API provides the unformatted data of blog post titles, dates, summaries, etc., which are then formatted for display by RSS readers.
Website developers can access a range of Twitter APIs from the Twitter Developers Documentation site. Here is their description of the Twitter API:
The Twitter API can be used to programmatically retrieve and analyze data, as well as engage with the conversation on Twitter.
This API provides access to a variety of different resources including the following: Tweets, Users, Direct Messages, Lists, Trends, Media, [and] Places[.]
Again, APIs allow external applications to exchange data and access functions normally handled by the host Web service.
Here are some great resources to learn about library-related APIs and what they can do:
- APIs for Librarians – Explanations and sample code you can modify to create APIs to popular library services.
- APIs for Scholarly Resources – A list of APIs for research databases and collections from the University of California, Berkeley Library.
- Crossref DOI Resolver API – Get a DOI from bibliographic data or submit a DOI to retrieve bibliographic data.
- DPLA API Basics – API basics and examples with information to access the Digital Public Library of America’s API (by requesting an API key).
- Elsevier APIs – Access Scopus and ScienceDirect data.
- Google Books APIs – “Access the full text of the Google Books repository.”
- Learning REST APIs – A LinkedIn Learning course on the basics of REST APIs; watch the Welcome, The RESTful librarian, and What is a REST API? for free.
- LibraryThing APIs – Book covers and other data available through public and key-based APIs.
- OCLC API Explorer – List of all OCLC APIs including the WorldCat Search API.
- ORCID API Tutorials – Get ORCID iDs and data made public by iD holders.
- Springshare API – LibGuides CMS search, widgets, and RESTful APIs.
Published resources about APIs:
APIs Unify Library Services by Marshall Breeding
From the April 2014 issue of Computers in Libraries, Breeding gives a high-level overview of APIs and their increasing availability from library software vendors. He touches on the basics, methods, scripts to access APIs, and examples of library services utilizing APIs. Published in 2014.
Access the full-text article.
Comparing the LibraryThing, OCLC, and Open Library ISBN APIs by David Fiander
This article from Code4Lib Journal (Issue 21) compares the data retrieved from the API of LibraryThing, OCLC, and Open Library for related works based on ISBN. It shows real-life API request and results data in XML and JSON. Published in 2013.
Access the full-text article.
Web Service APIs and Libraries by Jason Paul Michel
In this book from ALA Editions, the author demonstrates how to use APIs to integrate ten popular Web services into library websites: Twitter, Flickr, Vimeo, Google Charts, OCLC, HathiTrust, Open Library, LibraryThing, Goodreads, and Google Books. The book is a bit outdated but still useful for learning the basics. Published in 2013.
View details and find a place to buy or borrow at Google Books.