GetLawED
Law library › Developers › Quick start

Quick start

1. Get a key (optional)

Without a key you get 25 searches and 50 citation checks a day per IP address. For your own allowance, sign up for a free key at getlawed.co.za/law/access.html — it starts with glw_. Keep it on your server, not in browser code.

export GETLAWED_KEY=glw_your_key_here

2. REST

Search:

curl -s "https://getlawed.co.za/api/law/v1/search?q=unfair+dismissal+reinstatement&type=act&limit=3" \
  -H "Authorization: Bearer $GETLAWED_KEY"

Read the exact section a result points to (doc_id and section come from the search result):

curl -s "https://getlawed.co.za/api/law/v1/section?doc_id=50657&section=193" \
  -H "Authorization: Bearer $GETLAWED_KEY"

Check citations in a piece of text:

curl -s -X POST https://getlawed.co.za/api/law/v1/verify \
  -H "Authorization: Bearer $GETLAWED_KEY" -H "Content-Type: application/json" \
  -d '{"text": "See S v Makwanyane and Another 1995 (3) SA 391 (CC) and the Labour Relations Act 66 of 1995."}'

Without a key (free tier):

curl -s "https://getlawed.co.za/api/law/v1/search?q=heritage+permit+older+than+60+years&limit=2"

3. MCP

The MCP server speaks JSON-RPC 2.0 over Streamable HTTP (POST; responses are plain JSON, no SSE stream). Initialize, list the tools, call one:

curl -s https://getlawed.co.za/api/mcp/law -H "Content-Type: application/json" -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"my-app","version":"1.0"}}}'
curl -s https://getlawed.co.za/api/mcp/law -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
curl -s https://getlawed.co.za/api/mcp/law -H "Content-Type: application/json" -H "Authorization: Bearer $GETLAWED_KEY" \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"legal_verify_citations","arguments":{"text":"S v Makwanyane and Another 1995 (3) SA 391 (CC)"}}}'

In practice your MCP client does this for you — see code samples and OpenAI & Anthropic APIs.

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