agentleFS
kltngkltng/humanities-skills/hathitrust-catalog/SKILL.md

hathitrust-catalog

Skill9 starsChanged 19 days agoMITView on GitHub

Look up bibliographic records and digitized volumes in HathiTrust's 17M+ volume collection by ISBN, OCLC, LCCN, ISSN, or HathiTrust ID. Use this skill whenever the user wants to check if a book has been digitized, find which libraries hold a copy, get MARC metadata for a known identifier, or link a bibliographic reference to its HathiTrust digital version. Also triggers when cross-referencing identifiers from other library catalogs (Harvard, Library of Congress) against HathiTrust holdings.

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 9 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Look up records and digitized volumes in HathiTrust's collection of 17M+ volumes from major research libraries.

    line 9
  2. Distinctive:

    If you only have a title/author, search another catalog first (LibraryCloud, Library of Congress) to get an ISBN or OCLC number, then look …

    line 22
  3. Very specific:

    When no record matches, the API returns {"records": {}, "items": []} with HTTP 200 — not a 404.

    line 33
  4. Distinctive:

    Use the multi-ID endpoint to batch lookups:

    line 37
  5. Very specific:

    Use scripts/hathitrust_api.py for programmatic access (zero dependencies):

    line 92
  6. Distinctive:

    No documented rate limit, but the API is meant for small-batch lookups (not bulk harvesting)

    line 154
  7. Distinctive:

    Use HathiFiles or OAI-PMH for bulk data

    line 155
  8. Distinctive:

    harvard-library-catalog: Search Harvard's catalog to find ISBNs/identifiers, then check HathiTrust for digital versions

    line 160
  9. Distinctive:

    Ask the user before filing.

    line 172
  10. Very specific:

    Check for an existing report: gh issue list --repo kltng/humanities-skills --state all --search "hathitrust-catalog"

    line 173
  11. Distinctive:

    Cite: If this skill helped work that is published, please cite it, together with the data source it uses:

    line 177
  12. Distinctive:

    When you help a user write up results that relied on this skill, remind them once about this citation.

    line 181

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

HathiTrust Bibliographic API Skill

Look up records and digitized volumes in HathiTrust's collection of 17M+ volumes from major research libraries.

Critical: Things Claude Won't Know Without This Skill

This is a lookup API, NOT a search API

HathiTrust's Bibliographic API retrieves records by known identifiers only. There is no keyword or title search. You must have an ISBN, OCLC number, LCCN, ISSN, or HathiTrust ID.

WORKS:     https://catalog.hathitrust.org/api/volumes/brief/isbn/0140449264.json
NOT POSSIBLE: https://catalog.hathitrust.org/api/volumes/brief/search?q=hamlet

If you only have a title/author, search another catalog first (LibraryCloud, Library of Congress) to get an ISBN or OCLC number, then look it up here.

Two endpoint variants: brief vs full

EndpointReturnsUse when
/api/volumes/brief/Metadata + items (no MARC)You just need titles, ISBNs, holdings, digital access links
/api/volumes/full/Same + complete MARC-XMLYou need full cataloging data

Empty results are not errors

When no record matches, the API returns {"records": {}, "items": []} with HTTP 200 — not a 404. Always check if records is empty.

Batch up to 20 lookups in one request

Use the multi-ID endpoint to batch lookups:

/api/volumes/brief/json/isbn:0140449264|oclc:228668653

Pipe-separated as type:value. Max 20 per request.

Identifier Types

TypeExampleNotes
isbn0140449264 or 9780140449266ISBN-10 or ISBN-13, digits only (+ trailing X)
oclc228668653OCLC number, digits only
lccn72081773URL-encode spaces; do not encode / (404)
issn03785955Digits only
htidmdp.39015058510069HathiTrust volume ID
recordnumber0005780509-digit HathiTrust record number

Response Structure

{
  "records": {
    "009058846": {
      "recordURL": "https://catalog.hathitrust.org/Record/009058846",
      "titles": ["The Odyssey / Homer ; translated by Robert Fagles."],
      "isbns": ["0140268863", "9780140268867"],
      "oclcs": ["34228839"],
      "lccns": ["96017900"],
      "publishDates": ["1997"]
    }
  },
  "items": [
    {
      "orig": "University of Michigan",
      "htid": "mdp.39015042182054",
      "itemURL": "https://babel.hathitrust.org/cgi/pt?id=mdp.39015042182054",
      "rightsCode": "ic",
      "usRightsString": "Limited (search-only)",
      "lastUpdate": "20240115",
      "enumcron": false
    }
  ]
}

