@midpage-ai/scrapersDocumentationAPI Reference

Schema

Complete reference for the opinions database schema.

The opinions schema contains normalized court opinion data. All tables are in the opinions schema and can be joined using foreign key relationships.

Entity Relationship

courts
  └── cases
        └── docket_entries
              ├── citations
              └── content

opinion_relations (cross-references between opinions)

Tables

opinions.courts

Court definitions for 2000+ federal and state courts.

Column Type Description
id 🔑 VARCHAR(50) Court identifier (e.g., 'ca9', 'nysd')
full_name TEXT Full court name
court_abbreviation VARCHAR(100) Citation abbreviation
jurisdiction VARCHAR(50) Federal Appellate, Federal District, Federal Bankruptcy, Federal Special, State Supreme, State Appellate, State Trial, State Special, State Attorney General, Military, Military Appellate, Tribal, U.S. Territory, Committee, International
state VARCHAR(50) State name, 'Federal', 'Tribal', or territory name
in_use BOOLEAN Whether court is actively scraped

opinions.cases

Case metadata including docket information and dates.

Column Type Description
id 🔑 TEXT Internal case ID
court_id VARCHAR(50) Court identifier
docket_number TEXT Court docket number
case_name TEXT Case name/caption
date_filed DATE Date case was filed
date_terminated DATE Date case was terminated
data_origin VARCHAR(25) Source of the data

opinions.docket_entries

Opinion entries (where is_opinion = true). Each row represents a court opinion.

Column Type Description
id 🔑 TEXT Opinion identifier
case_id TEXT Parent case
description TEXT Opinion description
date_filed DATE Opinion filing date
judge_name TEXT Authoring judge name
is_opinion BOOLEAN Whether this is an opinion (true for opinions)
opinion_role ENUM Role of opinion (lead, concurrence, dissent, etc.)
publish_status ENUM Publication status
data_origin VARCHAR(25) Source of the data

opinions.citations

Reporter citations for opinions.

Column Type Description
id 🔑 UUID Internal citation ID
opinion_id TEXT Parent opinion
court_id VARCHAR(255) Court identifier
volume VARCHAR(20) Reporter volume number
reporter VARCHAR(50) Reporter abbreviation (e.g., 'U.S.', 'F.3d')
page VARCHAR(20) Starting page number
cited_as TEXT Full citation string
citation_type VARCHAR(50) Type of citation
year INTEGER Year of citation
normalized VARCHAR(150) Normalized citation format

opinions.content

Full text content for opinions.

Column Type Description
id 🔑 TEXT Opinion ID (same as docket_entries.id)
html_content TEXT Opinion text in HTML format
source VARCHAR(50) Source of content
created_at TIMESTAMP When content was added

opinions.opinion_relations

Citation relationships and treatment analysis between opinions.

Column Type Description
cited_id TEXT The opinion being cited
citing_id TEXT The opinion doing the citing
citator_version TEXT Version of citator analysis
is_authoritative BOOLEAN Whether this is an authoritative citation
treatment_category TEXT How the citing opinion treats the cited opinion
treatment_description TEXT Detailed treatment explanation
supporting_quote TEXT Quote from citing opinion supporting the treatment
confidence_score DOUBLE Confidence score of the treatment analysis

🔑 = Primary Key, → = Foreign Key