John Cole

Aug 01, 2026 • 4 min read

How to Turn Google Scholar Case Law Into Structured JSON With One API

Search US federal and state court opinions and citations as JSON over REST or MCP, with pay-per-result pricing and no captcha maintenance.

How to Turn Google Scholar Case Law Into Structured JSON With One API
  • Commercial legal databases charge hundreds of dollars per seat every month. Google Scholar's case law search is free and covers US federal and state opinions back well over a century, but it only exists as a web page, so you cannot query it from a script. I wanted that corpus as JSON, so I built an Actor that returns it.

    What a case law API actually is

    A case law API is a scraper you consume like an API: send a query with court and year filters, and get US court opinions back as structured JSON instead of a page of result cards. Google Scholar has never shipped a public API, so this fills that gap while staying scoped to what Scholar actually indexes.

    What it returns

    Each opinion comes back as a JSON record with these fields:

    • Case title and party names, as Scholar renders them.

    • The deciding court and the decision date.

    • Reporter citation, page ranges, and docket numbers.

    • The cited-by count and inline citation links.

    • A result_id you pass back to fetch the full case detail, including every case the opinion cites.

    Run it in three steps

    Open the Google Scholar Case Law API and click Try for free. Enter a query, and optionally a court code, a start year, and an end year. Run it and download the dataset as JSON or CSV. Court code 158 is the Supreme Court; leave the courts field empty to search every US state and federal court.

    Use it as a REST API

    Over REST it is one POST call to the run endpoint with your query and filters in the body. You get back a dataset ID, then read the items as JSON. A search-only run bills half a cent per result, so testing a 20-result query costs about a dime and Apify's free credit usually covers it. Full endpoint details are in the Apify API docs.

    Wire it into Claude with MCP

    Apify exposes the Actor over the Model Context Protocol, so Claude, Claude Code, and Cursor can call it as a tool with no code. An agent can search a doctrine, pull the full detail on the top hit, and cite a real opinion instead of inventing one, which is the failure mode that gets people sanctioned. The task Do legal research in Claude with a case law MCP walks through the setup.

    What people build with it

    Litigation support teams assemble jurisdiction-specific corpora and preload case metadata before discovery. Developers turn cited-by counts and cited-case lists into edges in a citation graph. Researchers export a doctrine's history to a spreadsheet. You can browse all seven runnable examples on the examples page, or start from the project page.

    FAQ About Scraping Google Scholar Case Law

    Where does the case law scraper get its data, and how fresh is it?

    It returns what Google Scholar's case law collection indexes: US federal and state opinions, with citations and cited-by counts. Coverage of very recent or very obscure opinions depends on Scholar's own indexing, and it does not report editorial treatment, so it will not flag an overruled case the way a paid citator does.

    How do I call the case law API over REST, and what does it cost?

    Send a POST to the Actor's run endpoint with a query and optional court and year filters, then read the dataset as JSON or CSV. Billing is per event: half a cent per search result and one cent per full case detail, so a 20-result search-only run is about a dime.

    Can an AI agent use this case law scraper through MCP?

    Yes. Connected over MCP, the Actor appears as a callable tool in Claude, Claude Code, or Cursor, so an agent can search precedent mid-conversation and ground its answer in opinions that actually exist.

    Is a case law API better than writing my own scraper?

    For anything past a handful of queries, yes. Google Scholar is aggressively bot-protected, so a home-built scraper hits captchas fast and breaks when the markup shifts. The hosted API absorbs that maintenance and hands you clean JSON.

    Issues get a response within a day. Start from the Google Scholar Case Law API with a single query and a court code.

Join John on Peerlist!

Join amazing folks like John and thousands of other builders on Peerlist.

peerlist.io/

It’s available... this username is available! 😃

Claim your username before it's too late!

This username is already taken, you’re a little late.😐

0

0

0