> ## Documentation Index
> Fetch the complete documentation index at: https://vaquill.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# US case law

> Make your first case law call, and see every endpoint for decisions, opinions, courts, judges and dockets

Search US court decisions, read opinions and follow citations.
For totals and court codes, see [Case law coverage](https://vaquill.ai/docs/api-guide/coverage/case-law.md).

A **case** is one decision. It can have several **opinions**, such as a majority and a dissent.

## Quickstart

Look up a citation, read the opinion, then list the cases that cite it.
The three calls cost 9 credits (\$0.09). You need an [API key](https://vaquill.ai/docs/api-guide/authentication.md).

```python Python theme={"theme":"github-light"}
import os
import requests

API = "https://api.vaquill.ai/api/v1/us"
HEADERS = {"Authorization": f"Bearer {os.environ['VAQUILL_API_KEY']}"}


def call(method, path, **kwargs):
    resp = requests.request(method, f"{API}{path}", headers=HEADERS, timeout=60, **kwargs)
    resp.raise_for_status()
    return resp.json()


# 1. Citation to case (2 credits)
found = call("POST", "/cases/resolve", json={"citations": ["347 F.3d 1000"]})["results"][0]
if found["status"] != "resolved":
    raise SystemExit(found["status"])
case = found["case"]

# 2. Main opinion (6 credits)
if case["leadOpinionId"]:
    opinion = call("GET", f"/opinions/{case['leadOpinionId']}", params={"format": "text"})
    print(opinion["body"][:500])

# 3. Cases that cite it (1 credit)
citing = call("GET", f"/cases/{case['caseId']}/citations", params={"limit": 5})
for row in citing["results"]:
    print(row["case"]["caseName"])
```

```bash cURL theme={"theme":"github-light"}
API=https://api.vaquill.ai/api/v1/us
AUTH="Authorization: Bearer $VAQUILL_API_KEY"

# 1. Citation to case (2 credits)
curl -X POST "$API/cases/resolve" -H "$AUTH" \
  -H "Content-Type: application/json" \
  -d '{"citations": ["347 F.3d 1000"]}'

# Copy caseId and leadOpinionId from that response.
CASE_ID="USCASE_..."
OPINION_ID="USOP_..."

# 2. Main opinion (6 credits)
curl "$API/opinions/$OPINION_ID?format=text" -H "$AUTH"

# 3. Cases that cite it (1 credit)
curl "$API/cases/$CASE_ID/citations?limit=5" -H "$AUTH"
```

Citing lists for landmark cases can time out with a `503`. You are not charged. Retry after a few seconds.

## Endpoints

Paths start with `https://api.vaquill.ai/api/v1/us`. Each name links to its parameters and fields.

Do not hard-code a price.
`GET /api-credits/pricing` returns the live credit price of every endpoint. It needs no authentication and costs nothing.
One credit is \$0.01.

### Find cases

| Endpoint | Use it to | Credits |
| - | - | -: |
| [`POST /cases/search`](https://vaquill.ai/docs/api-reference/us-case-law/search-us-court-opinions) | Search opinion text | 4 per page |
| [`POST /cases/resolve`](https://vaquill.ai/docs/api-reference/us-case-law/resolve-citations-to-cases) | Turn citations, or the text of a brief, into cases | 2 per distinct citation |
| [`GET /cases/list`](https://vaquill.ai/docs/api-reference/us-case-law/list-us-court-decisions) | List cases by court, judge or date | 1 per page |

### Read cases

| Endpoint | Use it to | Credits |
| - | - | -: |
| [`GET /cases/{caseId}`](https://vaquill.ai/docs/api-reference/us-case-law/get-a-us-court-decision) | Get one case and its list of opinions | 2 |
| [`POST /cases/batch`](https://vaquill.ai/docs/api-reference/us-case-law/get-several-us-court-decisions) | Get up to 50 cases | 2 per case returned |
| [`GET /opinions/{opinionId}`](https://vaquill.ai/docs/api-reference/us-case-law/get-the-text-of-an-opinion) | Read one opinion | 6 |
| [`POST /opinions/batch`](https://vaquill.ai/docs/api-reference/us-case-law/get-the-text-of-several-opinions) | Read up to 20 opinions | 6 per opinion returned |

### Follow citations

| Endpoint | Use it to | Credits |
| - | - | -: |
| [`GET /cases/{caseId}/citations`](https://vaquill.ai/docs/api-reference/us-case-law/case-citations-in-either-direction) | See what a case cites, or what cites it | 1 per page |
| [`GET /opinions/{opinionId}/citations`](https://vaquill.ai/docs/api-reference/us-case-law/opinion-citations-in-either-direction) | The same, for one opinion | 1 per page |
| [`GET /cases/{caseId}/parentheticals`](https://vaquill.ai/docs/api-reference/us-case-law/parentheticals-describing-a-decision) | See how later courts sum up a case | 1 per page |

### Courts and judges

| Endpoint | Use it to | Credits |
| - | - | -: |
| [`GET /courts`](https://vaquill.ai/docs/api-reference/us-case-law/list-us-courts) | Find courts and what we hold for each | Free |
| [`GET /courts/{courtId}`](https://vaquill.ai/docs/api-reference/us-case-law/get-a-us-court) | Get one court | Free |
| [`GET /judges`](https://vaquill.ai/docs/api-reference/us-case-law/list-and-search-judges) | Find a judge by name or court | 2 per page |
| [`GET /judges/{judgeId}`](https://vaquill.ai/docs/api-reference/us-case-law/get-a-judge) | Get a profile. `include=stats` adds case counts | 2, or 4 with stats |
| [`GET /judges/{judgeId}/disclosures`](https://vaquill.ai/docs/api-reference/us-case-law/list-a-judges-financial-disclosures) | List financial disclosure reports | 1 per page |

### Dockets and oral arguments

| Endpoint | Use it to | Credits |
| - | - | -: |
| [`GET /dockets/list`](https://vaquill.ai/docs/api-reference/us-case-law/list-and-search-dockets) | Find dockets by court, number, name or date | 2 per page |
| [`GET /dockets/{docketId}`](https://vaquill.ai/docs/api-reference/us-case-law/get-a-docket) | Get one docket and its cases | 2 |
| [`GET /oral-arguments/list`](https://vaquill.ai/docs/api-reference/us-case-law/list-oral-arguments) | Find oral argument records | 1 per page |
| [`GET /oral-arguments/{argumentId}`](https://vaquill.ai/docs/api-reference/us-case-law/get-an-oral-argument) | Get one record | 2 |

Docket entries, filed documents and recordings are [not held yet](https://vaquill.ai/docs/api-guide/coverage/case-law.md#not-held-yet).

**File downloads are not live yet.** `GET /files/{fileId}` returns `404` today.
It will return a signed link that works for 5 minutes. The planned price is 5 credits.

### Track changes

| Endpoint | Use it to | Credits |
| - | - | -: |
| [`GET /cases/changes`](https://vaquill.ai/docs/api-reference/us-case-law/cases-added-or-changed-since-a-moment) | List cases added, changed or removed | 1 per page |

## Before you build

* **Empty pages cost credits.** Failed lookups (`404`), bad requests (`422`) and server errors do not.
* **Paging differs.** `/cases/list` and `/cases/changes` use `cursor`. Other lists use `offset`, up to 10,000.
* **Some cases are left out of search.** You can still get them by id or citation.
* **Withdrawn cases return `410`.** This covers privacy, sealed cases and legal orders.
* **Some cases appear twice or more.** Match on citation and docket number before you count or display them.
* **Some old dates are wrong.** Check `decisionDate` against the citation before you rely on it.
* **Scans can have errors.** Check quotes when `textFromOcr` is `true`.
* **Retries can be free.** Send an `Idempotency-Key` of 16 to 255 characters with no spaces, such as a UUID. It works for 24 hours.

## Keep a copy in sync

`GET /cases/changes` returns case ids that changed after `since`, oldest first.

* `upsert`: fetch the case again.
* `removed`: take it out of your synced copy. It was withdrawn or taken out of search. See [withdrawn cases](https://vaquill.ai/docs/api-guide/rights-and-licensing.md#withdrawn-cases).

Save `asOf` after a full run and send it as the next `since`.

```python Python theme={"theme":"github-light"}
import os
import requests

URL = "https://api.vaquill.ai/api/v1/us/cases/changes"
HEADERS = {"Authorization": f"Bearer {os.environ['VAQUILL_API_KEY']}"}


def sync(since, handle):
    params = {"since": since, "limit": 100}
    while True:
        resp = requests.get(URL, headers=HEADERS, params=params, timeout=60)
        resp.raise_for_status()
        page = resp.json()
        for row in page["results"]:
            handle(row)
        if not page["hasMore"]:
            return page["asOf"]
        params["cursor"] = page["nextCursor"]
```

> [!WARNING]
>
> Start from a recent date.
> Reading the whole feed takes 100,000+ credits (\$1,000+) and returns ids only.
> Add `courtId` to follow one court.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.