Skip to content

Google Books and HathiTrust Integration Links

Ruth edited this page May 17, 2024 · 40 revisions

When a record does not have a link to access ONLINE materials, we will check to see whether there are scanned copies in HathiTrust or in Google Books. This link will only show on the record page, not on the search results page.

Logic should be (note, waiting on this: https://github.com/psu-libraries/psulib_blacklight/issues/1298):

  • If an item is ONLINE then we don't display HathiTrust or Google Books links.
  • If we get a full copy from HathiTrust, generate link and don't link to Google Books
  • If we don't get a full copy from HathiTrust, then IF there's a full or preview copy from Google Books we generate that link.
  • If we don't have either a full HathiTrust copy or a full or preview copy from Google books, don't display any special links.

HathiTrust

First, we'll query HathiTrust to see whether a public domain copy is available. We only link to works which have at least one copy/item in the public domain because the search inside experience is not of use to almost any of our patrons. The API uses only one identifier parameter. Choose the first one which exists in the following order:

  • oclc
  • lccn
  • issn (first)

Syntax is: https://catalog.hathitrust.org/api/volumes/brief/oclc/424023.json with appropriate param in place of oclc if needed

We are looking for at least ONE item which has: "usRightsString":"Full view"

Sample with several items in Limited View only: https://catalog.hathitrust.org/api/volumes/brief/oclc/424023.json

Sample with only one item, Full View: https://catalog.hathitrust.org/api/volumes/brief/oclc/433.json

These two pages have more documentation:

We'll then display the link using HathiTrust branding.

Google Books

If we cannot get a US Rights: full view copy from HathiTrust, we query the Google Books API to see if there's a copy that we can search inside. Just as we only want to generate HathiTrust links if there's a full copy, for Google Books we want a preview at minimum, otherwise it's of no use to the patron.

For this, we send all keys as a comma-separated list, using the following order and prefixing for each key. All qualifiers and prefixes should've been removed.

  • OCLC
  • ISBN
  • LCCN

e.g. https://books.google.com/books?jscmd=viewapi&bibkeys=OCLC:1226074058,ISBN:9780226794617,ISBN:022679461X,ISBN:9780226794754,ISBN:022679475X,LCCN:2020053633&[callback with jquery and key, but the URL as is will allow you to download data]

If there's a "preview_url" AND "preview" is not "noview" (so NOT "preview":"noview") then we should generate the preview URL.

Past Integration With HathiTrust CSVs

From late 2020 until 2024, we indexed HathiTrust identifiers using our Emergency Temporary Access Service reports through July 2022. Past versions of this page contain details about how we handled display for HathiTrust.

Clone this wiki locally