API Reference
Detailed documentation with code samples in JavaScript, Python, and curl.
Base URL
No authentication required. Rate limit: 100 requests per minute.
/api/v1/statutes
Search and filter U.S. federal and state statutes. Returns statute summaries with metadata.
Parameters
| Parameter | Type | Description |
|---|---|---|
jurisdiction | string | Jurisdiction ID or abbreviation |
topic | string | Topic keyword filter |
limit | number | Results per page (default: 20, max: 100) |
offset | number | Skip N results for pagination |
Code Samples
curl "https://megalawusa.com/api/v1/statutes?jurisdiction=federal&topic=civil-rights&limit=5"
const res = await fetch(
"https://megalawusa.com/api/v1/statutes?jurisdiction=federal&topic=civil-rights&limit=5"
);
const { data, meta } = await res.json();
console.log(`Found ${meta.total} statutes`);
data.forEach(s => {
console.log(`${s.sectionNumber} — ${s.title}`);
});import requests
res = requests.get(
"https://megalawusa.com/api/v1/statutes",
params={"jurisdiction": "federal", "topic": "civil-rights", "limit": 5}
)
data = res.json()
print(f"Found {data['meta']['total']} statutes")
for s in data["data"]:
print(f"{s['sectionNumber']} — {s['title']}")Example Response
{
"data": [
{
"id": "fed-cra-1964",
"jurisdiction": "United States Federal",
"jurisdictionId": "federal",
"title": "Civil Rights Act of 1964 – Title VII",
"titleNumber": "42",
"sectionNumber": "§ 2000e",
"status": "active",
"effectiveDate": "1964-07-02",
"topics": ["civil-rights", "labor"],
"summary": "Employers cannot discriminate..."
}
],
"meta": { "total": 12, "limit": 5, "offset": 0, "hasMore": true }
}/api/v1/cases
Search and filter U.S. court cases. Supports filtering by jurisdiction, topic, and court level.
Parameters
| Parameter | Type | Description |
|---|---|---|
jurisdiction | string | Jurisdiction ID or name |
topic | string | Topic keyword |
court | string | Court name or level |
limit | number | Results per page (default: 20, max: 100) |
offset | number | Skip N results |
Code Samples
curl "https://megalawusa.com/api/v1/cases?court=supreme&topic=civil-rights&limit=5"
const res = await fetch(
"https://megalawusa.com/api/v1/cases?court=supreme&topic=civil-rights&limit=5"
);
const { data, meta } = await res.json();
data.forEach(c => {
console.log(`${c.caseName} (${c.citation})`);
});import requests
res = requests.get(
"https://megalawusa.com/api/v1/cases",
params={"court": "supreme", "topic": "civil-rights", "limit": 5}
)
data = res.json()
for c in data["data"]:
print(f"{c['caseName']} ({c['citation']})")/api/v1/bills
Search and filter legislative bills. Supports filtering by status, chamber, jurisdiction, and topic.
Parameters
| Parameter | Type | Description |
|---|---|---|
jurisdiction | string | Jurisdiction ID or name |
topic | string | Topic keyword |
status | string | Bill status (in_committee, passed_chamber, signed) |
chamber | string | senate or house |
limit | number | Results per page (default: 20, max: 100) |
offset | number | Skip N results |
Code Samples
curl "https://megalawusa.com/api/v1/bills?jurisdiction=federal&status=in_committee&limit=5"
const res = await fetch(
"https://megalawusa.com/api/v1/bills?jurisdiction=federal&status=in_committee&limit=5"
);
const { data, meta } = await res.json();
data.forEach(b => {
console.log(`${b.billNumber}: ${b.title} [${b.status}]`);
});import requests
res = requests.get(
"https://megalawusa.com/api/v1/bills",
params={"jurisdiction": "federal", "status": "in_committee", "limit": 5}
)
data = res.json()
for b in data["data"]:
print(f"{b['billNumber']}: {b['title']} [{b['status']}]")/api/v1/jurisdictions
Returns all available jurisdictions including federal, 50 states, and territories. No parameters required.
Code Samples
curl "https://megalawusa.com/api/v1/jurisdictions"
const res = await fetch("https://megalawusa.com/api/v1/jurisdictions");
const { data } = await res.json();
// Get all state names
const states = data
.filter(j => j.level === "state")
.map(j => j.name);
console.log(states);import requests
res = requests.get("https://megalawusa.com/api/v1/jurisdictions")
data = res.json()
# Get all state names
states = [j["name"] for j in data["data"] if j["level"] == "state"]
print(states)Example Response
{
"data": [
{
"id": "federal",
"name": "United States Federal",
"abbreviation": "US",
"slug": "federal",
"level": "federal",
"capital": "Washington, D.C.",
"population": 331900000
},
{
"id": "california",
"name": "California",
"abbreviation": "CA",
"slug": "california",
"level": "state",
"capital": "Sacramento",
"population": 39538223
}
],
"meta": { "total": 56 }
}Pagination
All list endpoints support cursor-based pagination using limit and offset parameters. Check meta.hasMore to determine if more results are available.
// Fetch all statutes with pagination
async function fetchAllStatutes() {
let allData = [];
let offset = 0;
const limit = 100;
while (true) {
const res = await fetch(
`https://megalawusa.com/api/v1/statutes?limit=${limit}&offset=${offset}`
);
const { data, meta } = await res.json();
allData.push(...data);
if (!meta.hasMore) break;
offset += limit;
}
return allData;
}Error Handling
The API returns standard HTTP status codes. Successful requests return 200. Invalid parameters return 400. Rate-limited requests return 429.