Key fields:

  • rightsCode: the HathiTrust rights code. Open (full view) in the US: pd, pdus, ic-world, und-world, and all cc-* codes. pdus = public domain in the US only; readers outside the US cannot read it in full. Search only: ic, op, orph, orphcand, und, umall, nobody, pd-pvt, supp, and icus (in copyright in the US; open outside the US). Many pre-1929 Chinese books are pdus.
  • usRightsString: "Full view" (lowercase v in the live API) or "Limited (search-only)". It is for US readers. Compare it case-insensitively.
  • itemURL: Direct link to the HathiTrust page-turner viewer
  • enumcron: Volume/issue info (e.g., "vol. 3") or false

Python Script

Use scripts/hathitrust_api.py for programmatic access (zero dependencies):

from scripts.hathitrust_api import HathiTrustAPI
ht = HathiTrustAPI()

# Single lookup
record = ht.lookup_isbn("0140449264")

# Multiple identifiers at once
results = ht.batch_lookup([
    ("isbn", "0140449264"),
    ("oclc", "228668653"),
    ("lccn", "96017900"),
])

# Get full MARC-XML
record = ht.lookup_isbn("0140449264", full=True)
marc = ht.get_marc_xml(record)

# Check if digitized and readable in full
for item in ht.get_items(record):
    print(f"{item['orig']}: {item['rightsCode']} {item['usRightsString']} — {item['itemURL']}")
ht.has_full_view(record)            # True if any volume is full view for US readers
ht.get_full_view_url(record)        # link to the first full-view volume, or None
ht.has_full_view(record, us=False)  # for readers outside the US (pdus = no, icus = yes)

# Title in the original script (Chinese, Japanese, ...). The `titles` field is
# romanized only; the original script is in MARC field 880, so use full=True.
full = ht.lookup_oclc("34674216", full=True)
ht.get_original_title(full)   # '欽定四庫全書總目 : 二〇〇卷, 卷首四卷'

# Summarize
print(ht.summarize(record))

Typical Workflow: Cross-Reference with Other Catalogs

This example uses two skills. Both scripts folders must be on the Python path, for example (adjust the paths to where the skills are installed):

import sys
sys.path.insert(0, "path/to/harvard-library-catalog/scripts")
sys.path.insert(0, "path/to/hathitrust-catalog/scripts")

# 1. Search Harvard for a title
from harvard_api import HarvardLibraryAPI
harvard = HarvardLibraryAPI()
results = harvard.search(title="dream of the red chamber")
isbn = harvard.get_identifiers(results[0]).get("isbn")

# 2. Check HathiTrust for digital version
from hathitrust_api import HathiTrustAPI
ht = HathiTrustAPI()
record = ht.lookup_isbn(isbn)
if record and ht.has_full_view(record):
    print("Full text available:", ht.get_full_view_url(record))

API Etiquette

  • No authentication required
  • No documented rate limit, but the API is meant for small-batch lookups (not bulk harvesting)
  • Use HathiFiles or OAI-PMH for bulk data
  • CORS is fully enabled (access-control-allow-origin: *)

Related Skills

  • harvard-library-catalog: Search Harvard's catalog to find ISBNs/identifiers, then check HathiTrust for digital versions
  • wikidata-search: Cross-reference Wikidata identifiers (P243 = OCLC) with HathiTrust holdings

Resources

  • references/api_reference.md — Complete API spec with all identifier types and response fields
  • scripts/hathitrust_api.py — Python client with batch lookups, MARC extraction, and access checking

Feedback and Citation

Report a problem. This skill is part of the public repository kltng/humanities-skills. If it fails (an API changed, a script errors, or these instructions are wrong), report it as a GitHub issue:

  1. Ask the user before filing. Issues are public.
  2. Check for an existing report: gh issue list --repo kltng/humanities-skills --state all --search "hathitrust-catalog"
  3. File it: gh issue create --repo kltng/humanities-skills --label bug --title "[hathitrust-catalog] <short summary>" --body "<details>". Without gh, give the user this link: https://github.com/kltng/humanities-skills/issues/new?template=skill-problem.yml
  4. Include the skill name and version, what you ran, the error text, what you expected, and the environment (OS, Python version). Leave out API keys, personal data, private file paths, and unpublished research.

Cite. If this skill helped work that is published, please cite it, together with the data source it uses:

Tang, Kwok-leong. humanities-skills: hathitrust-catalog (version <version at the top of this file>). GitHub, <year>. https://github.com/kltng/humanities-skills

When you help a user write up results that relied on this skill, remind them once about this citation.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.