Examplecourt APIexamplecourt.gov ↗
Access Kenyan court judgments, case metadata, full ruling text, court listings, and document categories via 5 structured endpoints from the Kenya Law portal.
What is the Examplecourt API?
The Kenya Law API exposes 5 endpoints covering full-text search, paginated case listings, detailed judgment retrieval, court directory data, and document category facets from Kenya's national court reporting portal. Use search_cases to query judgments by keyword and date range, or get_case_details to retrieve the full text, judge names, case number, court station, and case action for any individual ruling.
curl -X GET 'https://api.parse.bot/scraper/0732f9fc-ccaf-461f-989e-ee9f37e6fbe2/search_cases?page=1&query=murder&date_to=2026-07-07&date_from=2024-07-07' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace examplecourt-gov-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: Kenya Law API — search cases, browse courts, get full judgments."""
from parse_apis.court_judgments_api import KenyaLaw, CaseNotFound
client = KenyaLaw()
# Search for murder cases, capped at 3 results
for case in client.cases.search(query="murder", limit=3):
print(case.title, case.date, case.court)
# Browse recent case summaries and drill into the first one
summary = client.casesummaries.list(limit=1).first()
if summary:
detail = summary.details()
print(detail.title, detail.judgment_date, detail.full_text[:200])
# List available courts
for court in client.courts.list(limit=5):
print(court.name, court.code)
# List document type categories with counts
for cat in client.categories.list(limit=3):
print(cat.name, cat.count)
# Fetch a specific case by URL with typed error handling
try:
specific = client.cases.get(url="/akn/ke/judgment/kehc/2023/22140/eng@2023-09-11")
print(specific.title, specific.court_station, specific.judges)
except CaseNotFound as exc:
print(f"Case not found: {exc}")
print("exercised: cases.search / casesummaries.list / details / courts.list / categories.list / cases.get")
Full-text search over Kenyan court judgments. Matches title and body text; results ordered by relevance score. Supports date-range filtering. Paginates server-side (10 results per page). When query is omitted, returns all judgments ordered by score.
| Param | Type | Description |
|---|---|---|
| page | integer | Page number for pagination. |
| query | string | Search keyword or phrase (e.g. 'murder', 'land dispute'). If omitted, returns all judgments. |
| date_to | string | Filter cases up to this date in YYYY-MM-DD format. |
| date_from | string | Filter cases from this date in YYYY-MM-DD format. |
{
"type": "object",
"fields": {
"page": "integer current page number",
"total": "integer total number of matching cases",
"results": "array of case objects with title, url, date, court, citation, case_number, judges, and registry"
},
"sample": {
"data": {
"page": 1,
"total": 10000,
"results": [
{
"url": "https://new.kenyalaw.org/akn/ke/judgment/kehc/2023/26701/eng@2023-12-21",
"date": "2023-12-21",
"court": "High Court",
"title": "Republic v Loriu (Murder Case 32 of 2017) [2023] KEHC 26701 (KLR) (21 December 2023) (Judgment)",
"judges": [
"CM Kariuki"
],
"citation": "Republic v Loriu [2023] KEHC 26701 (KLR)",
"registry": "High Court at Nyahururu",
"case_number": [
"Murder Case 32 of 2017"
]
}
]
},
"status": "success"
}
}About the Examplecourt API
Case Search and Listing
The search_cases endpoint accepts a query string (e.g. 'land dispute', 'murder') and optional date_from / date_to parameters in YYYY-MM-DD format. Results are ordered by relevance score and paginate server-side at 10 per page. Each result includes title, url, date, court, citation, case_number, judges, and registry. When query is omitted, the endpoint returns all judgments ordered by score. The list_cases endpoint returns the 20 most recent judgments per page without any filtering — useful for monitoring new filings.
Case Details
get_case_details takes a url path obtained from search_cases or list_cases and returns the complete record for a single judgment: full_text of the ruling, court, title, judges, case_number, court_station, language, type, and case_action (values include Ruling, Judgment, and similar). Fields that the source does not populate are returned as null. This is the primary endpoint for extracting the actual legal reasoning and outcome of a case.
Courts and Document Categories
list_courts returns two arrays: courts (each with name, code, and url) and court_classes (each with name, slug, and url). Court classes group courts into tiers such as Superior Courts, Subordinate Courts, and Tribunals. list_case_categories returns categories (document types like Judgment, Gazette, Bill, each with a count and type field) and courts with per-court case counts drawn from search facets — useful for understanding the distribution of documents across the portal before issuing targeted queries.
The Examplecourt API is a managed, monitored endpoint for examplecourt.gov — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when examplecourt.gov changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official examplecourt.gov API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a legal research tool that lets lawyers search Kenyan precedent by keyword and filter results to a specific date range using
search_cases. - Monitor new court filings daily by polling
list_casesand alerting when cases matching certain titles appear. - Extract the full text of rulings via
get_case_detailsto feed into NLP pipelines for legal summarization or classification. - Map the Kenyan court hierarchy by consuming
list_courtscourt classes and codes for directory or reference applications. - Analyze document-type distribution across the portal using the
countfields returned bylist_case_categories. - Aggregate citations and registries from
search_casesresults to study which courts produce the most judgment activity in a given period. - Cross-reference judge names from
get_case_detailsresponses to build profiles of judicial output over time.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Kenya Law have an official developer API?+
What does `get_case_details` return beyond basic metadata?+
get_case_details returns the complete full_text of the ruling alongside structured fields: court, judges, case_number, court_station, language, type, case_action (e.g. Ruling or Judgment), and the canonical url. Fields not populated by the source return null rather than being omitted.Can I filter `search_cases` results by a specific court or judge?+
search_cases endpoint currently supports filtering by query, date_from, and date_to only. Court-level and judge-level filtering are not available as dedicated parameters. You can fork this API on Parse and revise it to add court or judge filter parameters if needed.Does `list_cases` return the full judgment text, or just titles?+
list_cases returns only title and url per case — it is a lightweight index endpoint. To get the full text, ruling metadata, and judge information, pass the returned url to get_case_details.Are tribunal decisions and gazette documents covered, not just court judgments?+
list_case_categories endpoint exposes document type categories including Gazette and Bill entries in addition to Judgments, indicating the portal indexes multiple document types. However, the current endpoints are optimized around court judgments; dedicated filtering or listing by non-judgment document type is not built in. You can fork the API on Parse and revise it to add endpoints scoped to specific document categories.