GetLawED
Law library › Developers › Reference

Reference

Machine-readable: openapi.json (OpenAPI 3.1).

REST endpoints

EndpointParametersSame as MCP tool
GET /api/law/v1/searchq (required), type = judgment | act | regulation | bylaw | notice | bill | any (default any), limit 1–10 (default 5)legal_library_search (query, doc_type, limit)
GET /api/law/v1/sectiondoc_id (required), sectionlegal_get_section
POST /api/law/v1/verifyJSON {"text": "…"}, max 20,000 characterslegal_verify_citations

Responses are JSON: the tool's structured data plus source_note (attribution and reliance note). Search results carry doc_id, type, title, section, citation, case_number, court, date, act, gazette, url, excerpt (fields that do not apply are left out). Note: on MCP, doc_type defaults to judgments, Acts and regulations; on REST, type defaults to any.

Errors

HTTPcodeWhen
400bad_requestMissing or invalid parameters (e.g. a one-word query). Does not use up a call.
401invalid_keyThe key is revoked, mistyped or not a GetLawED key.
404not_foundNo such doc_id in the library. Does not use up a call.
429quota_exceeded / RATE_LIMITEDPlan allowance used up (see Retry-After) / more than 60 requests a minute.
500server_errorTry again shortly.

CORS: any origin may call the REST endpoints (no cookies are used). Keep keys server-side; browser apps can use the free tier without a key.

MCP tools

Server https://getlawed.co.za/api/mcp/law — protocol versions 2025-06-18, 2025-03-26 and 2024-11-05. All tools are read-only.

Search GetLawED's library of official South African legal texts (Constitutional Court, SCA, High Court, Labour, Land, Tax and tribunal judgments; Acts; regulations, rules and codes issued under them; municipal by-laws and land use schemes; Bills; Government Gazettes). Returns matching documents with the best-matching section reference where the text is split into sections, a short passage and the official source link. Absence from the library does not mean an authority does not exist.

ArgumentTypeRequiredMeaning
querystringyesWhat to look for, in plain language (e.g. "business rescue post-commencement tax debt")
doc_typestring
judgment | act | regulation | bylaw | notice | bill | any
noLimit to one kind of document: regulation = regulations, rules and codes; bylaw = municipal by-laws and land use schemes (default: judgment, act and regulation)
limitnumbernoMaximum results, 1-10 (default 5)

Full text of one document section from the GetLawED library — use it to read and quote the exact provision found by legal_library_search (give the doc_id and the section reference it returned). For judgments, returns the judgment text (or the part matching "section", e.g. a paragraph number or phrase), capped at 12 000 characters.

ArgumentTypeRequiredMeaning
doc_idnumberyesdoc_id from legal_library_search
sectionstringnoSection reference as returned (e.g. "Section 34: Structures") or a section number like "34"; optional for judgments

Check the South African case citations and Acts in a piece of text against GetLawED's library of official copies and verified records. Each item comes back as found, mismatch (the citation belongs to a different case), name_only, not_found, repealed or unchecked. "not_found"/"unchecked" means "check the law reports", not "fake".

ArgumentTypeRequiredMeaning
textstringyesThe text containing citations (max 20 000 characters)
Using an AI assistant? Connect it to GetLawED's verified South African law library — it can then quote provisions with their official source and check citations before you rely on them. How to connect