Discover/Gov API
live

Gov APIwebcat.hkpl.gov.hk

Search the HKPL catalog and retrieve real-time book availability, bibliographic details, and per-branch holdings across Hong Kong's public library system.

Endpoint health
verified 4d ago
search_books
get_book_details
2/2 passing latest checkself-healing
Endpoints
2
Updated
26d ago

What is the Gov API?

This API provides 2 endpoints for querying the Hong Kong Public Libraries catalog, returning book metadata and live branch-level availability. Use search_books to find titles by keyword with paginated results including author, call number, and availability summary, or use get_book_details to pull full bibliographic fields and holdings across every HKPL branch for a specific title.

Try it
Page number of search results (1-based)
Search keyword to find books in the catalog
api.parse.bot/scraper/983d33d9-e887-4aed-994c-ae7876761f37/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Call it over HTTPgrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/983d33d9-e887-4aed-994c-ae7876761f37/search_books?page=1&query=Harry+Potter' \
  -H 'X-API-Key: $PARSE_API_KEY'
Python SDK · recommended

Typed, relational, agent-ready

A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.

  • Fully typed · autocompletes
  • Objects link to objects
  • Typed errors & pagination

Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:

uv add parse-sdk
uv run parse init
uv run parse add --marketplace webcat-hkpl-gov-hk-api

uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.


from parse_apis.hong_kong_public_libraries_hkpl_api import HKPL, Book, BookSummary, Holding

client = HKPL()

# Search for books about Harry Potter
for summary in client.booksummaries.search(query="Harry Potter", limit=5):
    print(summary.title, summary.author, summary.chamo_id)

# Get full details for the first result
book = summary.details()
print(book.title, book.call_number)

# Explore holdings across library branches
for holding in book.holdings:
    print(holding.location, holding.status, holding.collection)
All endpoints · 2 totalmissing one? ·

Search the HKPL catalog by keyword. Returns paginated results (10 per page) with basic metadata per book: title, author, call number, publisher, and a Chinese-language availability summary showing which branches hold copies on-shelf. Pagination advances via the page parameter. The total_results count reflects the full hit set.

Input
ParamTypeDescription
pageintegerPage number of search results (1-based)
queryrequiredstringSearch keyword to find books in the catalog
Response
{
  "type": "object",
  "fields": {
    "page": "integer current page number",
    "books": "array of book objects with title, author, chamo_id, call_number, publisher, and availability_summary",
    "total_results": "integer total number of matching results"
  },
  "sample": {
    "data": {
      "page": 1,
      "books": [
        {
          "title": "Harry Potter : cinematic guide / [by Felicity Baker].",
          "author": "Baker, Felicity",
          "chamo_id": "chamo:3460423",
          "publisher": "London : Scholastic Ltd., 2016.",
          "call_number": "791.4375 BAK",
          "availability_summary": "在館內架上可供外借的數目:2"
        }
      ],
      "total_results": 430
    },
    "status": "success"
  }
}

About the Gov API

Search the HKPL Catalog

The search_books endpoint accepts a query string and an optional page integer, returning an array of book objects alongside a total_results count. Each book in the results includes title, author, chamo_id, call_number, publisher, and an availability_summary — enough context to identify a title and assess whether it's worth drilling into. Pagination is handled through the page parameter, so you can walk through large result sets systematically.

Per-Branch Holdings and Bibliographic Detail

Once you have a chamo_id (formatted as chamo:<numeric_id>, e.g. chamo:3460417), pass it to get_book_details to retrieve the full record. The response includes a details object of key-value bibliographic fields (edition, language, subject headings, ISBN, and others as cataloged), plus a holdings array. Each holding entry specifies the branch location, call_number, status (e.g. available, on loan, reserved), and collection type. This makes it straightforward to check whether a specific branch currently has a copy on the shelf.

Identifiers and Cross-Referencing

The chamo_id is the internal HKPL catalog identifier and is returned in every search_books result, making it easy to chain the two endpoints. Search by keyword, collect chamo_id values from the results, then fetch granular holdings for each title of interest. The call_number field appears at both the record level and within individual holdings, which can differ if copies are shelved in specialized collections.

Reliability & maintenanceVerified

