快速开始
Lambert Planning Caselaw API(Lambert 策划 判例数据服务)提供近期美国法院判例的检索与全文读取。数据持续同步自 CourtListener、GovInfo(USCOURTS)与各法院官网原件 PDF,存放在本服务的本地库中,本地查询不消耗任何上游额度。
- 基础地址:
https://caselaw.sunlawai.com/v1(下文以$BASE表示) - 交互式接口参考:/redoc、/docs(Swagger)、/openapi.json
1. 获取 API Key
Key 由服务管理员签发,格式形如 lpc_xxxxxxxx...,仅在创建时显示一次。请向管理员申请,并妥善保管(不要提交到代码库、不要放在前端页面中)。
2. 第一个请求
先检查服务状态(无需 key):
curl "$BASE/health"
再取最新的两条判例:
curl -H "X-API-Key: $LAMBERT_API_KEY" "$BASE/opinions/recent?limit=2"
Python:
import os, httpx
BASE = os.environ["LAMBERT_BASE"] # 例如 https://example.com/v1
r = httpx.get(f"{BASE}/opinions/recent", params={"limit": 2},
headers={"X-API-Key": os.environ["LAMBERT_API_KEY"]})
r.raise_for_status()
for op in r.json()["items"]:
print(op["date_filed"], op["court_name"], op["case_name"])
JavaScript(Node 18+ / 浏览器后端):
const r = await fetch(`${process.env.LAMBERT_BASE}/opinions/recent?limit=2`, {
headers: { "X-API-Key": process.env.LAMBERT_API_KEY },
});
if (!r.ok) throw new Error(JSON.stringify(await r.json()));
const { items } = await r.json();
items.forEach(o => console.log(o.date_filed, o.court_name, o.case_name));
3. 常见用法
| 目的 | 调用 |
|---|---|
| 浏览最新判例 | GET /opinions/recent(用 next_cursor 翻页) |
| 关键词全文检索(免费) | GET /search?q=negligence |
| 读取一篇全文 | GET /opinions/cl:11499595?include_text=true |
| 校验文书中的引注 | POST /citations/verify(消耗 1 次上游额度) |