Skip to main content

Python SDK for the Court Listener 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 General search across all types
opinion_search Search opinions
recap_search Search RECAP archive
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

courtlistener_api_client-0.0.1.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

courtlistener_api_client-0.0.1-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file courtlistener_api_client-0.0.1.tar.gz.

File metadata

  • Download URL: courtlistener_api_client-0.0.1.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for courtlistener_api_client-0.0.1.tar.gz
Algorithm Hash digest
SHA256 2b62bb4d1f524a49adbb11de43436fd412c7510faf8f871bafa084def05ed43d
MD5 98726dc4215748f3f100194cf6105392
BLAKE2b-256 a72f6e40de58d3419dcecfedfc034a6780df76d64c312f3d671cddb32dfa8393

See more details on using hashes here.

File details

Details for the file courtlistener_api_client-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: courtlistener_api_client-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for courtlistener_api_client-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 039c796ee41de45d20c9869f17b572e90545de366dfd0d2b64195322ae4932eb
MD5 82190336fbefa3c8ef6394726cff2457
BLAKE2b-256 46f94a556f0800495e1653e7f4637f6d581dd41623e0cde877eee603d232ab20

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page