This API returns bibliographic, rights, and volume information when given a single or multiple standard identifiers (ISBN, LCCN, OCLC, etc.). It is intended for use to retrive information about small numbers of items at a time. Bulk retrieval should be done using OAI or the HathiTrust tab-delimited inventory files, as described at http://www.hathitrust.org/data [1]. Note that use of the data may be subject to third-party agreements, such as OCLC's Record Use policy. Permission must be sought for bulk retrieval of OCLC records by non-OCLC members.
For the purposes of this specification
In the simplest case, to retrieve volume information based on a single identifier, the following syntax would be used:
http://catalog.hathitrust.org/api/volumes/brief/<id type>/<id value>.json
http://catalog.hathitrust.org/api/volumes/full/<id type>/<id value>.json
The difference between a brief and full API request is that complete MARC-XML is returned in a full response.
For example, to get information about any item(s) associated with records that have the OCLC number 424023 (Infinite Series), the request would be:
http://catalog.hathitrust.org/api/volumes/brief/oclc/424023.json [2]
or
http://catalog.hathitrust.org/api/volumes/full/oclc/424023.json [3]
The data should be url-encoded if necessary; LCCN's in particular tend to have spaces and forward-slashes in them.
The return value will look like this:
{
"records":{
"000578050":{
"recordURL":"http:\/\/catalog.hathitrust.org\/Record\/000578050",
"titles":["Infinite series."],
"isbns":["0030110408"],
"issns":[],
"oclcs":["00424023"],
"lccns":["62009520"],
"marc-xml": "the marc-xml, only if requested via a full URL"
}
},
"items":[
{
"orig":"University of California",
"fromRecord":"000578050",
"htid":"uc1.b4405602",
"itemURL":"http:\/\/hdl.handle.net\/2027\/uc1.b4405602",
"rightsCode":"ic",
"lastUpdate":"20090903",
"enumcron":false,
"usRightsString":"Limited (search-only)"
},
{
"orig":"University of Michigan",
"fromRecord":"000578050",
"htid":"mdp.39015025315527",
"itemURL":"http:\/\/hdl.handle.net\/2027\/mdp.39015025315527",
"rightsCode":"ic",
"lastUpdate":"20090612",
"enumcron":false,
"usRightsString":"Limited (search-only)"
}
]
}
There are two sections: records which holds basic metadata about the set of records which match the query, and items which lists the complete set of individual HathiTrust items (volumes) associated with those records.
The records structure is a hash keyed on the nine-digit record number of each matched record. It may easily contain multiple records, since duplicates, while not common, are certainly possible.
For each record, we list:
The items structure is an array of hashes describing all the available items associated with matched records. There may be multiple items because the record(s) in question describe a serial or multi-volume set, or because identical volumes were digitized at more than one contributing institution.
For each item, we list:
As noted, a reasonably-sophisticated attempt is made to sort items by their enumcron (when present), often resulting in the items listed correctly by volume/number. Variation in the way these data have been entered at different institutions and at different times makes it impractical to guarantee the order will be correct, but it is more often than not correct.
The multi-id request format allows two extensions to the simple API described above:
The basic URL structure for these requests is
http://catalog.hathitrust.org/api/volumes/brief/<return type>/<search1>|<search2>|...|<searchN>
http://catalog.hathitrust.org/api/volumes/full/<return type>/<search1>|<search2>|...|<searchN>
A simple example to get items associated with a single record based on multiple identifiers would be
http://catalog.hathitrust.org/api/volumes/brief/json/id:BJD1;oclc:424023;isbn:0030110408 [7]
or
http://catalog.hathitrust.org/api/volumes/full/json/id:BJD1;oclc:424023;isbn:0030110408 [8] [8]
This example is looking for json results describing records (and the items attached to those records) that have the given OCLC number and/or the given ISBN. The local ID (from which the OCLC and ISBN were retrieved) is 'BJD1'. The data returned will be identified with that string [so the HathiTrust data can be added to a local display].
...is always json at the moment. No other return types are offered (but please ask [9] if you need something else).
A search specification is a set of <id type>:<id value> pairs separated by semi-colons. The id types and values [10] are exactly as described for the Simple API.
It is possible to provide a special "id:MyID" pair as part of the search specification. If this is done, the basic JSON return structure associated with this search will be keyed on "MyID". If not, it will be keyed on the whole search specification (colons, semicolons, etc.).
A record matches if all <id type>:<id value> pairs provided match or are not present. As an example, if an OCLC number and an LCCN number are provide (along with the ignored-for-matching id):
id:1;oclc:45678;lccn:70628581
Up to 20 records may be requested at once by providing multiple search specifications separated by the pipe ( | ) character.
Regardless of whether a request is made for one record or many, what is returned is a set of basic JSON return structures [11] keyed on the provided ids (or on the whole search specification if the request does not include an id).
So, the URL
http://catalog.hathitrust.org/api/volumes/brief/json/id:552;lccn:70628581|isbn:0030110408 [12]
...will return a hash with two elements. One is keyed on '552' (the provided id) and the other on 'isbn:0030110408' (since no id was provided).
JSON-P [13] is a convention used to allow cross-site scripting in AJAX calls to get JSON data. The Rights API supports JSON-P requests -- just add '&callback=<value>" to the end of your URL.
Links:
[1] http://www.hathitrust.org/data
[2] http://catalog.hathitrust.org/api/volumes/brief/oclc/424023.json
[3] http://catalog.hathitrust.org/api/volumes/full/oclc/424023.json
[4] http://www.loc.gov/marc/lccn-namespace.html#syntax
[5] http://www.hathitrust.org/hathifiles_description#volume
[6] http://www.hathitrust.org/hathifiles_description#rights
[7] http://catalog.hathitrust.org/api/volumes/brief/json/id:BJD1;oclc:424023;isbn:0030110408
[8] http://catalog.hathitrust.org/api/volumes/full/json/id:BJD1;oclc:424023;isbn:0030110408
[9] http://www.hathitrust.org/feedback
[10] http://www.hathitrust.org/bib_api#idtypes
[11] http://www.hathitrust.org/bib_api#basicjson
[12] http://catalog.hathitrust.org/api/volumes/brief/json/id:552;lccn:70628581|isbn:0030110408
[13] http://en.wikipedia.org/wiki/JSON#JSONP