API Reference
Use the MayaClerk API to search legal opinions and pull full opinion text from your own product.
The API searches the MayaClerk corpus: 10.6 million court opinions and 105 million indexed passages. You send JSON. MayaClerk returns JSON with ranked passages, case metadata, and links back to the opinion source.
Base URL
https://maya.scabievector.com
All endpoints use the /v1 prefix.
What you use it for
Use this API when your product needs legal search, legal AI grounding, contract review context, compliance research, or an internal research interface. The search endpoint returns passages from court opinions with citation metadata. The opinion endpoint returns full opinion text for a known opinion_id. MayaClerk is designed to integrate cleanly with modern AI applications, including Claude- and GPT-powered legal research assistants.
What it is not
This is not a bulk data dump and not permission to rebuild the MayaClerk corpus. You may use returned results in your app and as inference-time context. You may not use the API to train models, resell the data as a dataset, or reconstruct the corpus. See the API Terms of Use.
Authentication
Send your API key with every request. Use either header format:
X-API-Key: mk_live_xxxxxxxxxxxxxxxx
Authorization: Bearer mk_live_xxxxxxxxxxxxxxxx
Create keys in your developer dashboard. A new key is shown only once. Copy it when you create it. If you lose it, revoke it and create a new one.
Requests with no key, an invalid key, or a revoked key return 401.
Pricing & Billing
MayaClerk uses prepaid billing. There are no automatic charges.
Free monthly calls
Each developer account gets 100 free API calls each calendar month. The allowance resets on the first day of the month. Unused free calls do not roll over.
Wallet billing
After the free monthly calls are used, paid calls are deducted from your wallet balance.
| Call | Price |
|---|---|
POST /v1/search | $0.20 per call |
GET /v1/opinion/{id} | $0.20 per call |
GET /v1/pricing, GET /v1/health | Free |
Minimum wallet top-up is $25. Wallet funds do not expire. Unused balances may be refundable under the refund policy.
If your free calls are used up and your wallet balance is too low, the API returns 402. The request is not served and you are not charged.
Current rates are available at GET /v1/pricing.
Quickstart
Replace the example key with your own key.
curl
curl -X POST https://maya.scabievector.com/v1/search \
-H "Content-Type: application/json" \
-H "X-API-Key: mk_live_xxxxxxxxxxxxxxxx" \
-d '{"query": "eight corners rule extrinsic evidence duty to defend", "top_k": 20}'
Python
import requests
response = requests.post(
"https://maya.scabievector.com/v1/search",
headers={"X-API-Key": "mk_live_xxxxxxxxxxxxxxxx"},
json={
"query": "eight corners rule extrinsic evidence duty to defend",
"top_k": 20,
},
)
print(response.json())
A successful search returns 200, a results array, a total_results count, and timing information. Metered responses also include billing headers.
Building an application? See the Integration Guide.
Integration Guide
MayaClerk works with any application that can make HTTPS requests — including AI-powered assistants and research products built on Claude, GPT, or any other model.
Steps
- Create an API key in your developer dashboard.
- Call
POST /v1/searchwith a legal research query. You get back ranked passages with case and citation metadata. - When you need the full text of an opinion, call
GET /v1/opinion/{id}with theopinion_idfrom a search result.
That is the entire surface. How your application uses the results — display, analysis, model context, or anything else permitted by the API Terms of Use — is up to you.
Example: search integration
One request in, ranked results out. Python:
import requests
response = requests.post(
"https://maya.scabievector.com/v1/search",
headers={"X-API-Key": "mk_live_xxxxxxxxxxxxxxxx"}, # load from environment
json={
"query": "eight corners rule extrinsic evidence duty to defend",
"top_k": 10,
"jurisdiction": "S",
"court_ids": ["tex"],
},
)
data = response.json()
for r in data["results"]:
print(f'{r["case_name"]} — {r["court_name"]} ({r["date_filed"]})')
print(f' Cited by {r["citation_count"]} opinions')
print(f' {r["chunk_text"][:200]}...')
print(f' Full text: GET /v1/opinion/{r["opinion_id"]}')
Node.js:
const response = await fetch("https://maya.scabievector.com/v1/search", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": process.env.MAYACLERK_KEY,
},
body: JSON.stringify({
query: "eight corners rule extrinsic evidence duty to defend",
top_k: 10,
}),
});
const data = await response.json();
for (const r of data.results) {
console.log(`${r.case_name} — ${r.court_name} (${r.date_filed})`);
console.log(` Cited by ${r.citation_count} opinions`);
console.log(` ${r.chunk_text.slice(0, 200)}...`);
}
Each result includes the passage text, full case metadata, and an opinion_id you can pass to GET /v1/opinion/{id} when your application needs the complete opinion. Questions about advanced integration patterns: api@mayaclerk.com.
Guidelines
- Keep your API key server-side. Never expose credentials in browser code, mobile applications, prompts, screenshots, or public repositories.
- Use specific legal queries — doctrine, issue, jurisdiction, or key phrase. Vague queries return broader results.
- Preserve court and filing-date metadata when presenting results, and cite material legal claims to their sources.
- Your first 100 calls each month are free, so you can test your integration before funding a wallet.
Accuracy and governance
The MayaClerk API provides legal retrieval results, opinion text, and citation metadata. An external integration does not include MayaClerk's proprietary governance engine, production system prompts, validation procedures, or accuracy safeguards. The integrating developer is responsible for output validation and human review in their own application.
Permitted use
You may use returned results in your application and as inference-time context, subject to the API Terms of Use. The API may not be used to reconstruct the corpus, resell the data as a dataset, or train models unless separately authorized.
Search the MayaClerk opinion corpus. Returns ranked passages with case and citation metadata. This endpoint costs $0.20 per call after the free monthly allowance.
Use specific legal queries. Good queries include the doctrine, issue, jurisdiction, or key phrase you care about. Vague queries return broader results.
Request body
| Field | Type | Description |
|---|---|---|
query | string | Required. The search query. 1–2000 characters. |
top_k | integer | Number of results to return. Default 20. Range: 1–100. |
jurisdiction | string | Optional. F for federal opinions. S for state opinions. |
court_ids | string[] | Optional. Limit results to specific courts, such as ["scotus", "ca9"]. |
precedential_only | boolean | Optional. Return only precedential opinions. |
exclude_nonprecedential | boolean | Optional. Exclude non-precedential opinions. |
opinion_types | string[] | Optional. Filter by opinion type: majority, concurrence, or dissent. |
date_from | date | Optional. Start date for filing-date filtering. |
date_to | date | Optional. End date for filing-date filtering. |
case_name | string | Optional. Limit results by case-name substring. Max 512 characters. |
Example response
{
"query": "eight corners rule extrinsic evidence duty to defend",
"total_results": 20,
"results": [
{
"opinion_id": 1234567,
"cluster_id": 110589,
"case_name": "GuideOne Elite Insurance Co. v. Fielder Road Baptist Church",
"court_id": "tex",
"court_name": "Texas Supreme Court",
"jurisdiction": "S",
"date_filed": "2006-06-30",
"precedential_status": "Published",
"citation_count": 294,
"author": "Brister",
"chunk_text": "Under the eight-corners rule, the duty to defend is determined by the claims alleged in the petition and the coverage provided in the policy...",
"final_score": 0.469
}
],
"timing": {
"embed_ms": 12.4,
"search_ms": 839.0,
"total_ms": 851.4
}
}
Result fields
| Field | Type | Meaning |
|---|---|---|
opinion_id | integer | Opinion identifier. Use it with GET /v1/opinion/{id}. |
cluster_id | integer | Case cluster identifier. |
case_name | string | Case caption. |
court_id | string | Short court code, such as scotus, ca5, or tex. |
court_name | string | Full court name. |
jurisdiction | string | F for federal. S for state. |
date_filed | date | Opinion filing date. |
precedential_status | string | Published or other available status. |
citation_count | integer | Number of opinions citing this opinion. |
author | string | Authoring judge, where available. |
chunk_text | string | The matched passage. |
final_score | float | Relevance score used to rank results. Higher is more relevant. |
Return full text and metadata for one opinion. This endpoint costs $0.20 per call after the free monthly allowance.
Path parameter
| Parameter | Type | Description |
|---|---|---|
id | integer | Required. The opinion_id from a search result. |
Example
curl https://maya.scabievector.com/v1/opinion/118143 \
-H "X-API-Key: mk_live_xxxxxxxxxxxxxxxx"
Response fields
| Field | Type | Meaning |
|---|---|---|
opinion_id | integer | Opinion identifier. |
case_name | string | Case caption. |
court | string | Issuing court. |
date_filed | date | Filing date. |
citation | string | Reporter citation, where available. |
full_text | string | Full opinion text in the best available format. |
cluster | object | Case-level metadata, where available. |
Return the current rate card, free monthly allowance, and published limits. This endpoint is free and does not require authentication.
Example response
{
"model": "prepaid_wallet",
"free_monthly_calls": 100,
"rates": {
"search": {
"per_call_usd": 0.20,
"description": "Semantic search across 10.6M opinions"
},
"opinion": {
"per_call_usd": 0.20,
"description": "Full opinion text + metadata"
}
},
"free_allowance": "First 100 calls each month are free.",
"billing": "Beyond the free allowance, calls meter against your prepaid wallet. An exhausted balance returns HTTP 402 — you are never charged automatically.",
"limits": {
"opinion_fetch_daily_cap": 200
},
"signup": "https://mayaclerk.com/developer"
}
Basic health check. This endpoint is free and does not require authentication.
Response
{ "status": "ok" }
Limits
Daily opinion fetch cap
GET /v1/opinion/{id} has a daily cap of 200 unique opinions per account. Fetching the same opinion again on the same day does not count again. If you hit the cap, the API returns 429 and the request is not charged.
Caching
You may cache API responses for up to 24 hours for performance and cost control. Do not use caching to build a permanent copy of the corpus. See the API Terms of Use.
Error Codes
| Status | Meaning |
|---|---|
200 | Success. |
400 | Bad request. Example: missing or invalid query. |
401 | Missing, invalid, or revoked API key. |
402 | Free calls are used up and wallet balance is too low. Request not served and not charged. |
404 | Resource not found. Example: unknown opinion_id. |
429 | Daily unique-opinion fetch cap reached. Request not charged. |
500 | Server error. Safe to retry. |
Example error
{ "detail": "Free allowance exhausted and wallet balance insufficient. You are never charged automatically." }
Response Format
All responses are JSON. Successful responses return the documented body. Errors return a JSON object with a detail field.
Billing headers
Metered calls include billing context in the response headers:
| Header | Description |
|---|---|
X-MayaClerk-Billing | free if the call used your monthly allowance. wallet if it used wallet balance. |
X-MayaClerk-Free-Remaining | Free calls remaining this month. |
X-MayaClerk-Balance-USD | Wallet balance after the call. |
Versioning
The current stable API version is v1. Breaking changes will use a new version prefix. Additive changes, such as new optional fields or endpoints, may be added to v1. Your client should ignore unknown fields.
Questions: api@mayaclerk.com