Emerald API

Start with a search.

Emerald gives you access to Kenyan judgments through a REST API. You can also connect the same case database to an MCP client.

Authentication

Send your Emerald key in the X-API-Key header.

X-API-Key: em_live_...

The base URL is https://emerald.up.railway.app.

Search cases

GET /v1/search

Search the text and metadata of cases already fetched into Emerald.

Example
curl "https://emerald.up.railway.app/v1/search?q=adverse+possession&document_type=judgment&limit=10" \
  -H "X-API-Key: em_live_..."
ParameterWhat it does
qWords, a phrase, party name or citation to search for.
courtFilter by court code, for example KECA.
date_fromOnly return judgments on or after this date.
date_toOnly return judgments on or before this date.
limitNumber of results to return. Maximum: 100.
offsetSkip results when paginating.

Read a case

Search results include a document ID. Use it to fetch the case record or its text.

GET /v1/documents/{id}Case title, citation, court, date, source URL and hashes.
GET /v1/documents/{id}/search-textPlain text used by Emerald for search and retrieval.
GET /v1/documents/{id}/contentThe stored legal-body HTML.
GET /v1/documents/{id}/content-urlA short-lived signed URL for the stored body artifact.

Find a case by citation

GET /v1/citations/resolve
curl --get "https://emerald.up.railway.app/v1/citations/resolve" \
  --data-urlencode "citation=[2025] KEHC 19140 (KLR)" \
  -H "X-API-Key: em_live_..."

New and updated cases

GET /v1/updates

Use an ISO timestamp in since. This is useful when you keep your own local index or cache.

curl "https://emerald.up.railway.app/v1/updates?since=2026-08-18T00:00:00Z" \
  -H "X-API-Key: em_live_..."

MCP

Use https://emerald.up.railway.app/mcp/ as the remote server URL. Authenticate with your Emerald key as a Bearer token.

Authorization: Bearer em_live_...

The server exposes tools for judgments, statutes, citation lookup and recent cases.

search_casesSearch the fetched judgment corpus.
search_statutesSearch fetched statutes.
get_caseReturn details for one selected case.
get_case_textRead the judgment in bounded chunks.
resolve_citationLook up an exact citation.
recent_casesSee cases recently added or refreshed.

Errors and limits

401The API key is missing or invalid.
404The requested case or stored content is not available.
429The account has reached its current usage or rate limit.

Search returns at most 100 results per request.