Skip to content
liseli edited this page Mar 17, 2026 · 9 revisions

This API enables some endpoints to support catalog search in libraries.

The rewrite rules in .htaccess are responsible for mapping api/volumes/... endpoints into static/api/volumes.php?... URLs

There are four variations on Bib API endpoints. The components will be abbreviated as follows:

  • b - brevity:, usually but not always enforced to be in {brief, full}
    • The difference between a brief and full is that a complete MARC-XML is returned in a full response.
  • t - type: the output format is always json, no other output formats are implemented.
  • qf - query_field, fields defined on the Catalog Solr index to retrieve a record. The API allows Solr queries with the following fields
    • recordid,
    • sysid
    • oclc
    • htid
    • issn
    • isbn
    • lccn
    • umid. To see what each field means, access the public documentation.
  • qv - query value , such as mdp.39015048895836
  • Q, which is qf (query_field) combined with qv (query_value), e.g., htid:mdp.39015048895836
    • Q may have multiple values for a field, e.g., htid:mdp.39015048895836|mdp.39015004074095 (treated as an OR and that allows for retrieving up to 20 records at a time)
    • Q may have multiple fields or id types, e.g., htid:mdp.39015048895836;oclc:7107072 (treated as an AND, you will use different fields to find a record.)
    • The exact semantics are not entirely clear from the documentation and are buried in the code

In order of appearance in .htaccess, they are:

Valid Query Fields

According to the code (lines 94-106), these fields are supported:

  • htid / ht_id - HathiTrust item ID
  • oclc - OCLC number
  • isbn - ISBN
  • issn - ISSN
  • lccn - Library of Congress Control Number
  • recordnumber / recordid / sysid / umid - Catalog record identifiers

The API requires a query parameter with field:value pairs:

  1. Query by HathiTrust ID (htid)

http://catalog.hathitrust.org/static/api/volumes.php?q=htid:mdp.39015012668484&type=json&brevity=full&single=1

  1. Query by OCLC Number

https://catalog.hathitrust.org/static/api/volumes.php?q=oclc:7107072&type=json&brevity=full

  1. Query by ISBN

http://catalog.hathitrust.org/static/api/volumes.php?q=isbn:9780123456789&type=json&brevity=full

  1. Query by Record Number

http://catalog.hathitrust.org/static/api/volumes.php?q=recordnumber:000012345&type=json&brevity=full

  1. Query by ISSN

http://catalog.hathitrust.org/static/api/volumes.php?q=issn:1234-5678&type=json&brevity=full

  1. Query by LCCN

http://catalog.hathitrust.org/static/api/volumes.php?q=lccn:2001012345&type=json&brevity=full

Multiple Queries (OR logic)

Use | to separate multiple queries: http://catalog.hathitrust.org/static/api/volumes.php?q=oclc:12345678|oclc:87654321&type=json&brevity=full

Output Formats

  • JSON (default structured output)

http://catalog.hathitrust.org/static/api/volumes.php?q=htid:mdp.39015012668484&type=json&brevity=full

  • JSONP (with callback)

http://catalog.hathitrust.org/static/api/volumes.php?q=htid:mdp.39015012668484&type=json&callback=myFunction&brevity=full

  • Optional Parameters

Include Full MARC-XML

http://catalog.hathitrust.org/static/api/volumes.php?q=htid:mdp.39015012668484&type=json&brevity=full

  • Unwrap Single Results

http://catalog.hathitrust.org/static/api/volumes.php?q=htid:mdp.39015012668484&type=json&single=1&brevity=full

Example with Real HathiTrust ID

Clone this wiki locally