# Google Scholar Case Law API (`johnvc/google-scholar-case-law`) Actor

API for Google Scholar US case law. Search opinions and pull full case details with court, year, and citation filters. Returns structured JSON. MCP-ready.

- **URL**: https://apify.com/johnvc/google-scholar-case-law.md
- **Developed by:** [John](https://apify.com/johnvc) (community)
- **Categories:** AI, MCP servers, Automation
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 3 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $0.01 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## 🏛️ Google Scholar Case Law API

API for US case law on Google Scholar. Search opinions and pull full case details (parties, court, decision dates, full citations, cited cases) as structured JSON. Filter by court, by decision year, by language. MCP-ready so Claude and other AI agents can call it as a tool.

---

### 📋 What this API returns

| Field | Where | Description |
|---|---|---|
| `result_id` | search results | Google Scholar identifier. Use to fetch full case detail. |
| `title` | both | Case title with reporter citation. |
| `snippet` | search results | Short text preview from the opinion. |
| `publication_info` | search results | Author, source, and date block. |
| `inline_links` | search results | Cited-by, related, versions, cached links. |
| `name` | case detail | Short party-name designation (e.g. *Brown v. Board of Education*). |
| `court_name` | case detail | Deciding court. |
| `dates` | case detail | Decision, argued, and filed dates with type labels. |
| `short_citations` | case detail | Abbreviated case references. |
| `case_numbers` | case detail | Docket numbers. |
| `cited_cases` | case detail | Every case referenced in the opinion. |
| `first_page`, `last_page` | case detail | Reporter page range. |

---

### 🔍 Use cases

- **Legal research API.** Pull every Supreme Court opinion mentioning a phrase, scoped by year.
- **Citation analysis.** Get `cited_cases` for a known opinion and walk the citation graph.
- **Jurisdictional studies.** Restrict to a specific court (e.g. `158` for SCOTUS, `33` for New York state courts) and export the corpus.
- **Litigation prep.** Pre-load case-fact summaries into your case-management workflow.
- **AI agent workflows.** Drive this API over MCP from Claude (see below) to research case law in-conversation.

---

### ⚙️ Input examples

#### Basic search

```json
{
  "query": "patent infringement",
  "maxResults": 20
}
````

#### Court-filtered, year-bounded search

```json
{
  "query": "First Amendment school speech",
  "maxResults": 30,
  "yearFrom": 2010,
  "yearTo": 2024,
  "courts": ["158"],
  "sortByDate": true
}
```

`courts: ["158"]` restricts to the Supreme Court of the United States. Leave `courts` empty to search every US state and federal court.

#### Fetch full case detail by ID

```json
{
  "caseIds": [
    "1810530706706468549",
    "5036225562552830387"
  ]
}
```

#### Search and auto-fetch detail for every hit

```json
{
  "query": "trademark dilution",
  "maxResults": 5,
  "fetchCaseDetailsForResults": true
}
```

Returns 5 `search_result` rows AND 5 `case_detail` rows in the dataset.

***

### 🧾 Common court codes

| Code | Court |
|---|---|
| (omitted / empty `courts`) | All US state and federal |
| `158` | Supreme Court of the United States |
| `159` | US Court of Appeals, Federal Circuit |
| `160` to `172` | US Courts of Appeals, 1st through DC Circuits |
| `192` | US Tax Court |
| `33` | New York state courts |
| `5` | California state courts |

Any numeric court code shown in Google Scholar's case-law UI is accepted.

***

### 🔌 Use this API from Claude (MCP)

This Actor is MCP-server-compatible. Once published to the Apify Store, it is reachable from any MCP client (Claude Desktop, Claude Code, etc.) via Apify's hosted MCP server at `https://mcp.apify.com`.

Add this to your MCP client config (e.g. `~/.claude/mcp.json` or Claude Desktop's `claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com",
      "headers": {
        "Authorization": "Bearer YOUR_APIFY_TOKEN"
      }
    }
  }
}
```

Then ask Claude:

> *"Use the Google Scholar Case Law API to find `patent infringement` cases from 2020 onward. Return the top 5 results, then fetch the full case detail for each one."*

Claude will call this Actor through the MCP server. The input schema's field descriptions become tool-arg docs, and the structured dataset comes straight back into the conversation.

***

### 💰 Pricing (pay-per-event)

| Event | Price | When it fires |
|---|---|---|
| `actor-start` | $0.02 | Once per Actor run, at startup. |
| `search-result` | $0.02 | Per organic search result returned. |
| `case-detail` | $0.02 | Per full case detail fetched. |

A 10-result search costs $0.02 + 10 x $0.02 = **$0.22**.
A 10-result search plus detail for every result costs $0.02 + 10 x $0.02 + 10 x $0.02 = **$0.42**.

***

### 🗂️ Output format

Every dataset item has a `result_type` field. It is either `"search_result"`, `"case_detail"`, or `"error"`. Filter the dataset on this field to separate the two kinds of rows. Search results carry `result_id`; case-detail rows carry `case_id` (they are the same identifier).

***

Last Updated: 2026.05.14

# Actor input Schema

## `query` (type: `string`):

Case-law search query (e.g. 'patent infringement', 'Roe v. Wade', 'First Amendment school speech'). Either `query` or `caseIds` must be provided. Supports Google Scholar operators like 'author:' and 'source:'.

## `maxResults` (type: `integer`):

Maximum number of search results to return. Up to 20 results are fetched per upstream page; results above 20 paginate. Default 20, max 100.

## `yearFrom` (type: `integer`):

Earliest decision year to include in the search (inclusive). Optional.

## `yearTo` (type: `integer`):

Latest decision year to include in the search (inclusive). Optional.

## `courts` (type: `array`):

List of Google Scholar court codes to limit the search to specific jurisdictions. Leave empty to search ALL US state and federal courts. Common codes: '158' Supreme Court (SCOTUS), '159' Federal Circuit, '160' 1st Circuit, '161' 2nd Circuit, '162' 3rd Circuit, '192' US Tax Court, '33' New York state courts. Any numeric code from Google Scholar's case-law filter is accepted.

## `language` (type: `string`):

Two-letter language code for the search interface (ISO 639-1, e.g. 'en', 'es', 'fr'). Defaults to 'en'.

## `sortByDate` (type: `boolean`):

When true, sort results by decision date (newest first) instead of relevance.

## `excludeCitations` (type: `boolean`):

When true, exclude bare citation entries from results (only return full opinions).

## `caseIds` (type: `array`):

List of Google Scholar case IDs to pull full case detail for. Each ID is the value of `result_id` from a previous search. If `query` is empty, only these IDs are processed.

## `fetchCaseDetailsForResults` (type: `boolean`):

When true and a `query` is provided, fetch the full case detail for every search result returned (one detail charge per result). Off by default to keep search-only runs cheap.

## Actor input object example

```json
{
  "query": "patent infringement",
  "maxResults": 20,
  "language": "en",
  "sortByDate": false,
  "excludeCitations": false,
  "fetchCaseDetailsForResults": false
}
```

# Actor output Schema

## `allResults` (type: `string`):

Every dataset item from this run: search results (result\_type='search\_result'), case details (result\_type='case\_detail'), and any error rows.

## `overview` (type: `string`):

Tabular overview of every dataset item using the dataset schema's default view. Columns: type, result id, case id, title, name, court, snippet, link, publication info, dates, citations, cited cases, fetched-at.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "query": "patent infringement",
    "language": "en"
};

// Run the Actor and wait for it to finish
const run = await client.actor("johnvc/google-scholar-case-law").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "query": "patent infringement",
    "language": "en",
}

# Run the Actor and wait for it to finish
run = client.actor("johnvc/google-scholar-case-law").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "query": "patent infringement",
  "language": "en"
}' |
apify call johnvc/google-scholar-case-law --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=johnvc/google-scholar-case-law",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Google Scholar Case Law API",
        "description": "API for Google Scholar US case law. Search opinions and pull full case details with court, year, and citation filters. Returns structured JSON. MCP-ready.",
        "version": "0.0",
        "x-build-id": "OCzgj6ioDZ9oOLJ43"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/johnvc~google-scholar-case-law/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-johnvc-google-scholar-case-law",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/johnvc~google-scholar-case-law/runs": {
            "post": {
                "operationId": "runs-sync-johnvc-google-scholar-case-law",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/johnvc~google-scholar-case-law/run-sync": {
            "post": {
                "operationId": "run-sync-johnvc-google-scholar-case-law",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "query": {
                        "title": "Search Query",
                        "type": "string",
                        "description": "Case-law search query (e.g. 'patent infringement', 'Roe v. Wade', 'First Amendment school speech'). Either `query` or `caseIds` must be provided. Supports Google Scholar operators like 'author:' and 'source:'."
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Maximum number of search results to return. Up to 20 results are fetched per upstream page; results above 20 paginate. Default 20, max 100.",
                        "default": 20
                    },
                    "yearFrom": {
                        "title": "Year From",
                        "minimum": 1700,
                        "maximum": 2100,
                        "type": "integer",
                        "description": "Earliest decision year to include in the search (inclusive). Optional."
                    },
                    "yearTo": {
                        "title": "Year To",
                        "minimum": 1700,
                        "maximum": 2100,
                        "type": "integer",
                        "description": "Latest decision year to include in the search (inclusive). Optional."
                    },
                    "courts": {
                        "title": "Court Codes",
                        "type": "array",
                        "description": "List of Google Scholar court codes to limit the search to specific jurisdictions. Leave empty to search ALL US state and federal courts. Common codes: '158' Supreme Court (SCOTUS), '159' Federal Circuit, '160' 1st Circuit, '161' 2nd Circuit, '162' 3rd Circuit, '192' US Tax Court, '33' New York state courts. Any numeric code from Google Scholar's case-law filter is accepted.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "language": {
                        "title": "Language Code",
                        "pattern": "^[a-z]{2}$",
                        "type": "string",
                        "description": "Two-letter language code for the search interface (ISO 639-1, e.g. 'en', 'es', 'fr'). Defaults to 'en'."
                    },
                    "sortByDate": {
                        "title": "Sort by Date",
                        "type": "boolean",
                        "description": "When true, sort results by decision date (newest first) instead of relevance.",
                        "default": false
                    },
                    "excludeCitations": {
                        "title": "Exclude Citations",
                        "type": "boolean",
                        "description": "When true, exclude bare citation entries from results (only return full opinions).",
                        "default": false
                    },
                    "caseIds": {
                        "title": "Case IDs",
                        "type": "array",
                        "description": "List of Google Scholar case IDs to pull full case detail for. Each ID is the value of `result_id` from a previous search. If `query` is empty, only these IDs are processed.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "fetchCaseDetailsForResults": {
                        "title": "Fetch Details for Search Results",
                        "type": "boolean",
                        "description": "When true and a `query` is provided, fetch the full case detail for every search result returned (one detail charge per result). Off by default to keep search-only runs cheap.",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
