Searches the National Library Board (NLB) Singapore catalog for books, audiovisual materials, and digital resources via the official Catalogue API. Retrieves bibliographic records, checks availability across branches, looks up titles by ISBN/BRN, and browses new arrivals or checkout trends.
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.
Native language fields for CJK content
Most text fields have native-language variants: title/nativeTitle, author/nativeAuthor, seriesTitle/nativeSeriesTitle. Always check both for Chinese, Malay, and Tamil titles.
Transaction status codes: S (on shelf), L (on loan), H (on hold), I (in transit), T (transferred).
Python Script
from scripts.nlb_api import NlbAPI
nlb = NlbAPI() # reads NLB_API_KEY and NLB_APP_CODE from env
# Keyword search (search() returns the full response dict;
# search_titles() returns just the list of title dicts)
data = nlb.search("singapore history", limit=10, languages=["Chinese"])
results = nlb.search_titles("singapore history", limit=10)
# Field-specific search (title, author, subject, isbn, keywords)
found = nlb.get_titles(title="dream of the red chamber", author="Cao")
# 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))
Library Branch Codes
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).
hathitrust-catalog: Use ISBNs from NLB to check HathiTrust for digitized versions
wikidata-search: Cross-reference NLB subjects with Wikidata entities
Resources
references/api_reference.md — Complete endpoint, parameter, and response field reference
scripts/nlb_api.py — Python client with search, lookup, availability checking, and pagination
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:
Ask the user before filing. Issues are public.
Check for an existing report: gh issue list --repo kltng/humanities-skills --state all --search "nlb-singapore"
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.
Credit the source. The data comes from the National Library Board, Singapore (NLB). NLB's open data is under the Singapore Open Data Licence, which requires "a conspicuous notice acknowledging the source of the datasets and including a link to the most recent version of this Licence". The licence gives this form:
Contains information from accessed on from which is made available under the terms of the Singapore Open Data Licence version 1.0 https://data.gov.sg/open-data-licence
Fill it in (for example "NLB Catalogue ... from the National Library Board, Singapore") and put it in anything you publish from this data. Digitized items in NLB's collections may carry their own rights; check each one.
Cite. If this skill helped work that is published, please cite it, together with the source credited above: