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 1d ago
get_book_details
search_books
2/2 passing latest checkself-healing
Endpoints
2
Updated
8d 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.

This call costs1 credit / call— charged only on success
Try it
Page number of search results (1-based)
Catalog index to search; omit to match the term against any field. Values outside the set are rejected before any request.
Search term to match in the catalog (keywords, a title, an author name, or a standard number such as an ISBN when combined with the matching field).
→ 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?query=Harry+Potter' \
  -H 'X-API-Key: $PARSE_API_KEY'
All endpoints · 2 totalmissing one? ·

Search the HKPL catalog. Returns paginated results (10 per page) with basic metadata per book: title, author, chamo_id, call number, publisher, and a Chinese-language availability summary showing which branches hold copies on-shelf. Pagination advances via the page parameter (1-based, defaults to the first page); total_results reflects the full hit set and is 0 when nothing matches. By default the query is matched against any field; the field parameter restricts it to one catalog index such as ISBN, title, or author, which is the reliable way to look up a standard number because the all-fields index may not match exact ISBNs. When the exact query matches nothing and the catalog instead offers a spelling suggestion, this endpoint does NOT return the suggestion's hits: books is empty, total_results is 0, and suggested_query carries the catalog's proposed alternative term so the caller can decide whether to re-search with it; otherwise suggested_query is null. One request per call.

Input
ParamTypeDescription
pageintegerPage number of search results (1-based)
fieldstringCatalog index to search; omit to match the term against any field. Values outside the set are rejected before any request.
queryrequiredstringSearch term to match in the catalog (keywords, a title, an author name, or a standard number such as an ISBN when combined with the matching field).
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; empty when nothing matched the exact query",
    "field": "string catalog index the search was run against (wire code of SearchField)",
    "total_results": "integer total number of hits for the query (0 when nothing matched)",
    "suggested_query": "string alternative term the catalog proposed when the exact query had no hits, otherwise null"
  },
  "sample": {
    "data": {
      "page": 1,
      "books": [
        {
          "title": "崖上の波妞 = Ponyo on the cliff by the sea / [宮崎駿原作 ; 林子傑, 張文俊譯].",
          "author": "宮崎駿 1941-",
          "chamo_id": "chamo:2926141",
          "publisher": "台北 : 台灣東販股份有限公司 ; 香港 : 萬里機構出版有限公司, 2009.",
          "call_number": "992.7 3027",
          "availability_summary": "在館內架上可供外借的數目:1804. 柴灣公共圖書館有 1 項在館內架上06. 大會堂公共圖書館有 1 項在館內架上"
        }
      ],
      "field": "isbn",
      "total_results": 1,
      "suggested_query": null
    },
    "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
1d 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/mo2005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 req/min
Team$300/mo20,000300 req/min
Company$1,000/mo100,000500 req/min

Each endpoint has a fixed posted price per successful call — most fall between 1 and 10 credits — shown on this API's page before you run it. 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.
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.
sb-augsburg.lmscloud.net API
Search the Stadtbücherei Augsburg library catalog to find books and check their real-time availability, including loan status and due dates. Instantly discover whether your desired titles are available to borrow or when they'll be returned to the shelves.
biblio.com API
Access data from biblio.com.
search.kongfz.com API
Search for used books on Kongfz by keyword or ISBN to discover available listings with pricing, condition ratings, and seller information. Find affordable secondhand books across thousands of sellers in China's largest used book marketplace.
qingheks.com API
Search and discover novels on Qinghe Book City by title or keyword, then browse chapter lists and read full chapter content directly. Access a comprehensive library of books with seamless navigation between chapters for uninterrupted reading.
gutenberg.org API
Search through thousands of free eBooks in the Project Gutenberg library by author name, book title, and subject matter to find exactly what you're looking for. Quickly discover classic literature and public domain works tailored to your interests.
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.