Midpage Legal Research
Midpage Legal Research · GPT アクション
Midpage Legal Research API
Legal research tools for searching US case law, finding passages, and analyzing opinions.
POST /api/gpt-plugin/searchSearch Case LawSearch US case law. Returns metadata, highlights, and citator treatment. Use key terms, not sentences. Boolean supported (AND, OR, *, W/n). IMPORTANT: Always use analyzeOpinion before citing any case.
POST /api/gpt-plugin/find-in-opinionFind Passages in OpinionKeyword search within a single opinion. Fast, no AI cost. Use key terms (e.g., "minimum contacts"), NOT questions. Optional but useful to preview cases before analyzeOpinion.
POST /api/gpt-plugin/analyze-opinionAnalyze OpinionAI analysis of a legal opinion. REQUIRED before citing any case. Returns what the case ACTUALLY supports (supportedPropositions) and what it does NOT address (doesNotAddress). Check doesNotAddress before citing. Use proposition text when citing.
元の API スキーマ
{
"openapi": "3.1.0",
"info": {
"title": "Midpage Legal Research API",
"description": "Legal research tools for searching US case law, finding passages, and analyzing opinions.",
"version": "2.0.0"
},
"servers": [
{
"url": "https://app.midpage.ai"
}
],
"paths": {
"/api/gpt-plugin/search": {
"post": {
"summary": "Search Case Law",
"description": "Search US case law. Returns metadata, highlights, and citator treatment.\nUse key terms, not sentences. Boolean supported (AND, OR, *, W/n).\nIMPORTANT: Always use analyzeOpinion before citing any case.\n",
"operationId": "search_post",
"x-openai-isConsequential": false,
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SearchRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SearchResponse"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Internal Server Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": [
{
"HTTPBearer": []
}
]
}
},
"/api/gpt-plugin/find-in-opinion": {
"post": {
"summary": "Find Passages in Opinion",
"description": "Keyword search within a single opinion. Fast, no AI cost.\nUse key terms (e.g., \"minimum contacts\"), NOT questions.\nOptional but useful to preview cases before analyzeOpinion.\n",
"operationId": "find_in_opinion_post",
"x-openai-isConsequential": false,
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FindInOpinionRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FindInOpinionResponse"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Internal Server Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": [
{
"HTTPBearer": []
}
]
}
},
"/api/gpt-plugin/analyze-opinion": {
"post": {
"summary": "Analyze Opinion",
"description": "AI analysis of a legal opinion. REQUIRED before citing any case.\nReturns what the case ACTUALLY supports (supportedPropositions) and what it does NOT address (doesNotAddress).\nCheck doesNotAddress before citing. Use proposition text when citing.\n",
"operationId": "analyze_opinion_post",
"x-openai-isConsequential": false,
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AnalyzeOpinionRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AnalyzeOpinionResponse"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Internal Server Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"security": [
{
"HTTPBearer": []
}
]
}
}
},
"components": {
"schemas": {
"SearchRequest": {
"type": "object",
"properties": {
"queries": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SearchParameters"
},
"minItems": 1,
"maxItems": 5,
"description": "Search queries to run in parallel. Each can have its own filters."
},
"maxResultsPerQuery": {
"type": "integer",
"minimum": 1,
"maximum": 15,
"default": 10,
"description": "Max results per query (default 10, max 15)"
}
},
"required": [
"queries"
]
},
"SearchParameters": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "Search query. Use key terms and concepts, not full sentences."
},
"negativeQuery": {
"type": "string",
"description": "Optional query to rank matching cases lower."
},
"startDate": {
"type": "string",
"format": "date",
"description": "Start date filter (YYYY-MM-DD)"
},
"endDate": {
"type": "string",
"format": "date",
"description": "End date filter (YYYY-MM-DD)"
},
"jurisdictionType": {
"type": "string",
"enum": [
"state",
"federal",
"state_and_federal"
],
"default": "state_and_federal",
"description": "Court types to include (defaults to all)"
},
"circuits": {
"type": "array",
"items": {
"type": "string",
"enum": [
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"dc",
"federal_circuit",
"supreme_court"
]
},
"description": "Federal circuits to include"
},
"states": {
"type": "array",
"items": {
"type": "string",
"enum": [
"Alabama",
"Alaska",
"Arizona",
"Arkansas",
"California",
"Colorado",
"Connecticut",
"Delaware",
"Florida",
"Georgia",
"Hawaii",
"Idaho",
"Illinois",
"Indiana",
"Iowa",
"Kansas",
"Kentucky",
"Louisiana",
"Maine",
"Maryland",
"Massachusetts",
"Michigan",
"Minnesota",
"Mississippi",
"Missouri",
"Montana",
"Nebraska",
"Nevada",
"New Hampshire",
"New Jersey",
"New Mexico",
"New York",
"North Carolina",
"North Dakota",
"Ohio",
"Oklahoma",
"Oregon",
"Pennsylvania",
"Rhode Island",
"South Carolina",
"South Dakota",
"Tennessee",
"Texas",
"Utah",
"Vermont",
"Virginia",
"Washington",
"West Virginia",
"Wisconsin",
"Wyoming",
"District of Columbia"
]
},
"description": "US states to include in the search."
},
"includeCourts": {
"type": "array",
"items": {
"type": "string"
},
"description": "Additional courts to narrow the search (applied on top of other filters)."
}
},
"required": [
"query"
]
},
"SearchResponse": {
"type": "object",
"properties": {
"results": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SearchResult"
}
},
"totalResults": {
"type": "integer"
},
"error": {
"type": "string",
"description": "Error message if search failed"
}
}
},
"SearchResult": {
"type": "object",
"properties": {
"documentId": {
"type": "string",
"description": "Midpage opinion ID. Use with findInOpinion and analyzeOpinion."
},
"metadata": {
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "URL to view opinion on Midpage"
},
"court": {
"type": "string",
"description": "Court name"
},
"filedDate": {
"type": "string",
"description": "Date the opinion was filed"
},
"citation": {
"type": "string",
"description": "Bluebook citation"
}
}
},
"highlights": {
"type": "array",
"items": {
"type": "string"
},
"description": "Snippets showing why case matched. NOT for quoting."
},
"treatment": {
"type": "object",
"properties": {
"status": {
"type": "string",
"description": "Citator status (positive/negative/caution/neutral)"
},
"citationCount": {
"type": "integer",
"description": "Number of times this case has been cited"
}
}
}
}
},
"FindInOpinionRequest": {
"type": "object",
"description": "Provide ONE document identifier: opinionId (fastest, from search results),\nreporterCitation (e.g., \"556 U.S. 662\"), or docket (for cases without reporter citations).\nNever use WL/LEXIS citations—use docket instead.\n",
"properties": {
"opinionId": {
"type": "string",
"description": "Midpage opinion ID (numeric string from search). Fastest option."
},
"reporterCitation": {
"type": "string",
"description": "Reporter citation (e.g., \"556 U.S. 662\", \"123 F.3d 456\"). No WL/LEXIS."
},
"docket": {
"type": "object",
"description": "Use for cases without reporter citations.",
"properties": {
"courtAbbreviation": {
"type": "string",
"description": "Court abbreviation (e.g., \"S.D.N.Y.\", \"9th Cir.\")"
},
"docketNumber": {
"type": "string",
"description": "Docket number (e.g., \"12-cv-20100\"). Omit \"No.\" prefix."
}
},
"required": [
"courtAbbreviation",
"docketNumber"
]
},
"query": {
"type": "string",
"description": "Key terms for matching passages. Use terms like \"minimum contacts\", NOT questions."
}
},
"required": [
"query"
]
},
"FindInOpinionResponse": {
"type": "object",
"properties": {
"opinionId": {
"type": "string",
"description": "The resolved opinion ID"
},
"citation": {
"type": "string",
"description": "Bluebook citation for the case"
},
"snippets": {
"type": "array",
"items": {
"type": "object",
"properties": {
"snippet": {
"type": "string",
"description": "Verbatim passage from opinion"
}
}
}
},
"totalSnippets": {
"type": "integer"
},
"error": {
"type": "string"
}
}
},
"AnalyzeOpinionRequest": {
"type": "object",
"description": "Provide ONE document identifier: opinionId (fastest, from search results),\nreporterCitation (e.g., \"556 U.S. 662\"), or docket (for cases without reporter citations).\nNever use WL/LEXIS citations—use docket instead.\n",
"properties": {
"opinionId": {
"type": "string",
"description": "Midpage opinion ID (numeric string from search). Fastest option."
},
"reporterCitation": {
"type": "string",
"description": "Reporter citation (e.g., \"556 U.S. 662\", \"123 F.3d 456\"). No WL/LEXIS."
},
"docket": {
"type": "object",
"description": "Use for cases without reporter citations.",
"properties": {
"courtAbbreviation": {
"type": "string",
"description": "Court abbreviation (e.g., \"S.D.N.Y.\", \"9th Cir.\")"
},
"docketNumber": {
"type": "string",
"description": "Docket number (e.g., \"12-cv-20100\"). Omit \"No.\" prefix."
}
},
"required": [
"courtAbbreviation",
"docketNumber"
]
},
"question": {
"type": "string",
"description": "The legal question you want answered about this opinion. Be specific about the legal element."
}
},
"required": [
"question"
]
},
"AnalyzeOpinionResponse": {
"type": "object",
"properties": {
"opinionId": {
"type": "string",
"description": "The resolved opinion ID"
},
"question": {
"type": "string",
"description": "The legal question that was analyzed"
},
"citation": {
"type": "string",
"description": "Bluebook citation for the case"
},
"url": {
"type": "string",
"description": "URL to view opinion on Midpage"
},
"supportedPropositions": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SupportedProposition"
},
"description": "Propositions this case supports, each with a verified quote. Use proposition text when citing."
},
"doesNotAddress": {
"type": "array",
"items": {
"type": "string"
},
"description": "Topics from your question the case does NOT address. CHECK THIS BEFORE CITING."
},
"summary": {
"type": "string",
"description": "Brief summary of what this case is about"
},
"jurisdiction": {
"type": "string",
"description": "Court and jurisdiction (e.g., \"9th Circuit\")"
},
"treatment": {
"type": "object",
"properties": {
"status": {
"type": "string",
"description": "Citator status (positive/negative/caution/neutral)"
},
"citedBy": {
"type": "integer",
"description": "Total citation count"
}
}
},
"error": {
"type": "string",
"description": "Error message if analysis failed"
}
}
},
"SupportedProposition": {
"type": "object",
"properties": {
"proposition": {
"type": "string",
"description": "Cite-ready statement of what the case holds. USE THIS TEXT when citing."
},
"quote": {
"type": "string",
"description": "Verbatim quote supporting the proposition"
},
"scope": {
"type": "string",
"description": "Limitations, conditions, what it does NOT apply to"
},
"centrality": {
"type": "string",
"enum": [
"core_holding",
"supporting_analysis",
"secondary_matter",
"background"
],
"description": "core_holding (strongest), supporting_analysis (strong),\nsecondary_matter (medium), background (weakest)\n"
}
}
},
"Error": {
"type": "object",
"properties": {
"error": {
"type": "string"
}
}
}
},
"securitySchemes": {
"HTTPBearer": {
"type": "http",
"scheme": "bearer"
}
}
}
}