The Gov API is a managed, monitored endpoint for webcat.hkpl.gov.hk — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when webcat.hkpl.gov.hk changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.

This isn't an official webcat.hkpl.gov.hk API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.

Last verified
4d ago
Latest check
2/2 endpoints passing
Maintenance
Monitored & self-healing
Will this API break when the source site changes?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • Check real-time branch availability for a reading list before visiting a specific HKPL library
  • Build a catalog search tool that surfaces Hong Kong library holdings alongside commercial book data
  • Track which branches hold copies of a title using the per-holding location and status fields
  • Aggregate bibliographic metadata (publisher, call number, subject fields) for a corpus of titles held by HKPL
  • Monitor availability changes for high-demand titles by polling get_book_details holdings over time
  • Filter search results by call_number prefix to explore titles within a specific Dewey classification range
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 req/min

One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.

Frequently asked questions
Does the Hong Kong Public Libraries system offer an official developer API?+
HKPL does not publish a documented public developer API. The catalog is accessible through the web interface at webcat.hkpl.gov.hk, but no official API with documented endpoints, authentication, or versioning is offered to external developers.
What does the `holdings` array in `get_book_details` actually tell me?+
Each object in holdings contains four fields: location (the branch name), call_number (as shelved at that branch), status (current loan or availability state), and collection (the sub-collection within that branch, such as adult lending or reference). If a title has copies at multiple branches, each copy appears as a separate entry, so a single book record can produce many holding rows.
Can I search by ISBN, author name, or title specifically, rather than a general keyword?+
The search_books endpoint takes a single query string with no dedicated field filters — there is no separate isbn, author, or title parameter. You can pass an ISBN or author name as the query string and the catalog will return matching results, but field-specific scoping is not exposed. You can fork this API on Parse and revise it to add a field-type filter parameter if your use case requires it.
Does the API cover eBook or digital resource holdings?+
The current endpoints return holdings for physical copies, with location, call_number, status, and collection fields oriented toward branch-shelved items. Digital or eBook records that HKPL may catalog are not currently distinguished as a separate resource type in the response. You can fork this API on Parse and revise it to add an endpoint that filters or flags digital-format holdings.
How should I handle pagination when iterating through large search result sets?+
The search_books response includes a total_results integer and a page integer indicating the current page. Increment the page parameter on successive requests to walk through results. There is no explicit per_page field in the response, so you will need to observe the size of the returned books array on the first request to infer page size before calculating the number of pages needed.
Page content last updated . Spec covers 2 endpoints from webcat.hkpl.gov.hk.
Related APIs in EducationSee all →
worldcat.org API
Search millions of books and library materials worldwide, check availability at libraries near you, and discover reading lists and reviews all in one place. Find exactly what you're looking for across global library collections and get instant insights into where to access it.
librarything.com API
Search millions of books and retrieve detailed metadata, reviews, and author information from LibraryThing's vast catalog. Access member libraries, trending titles, author works, and tag-based book collections to explore one of the web's largest book cataloging communities.
bookshop.org API
Search for books by keyword or category, view detailed information like metadata and pricing, discover curated reading lists, and find independent bookstores near you on Bookshop.org. Filter results by format and browse new releases to discover your next read.
bookwalker.jp API
Search and browse Japanese ebooks including manga and light novels on BookWalker Japan, with access to book details, rankings, category listings, and autocomplete suggestions. Discover new titles through curated rankings and explore the full catalog by category.
booksrun.com API
Search millions of books and get instant buyback quotes on BooksRun. Browse bestsellers and categories, view detailed book information, and check condition guidelines to understand buyback prices and acceptance criteria.
wiley.com API
Search Wiley for books by keyword and locale, list available editions and formats for any title, and fetch detailed book metadata such as ISBN and page count from a product page.
shamela.ws API
Search and browse one of the largest collections of Arabic and Islamic books, exploring thousands of titles by category, author, or full-text content. Access detailed book information, read specific pages, and discover newly added works to build your digital Islamic library.
noor-book.com API
Search and discover books across 1,800+ categories in the Noor Book library, retrieving detailed information about titles, authors, biographies, and book metadata. Access comprehensive author profiles and browse one of the largest Arabic and English digital book collections with over 289,000 authors.