nlb-singapore/SKILL.md
Search the National Library Board (NLB) Singapore catalog for books, audiovisual materials, and digital resources via the official Catalogue API. Use this skill whenever the user wants to search Singapore's national library holdings, check book availability across NLB branches, look up titles by ISBN/BRN, find new arrivals, browse checkout trends, or retrieve detailed bibliographic records from NLB. Triggers when referencing Singapore library collections, Southeast Asian library holdings, or NLB resources.
npx skillsauth add kltng/humanities-skills nlb-singaporeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Search and retrieve bibliographic records from Singapore's National Library Board catalog.
The NLB API requires both an API key and an app code:
X-API-KEY: your-api-key
X-APP-Code: your-app-code
Without these, all endpoints return 401. Apply for free keys at https://go.gov.sg/nlblabs-form (contact: [email protected]).
Set environment variables NLB_API_KEY and NLB_APP_CODE, or pass them to the Python client constructor.
| Endpoint | Best for | Returns |
|----------|----------|---------|
| SearchTitles | Keyword search with facets and filters | Title summaries + facets |
| GetTitles | Field-specific search (title, author, subject, ISBN) | Full title records |
SearchTitles: ?Keywords=singapore+history&Limit=10
GetTitles: ?Title=singapore&Author=lee&Limit=10
BRN (Bibliographic Record Number) is NLB's internal ID. Use it for GetTitleDetails and GetAvailabilityInfo lookups. Found in search results under records[].brn or brn.
Most text fields have native-language variants: title/nativeTitle, author/nativeAuthor, seriesTitle/nativeSeriesTitle. Always check both for Chinese, Malay, and Tamil titles.
| Endpoint | Purpose |
|----------|---------|
| GET /SearchTitles | Keyword search with facets and filters |
| GET /GetTitles | Field-specific search (title, author, subject, ISBN) |
| GET /GetTitleDetails | Full record by BRN or ISBN |
| GET /GetAvailabilityInfo | Check availability across branches |
| GET /GetNewTitles | Browse new arrivals |
| GET /GetMostCheckoutsTrendsTitles | Checkout trends by branch |
| Param | Description | Example |
|-------|-------------|---------|
| Keywords | Search keywords (required) | Keywords=singapore+history |
| Limit | Results per page (default 20, max 100) | Limit=20 |
| Offset | Pagination offset | Offset=20 |
| MaterialTypes | Filter by material type | MaterialTypes=BOOK |
| Languages | Filter by language | Languages=Chinese |
| Locations | Filter by library branch | Locations=TRL |
| DateFrom / DateTo | Publication year range | DateFrom=2020&DateTo=2025 |
| Availability | Only available items | Availability=true |
| Fiction | Fiction filter | Fiction=true |
| Param | Description |
|-------|-------------|
| Keywords | General keywords |
| Title | Title-specific search |
| Author | Author-specific search |
| Subject | Subject-specific search |
| ISBN | ISBN lookup |
| Limit / Offset | Pagination |
{
"totalRecords": 999,
"count": 20,
"hasMoreRecords": true,
"nextRecordsOffset": 20,
"titles": [
{
"title": "Singapore: A Biography",
"nativeTitle": "",
"author": "Frost, Mark Ravinder",
"nativeAuthor": "",
"records": [
{
"brn": 13737742,
"isbns": ["9789814385169"],
"publisher": ["Editions Didier Millet"],
"publishDate": "2009",
"subjects": ["Singapore -- History"],
"format": {"code": "BK", "name": "Books"}
}
]
}
],
"facets": [...]
}
Full records include 50+ fields: brn, title, nativeTitle, author, nativeAuthor, publisher, publishDate, isbns, subjects, summary, contents, edition, physicalDescription, language, format, allowReservation, availability, activeReservationsCount.
{
"items": [
{
"brn": 13737742,
"callNumber": "959.57 FRO",
"location": {"code": "TRL", "name": "Lee Kong Chian Reference Library"},
"transactionStatus": {"code": "S", "name": "Available on Shelf"},
"media": {"code": "BOOK", "name": "Book"}
}
]
}
Transaction status codes: S (on shelf), L (on loan), H (on hold), I (in transit), T (transferred).
from scripts.nlb_api import NlbAPI
nlb = NlbAPI() # reads NLB_API_KEY and NLB_APP_CODE from env
# Keyword search
results = nlb.search("singapore history", limit=10)
# Field-specific search
results = nlb.get_titles(title="dream of the red chamber", language="Chinese")
# Title details by BRN
detail = nlb.get_title_details(brn=13737742)
# Check availability
avail = nlb.get_availability(brn=13737742)
for item in avail:
print(f"{item['location']['name']}: {item['transactionStatus']['name']}")
# New arrivals
new = nlb.get_new_titles(date_range="Weekly", limit=20)
# Summarize
for r in results:
print(nlb.summarize(r))
Key locations: TRL (Lee Kong Chian Reference Library), WRL (Woodlands Regional Library), CMPL (Chinatown Public Library), AMKPL (Ang Mo Kio), BIPL (Bishan), JWPL (Jurong West), TPPL (Tampines).
references/api_reference.md — Complete endpoint, parameter, and response field referencescripts/nlb_api.py — Python client with search, lookup, availability checking, and paginationdevelopment
Query the China Biographical Database (CBDB) locally via SQLite for biographical data on 656K+ historical Chinese figures from the 7th century BCE through the 19th century CE. Use when searching for Chinese historical figures, scholars, officials, or literary figures — their biographical details, family/kinship networks, official postings, social associations, examination records, or addresses. Runs entirely locally after initial database download (~556 MB). Faster and more flexible than the API version.
development
Interact with a local Zotero 8 desktop application through its HTTP API at localhost:23119. Use this skill whenever the user wants to search, fetch, add, edit, or organize bibliographic items in their Zotero library, import citations (BibTeX, RIS, etc.), attach files, manage collections and tags, or retrieve full-text content from Zotero. Triggers on mentions of Zotero, citation management, reference libraries, bibliographic databases, or local library management. Also use when chaining with other catalog skills (Harvard, LOC, HathiTrust, etc.) to save found records into the user's Zotero library.
development
Search for items and properties on Wikidata and retrieve entity details, claims, and external identifiers. Supports both keyword search (Wikidata Action API) and semantic/hybrid search (Wikidata Vector Database), plus direct entity retrieval (Special:EntityData) and structured querying (WDQS SPARQL).
testing
Query and explore the TGAZ (Temporal Gazetteer) SQLite database of 82,000+ historical Chinese placenames spanning 763 BCE to 1911 CE. Use this skill whenever the user asks about historical Chinese places, administrative geography, dynastic jurisdictions, place name evolution, or wants to query tgaz.db. Also trigger when the user mentions CHGIS, TGAZ, historical gazetteer, Chinese historical GIS, or asks questions like "what was X called in dynasty Y", "what counties existed in year Z", "where was X located", or any spatial/temporal query about Chinese historical geography. This skill is relevant even for casual questions like "tell me about ancient Chang'an" or "Tang dynasty cities near the Yellow River".