Official Python SDK for the CourtListener API
Project description
CourtListener API Client
A Python client for the CourtListener API, providing access to millions of legal opinions, dockets, judges, and more from Free Law Project.
Installation
pip install courtlistener-api-client
Authentication
You'll need a CourtListener API token. You can get one by creating an account and generating a token in your profile settings.
Set it as an environment variable:
export COURTLISTENER_API_TOKEN="your-token-here"
Or pass it directly to the client:
from courtlistener import CourtListener
client = CourtListener(api_token="your-token-here")
Quickstart
from courtlistener import CourtListener
client = CourtListener()
# Get a specific opinion by ID
opinion = client.opinions.get(1)
# Search for opinions
response = client.opinions.list(cluster__case_name="Miranda")
# Access results from the current page
for opinion in response.results:
print(opinion)
# Check the total count of matching results
print(response.count)
# Iterate through all results across pages
response = client.dockets.list(court="scotus")
for docket in response:
print(docket)
Pagination
List queries return a ResourceIterator that handles pagination automatically:
results = client.dockets.list(court="scotus")
# Iterate through all results across all pages
for docket in results:
print(docket)
# Or navigate pages manually
results = client.dockets.list(court="scotus")
print(results.results) # current page results
if results.has_next():
results.next()
print(results.results) # next page results
Available Endpoints
Access any endpoint as an attribute on the client. Each endpoint supports .get(id) and .list(**filters).
| Endpoint | Description |
|---|---|
search |
Search opinions, RECAP, judges, and oral arguments |
dockets |
Court dockets |
docket_entries |
Docket entries |
recap_documents |
RECAP documents |
opinions |
Court opinions |
opinions_cited |
Citation relationships |
clusters |
Opinion clusters |
courts |
Court information |
audio |
Oral argument audio |
people |
Judges and other persons |
positions |
Judge positions |
parties |
Case parties |
attorneys |
Attorneys |
financial_disclosures |
Financial disclosures |
alerts |
User alerts |
docket_alerts |
Docket alerts |
tags |
User-created tags |
visualizations |
Visualization data |
schools |
Schools |
educations |
Judge education records |
political_affiliations |
Political affiliations |
aba_ratings |
ABA ratings |
fjc_integrated_database |
FJC integrated database |
See the CourtListener API docs for the full list and available filters.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file courtlistener_api_client-0.0.6.tar.gz.
File metadata
- Download URL: courtlistener_api_client-0.0.6.tar.gz
- Upload date:
- Size: 111.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89f70c15b9e3f76f676da79fdc88d7f512ecd85f0701b65e6f2aec780c1995b8
|
|
| MD5 |
5984118f7f2d9265b28f80d57cb67a9d
|
|
| BLAKE2b-256 |
83bb76a01908411a3a9502c9c6589488acd9cb208fce304ce61313dc71a3b8a0
|
File details
Details for the file courtlistener_api_client-0.0.6-py3-none-any.whl.
File metadata
- Download URL: courtlistener_api_client-0.0.6-py3-none-any.whl
- Upload date:
- Size: 150.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
282389e813d30f8e7f55f32754811ba54b29ee398daa9f6cdfd852387fd3adcd
|
|
| MD5 |
7cda9abf406241b86446c0f1a59ba372
|
|
| BLAKE2b-256 |
a3d94ca617e790b3b74b85514bcad80fd6e5ab17f03058e4c8c37173c6f183a6
|