Reference
Machine-readable: openapi.json (OpenAPI 3.1).
REST endpoints
| Endpoint | Parameters | Same as MCP tool |
|---|---|---|
GET /api/law/v1/search | q (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/section | doc_id (required), section | legal_get_section |
POST /api/law/v1/verify | JSON {"text": "…"}, max 20,000 characters | legal_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
| HTTP | code | When |
|---|---|---|
| 400 | bad_request | Missing or invalid parameters (e.g. a one-word query). Does not use up a call. |
| 401 | invalid_key | The key is revoked, mistyped or not a GetLawED key. |
| 404 | not_found | No such doc_id in the library. Does not use up a call. |
| 429 | quota_exceeded / RATE_LIMITED | Plan allowance used up (see Retry-After) / more than 60 requests a minute. |
| 500 | server_error | Try 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.
legal_library_search
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.
| Argument | Type | Required | Meaning |
|---|---|---|---|
query | string | yes | What to look for, in plain language (e.g. "business rescue post-commencement tax debt") |
doc_type | string judgment | act | regulation | bylaw | notice | bill | any | no | Limit to one kind of document: regulation = regulations, rules and codes; bylaw = municipal by-laws and land use schemes (default: judgment, act and regulation) |
limit | number | no | Maximum results, 1-10 (default 5) |
legal_get_section
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.
| Argument | Type | Required | Meaning |
|---|---|---|---|
doc_id | number | yes | doc_id from legal_library_search |
section | string | no | Section reference as returned (e.g. "Section 34: Structures") or a section number like "34"; optional for judgments |
legal_verify_citations
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".
| Argument | Type | Required | Meaning |
|---|---|---|---|
text | string | yes | The text containing citations (max 20 000 characters) |