Skip to main content
All errors are returned as JSON with a consistent envelope:
Always switch on error.code, never on error.message.

Error codes

400 Bad Request

401 Unauthorized

404 Not Found

429 Too Many Requests

500 Internal Server Error

Retry strategy

A simple, well-behaved retry loop:

Common pitfalls

The most common cause is the wrong identifier format. Check:
  • Did you URL-encode square brackets in a neutral citation? [2023] HKCFA 5 must be sent as %5B2023%5D%20HKCFA%205.
  • Did you URL-encode the slash in an action number? FACV 5/2022 must be sent as FACV%205%2F2022. The space is optional — FACV5%2F2022 resolves to the same case.
  • Is the case ID in canonical form? Case IDs are COURT_YEAR_NUM (e.g. HKCFA_2023_5). Anything with extra trailing segments will not match.
See Identifiers.
Boolean operators must be uppercase with whitespace around them. tort and breach searches for the literal words tort, and, breach. tort AND breach is a boolean query. See Search syntax.
The limit is per API key, not per IP. If you have multiple processes sharing the same key (e.g. a worker pool), they share the budget. Issue separate keys per worker if you need to parallelise.
Try in this order:
  1. Drop court / date filters and search the whole corpus.
  2. Switch from a phrase ("...") to a plain match query.
  3. If the case name is uncommon, try scope=case_name (fuzzy match enabled).
  4. Check start / end — dates outside the corpus return 0.

Daily summary errors

Daily also uses invalid_date, invalid_int, invalid_range and invalid_identifier, plus the shared authentication and rate-limit errors. See Daily summaries for exact date semantics.