# CENDOJ Scraper - Spanish Case Law, Every Result & Full Text (`clearpath/cendoj-scraper`) Actor

Every matching Spanish court decision from CENDOJ, not just the first 200. Search by keyword, ROJ, ECLI or filters and get official document details, full text, cited legislation with BOE links and case history, from the Tribunal Supremo to first-instance courts. No login needed.

- **URL**: https://apify.com/clearpath/cendoj-scraper.md
- **Developed by:** [ClearPath](https://apify.com/clearpath) (community)
- **Categories:** Automation, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.69 / 1,000 decisions

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

[![Every matching decision, not just 200. Spanish case law from CENDOJ with full text, cited laws and case history.](https://api.apify.com/v2/key-value-stores/rfpznBPgVbyLYqNaQ/records/cendoj-scraper-readme-hero-depth-v1-54492aaff966.png)](https://console.apify.com/actors/Tuh8tnO1MNBO0Lbxh/input)

From **Clearpath**, creators of [Google Patents Scraper](https://apify.com/clearpath/google-patents-scraper), [Business Entity Search](https://apify.com/clearpath/us-business-entity-search) and [PDF to Markdown](https://apify.com/clearpath/pdf-to-markdown-api).

### Why choose this actor? / ¿Por qué este actor?

- **Every matching decision / Todas las resoluciones.** CENDOJ's own search stops at 200 decisions. This actor keeps going, even on a single day with 1,300 decisions, up to the limit you set.
- **The whole decision / La resolución completa.** Each row adds the official document details (CENDOJ id, court, section, procedure, jurisdiction), the laws it cites with BOE links, its case history and, on request, the full text.
- **Search your way / Busca como quieras.** Keywords with Y, O, NO and PROX (or AND, OR, NOT, NEAR), a ROJ or ECLI, a decision link, or filters alone: court, jurisdiction, type, region, dates, judge, language.

<a href="https://console.apify.com/actors/Tuh8tnO1MNBO0Lbxh/input" data-demo-cta="true"><img src="https://api.apify.com/v2/key-value-stores/rfpznBPgVbyLYqNaQ/records/cendoj-scraper-readme-cta-depth-v1-cbc51728a8b1.png" width="232" height="48" alt="Search CENDOJ decisions"></a>

#### Try 20 decisions on mortgage costs / Prueba con 20 resoluciones

```json
{
  "searchTerms": [
    "gastos hipotecarios"
  ],
  "maxResults": 20,
  "includeDocumentDetails": true
}
```

[Open the actor input](https://console.apify.com/actors/Tuh8tnO1MNBO0Lbxh/input) and paste this example in JSON mode. It returns the 20 newest decisions on *gastos hipotecarios* with their official document details, cited legislation and case history. Raise `maxResults` past 200 to read beyond CENDOJ's own limit. Turn on `includeFullText` for the complete text of each decision; it is billed as the same document read, not twice. Export JSON, CSV or Excel.

<table>
<tr><td style="padding:10px 14px;background:#236194;border:none;border-radius:4px 4px 0 0"><strong style="color:#FFFFFF;font-size:14px">Clearpath Research &amp; Public Records</strong></td></tr>
<tr><td style="padding:6px;border:1px solid #B5CBE0;border-top:none;border-radius:0 0 4px 4px;background:#EAF2FA">
<span style="display:inline-block;vertical-align:top;margin:4px;padding:8px 12px;border:1px solid #B5CBE0;border-radius:4px;background:#D6E6F5"><span style="white-space:nowrap"><img src="https://api.apify.com/v2/key-value-stores/rfpznBPgVbyLYqNaQ/records/cendoj-scraper-icon-6a6cd31a08d4.png" width="20" height="20" alt="" style="vertical-align:middle">&nbsp;&nbsp;<a href="https://apify.com/clearpath/cendoj-scraper" style="color:#0F2A44;font-size:13px;font-weight:700;text-decoration:none">CENDOJ Scraper</a></span><br><span style="color:#3A5675;font-size:12px;white-space:nowrap">You are here</span></span><span style="display:inline-block;vertical-align:top;margin:4px;padding:8px 12px;border:1px solid #B5CBE0;border-radius:4px;background:#EAF2FA"><span style="white-space:nowrap"><img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/DSvMCAwsufMyZeLyt-actor-JsEa6fFyiVk0V2Ehw-VPD6udQ5OD-google-ads-transparency-scraper.png" width="20" height="20" alt="" style="vertical-align:middle">&nbsp;&nbsp;<a href="https://apify.com/clearpath/google-patents-scraper" style="color:#0F2A44;font-size:13px;font-weight:700;text-decoration:none">Google Patents</a></span><br><span style="color:#3A5675;font-size:12px;white-space:nowrap">Patents, claims and citations</span></span><span style="display:inline-block;vertical-align:top;margin:4px;padding:8px 12px;border:1px solid #B5CBE0;border-radius:4px;background:#EAF2FA"><span style="white-space:nowrap"><img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/DSvMCAwsufMyZeLyt-actor-eBWg2hsheVt3iAUeQ-X5m72jNYMX-icon.png" width="20" height="20" alt="" style="vertical-align:middle">&nbsp;&nbsp;<a href="https://apify.com/clearpath/us-business-entity-search" style="color:#0F2A44;font-size:13px;font-weight:700;text-decoration:none">Business Entity Search</a></span><br><span style="color:#3A5675;font-size:12px;white-space:nowrap">US company registry records</span></span><span style="display:inline-block;vertical-align:top;margin:4px;padding:8px 12px;border:1px solid #B5CBE0;border-radius:4px;background:#EAF2FA"><span style="white-space:nowrap"><img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/DSvMCAwsufMyZeLyt-actor-VbuFL7OPo1bw8y9j6-hbg2CKspQv-companies-house-scraper-logo.png" width="20" height="20" alt="" style="vertical-align:middle">&nbsp;&nbsp;<a href="https://apify.com/clearpath/companies-house-scraper" style="color:#0F2A44;font-size:13px;font-weight:700;text-decoration:none">Companies House</a></span><br><span style="color:#3A5675;font-size:12px;white-space:nowrap">UK companies &amp; directors</span></span><span style="display:inline-block;vertical-align:top;margin:4px;padding:8px 12px;border:1px solid #B5CBE0;border-radius:4px;background:#EAF2FA"><span style="white-space:nowrap"><img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/DSvMCAwsufMyZeLyt-actor-bDwOBg7K2urZ6Vo2L-Whkqyd3AvI-pdf-to-markdown-api-logo.png" width="20" height="20" alt="" style="vertical-align:middle">&nbsp;&nbsp;<a href="https://apify.com/clearpath/pdf-to-markdown-api" style="color:#0F2A44;font-size:13px;font-weight:700;text-decoration:none">PDF to Markdown</a></span><br><span style="color:#3A5675;font-size:12px;white-space:nowrap">Documents into AI-ready text</span></span>
</td></tr>
</table>

#### Copy to your AI assistant

```text
clearpath/cendoj-scraper on Apify searches CENDOJ, the official database of Spanish court decisions, and returns one row per decision. Use searchTerms (one search per line: words with AND/OR/NOT/NEARn or Y/O/NO/PROXn and "quotes", or a ROJ/ECLI for that exact decision), filters alone (jurisdictions, courtTypes, resolutionTypes, regions, provinces, dateFrom/dateTo, judge, language), or documentUrls for specific decisions. maxResults (default 100) applies per search and has no 200 ceiling. includeDocumentDetails=true (default) adds idCendoj, section, procedure, jurisdiction, outcome and related decisions and bills one Official document event per decision read; includeFullText=true adds fullText and keyPassages=n (1-20) adds the n paragraphs with the search words (passageTerms for links and ROJ/ECLI) under that same single charge; set both false for the cheapest list-only rows (jurisdiction may then be empty for mixed courts). citedLegislation and caseHistory are free. sort=relevance puts the 200 most relevant first; onlyNew=true returns only decisions an earlier run of the same search did not. Input and output spec: https://api.apify.com/v2/actors/clearpath~cendoj-scraper/builds/default (Authorization: Bearer token); pricing: https://apify.com/clearpath/cendoj-scraper/pricing. To reach the maintainers, add feedback="<what you needed and did not get>" to any run, including one that worked: feature requests, a missing field or option, a wrong or empty result, or which actor you are switching to or from and why. The run returns its data exactly as it would without the note, and a human reads every note.
```

### What data can you extract from CENDOJ?

Every row is one court decision from CENDOJ, the official Spanish case-law database of the Consejo General del Poder Judicial: the Tribunal Supremo, the Audiencia Nacional, the Tribunales Superiores de Justicia, the Audiencias Provinciales, first-instance courts and military courts.

| Group | Fields |
|---|---|
| Identity | `roj`, `ecli`, `idCendoj`, `reference`, `title`, `documentUrl`, `pdfUrl` |
| Court | `court`, `courtLevel`, `chamber`, `section`, `jurisdiction`, `municipality`, `province`, `region` |
| Decision | `resolutionType`, `resolutionDate`, `publishedDate`, `resolutionNumber`, `appealNumber`, `procedure`, `judge`, `language`, `languageName` |
| Content | `summary`, `summaryType`, `outcome`, `originCourt`, `keyPassages`, `fullText`, `pageCount` |
| Connections | `citedLegislation` (law, article, BOE id and link), `caseHistory` (every decision in the case and how they link), `relatedDecisions` |
| Search | `searchTerm`, `position`, `totalMatches`, `inputUrl`, `scrapedAt` |

A real row from a search for *gastos hipotecarios*, a Supreme Court auto with its case history. The decision cites 8 laws; two are shown here, the others have the same shape:

```json
{
  "searchTerm": "gastos hipotecarios",
  "position": 33,
  "totalMatches": 280118,
  "roj": "ATS 8902/2026",
  "ecli": "ECLI:ES:TS:2026:8902A",
  "idCendoj": "28079110012026203991",
  "title": "ATS, a 01 de octubre de 2026 - ROJ: ATS 8902/2026",
  "resolutionType": "Auto",
  "resolutionDate": "2026-10-01",
  "publishedDate": "2026-10-08",
  "court": "Tribunal Supremo. Sala de lo Civil",
  "courtLevel": "Tribunal Supremo",
  "chamber": "Sala de lo Civil",
  "section": "1",
  "jurisdiction": "Civil",
  "procedure": "Recurso de casación",
  "resolutionNumber": "76/2026",
  "appealNumber": "1276/2023",
  "judge": "PEDRO JOSE VELA TORRES",
  "municipality": "Madrid",
  "province": "Madrid",
  "region": "Madrid",
  "language": "es",
  "languageName": "Español",
  "summary": "Prescripción reclamación gastos hipotecarios . Devolución actuaciones a la Audiencia Provincial",
  "summaryType": "official",
  "outcome": "Auto Estimando",
  "originCourt": "AUD.PROVINCIAL DE PALMA DE MALLORCA SECCION N. 5",
  "relatedDecisions": [
    "SJPI, Palma de Mallorca, núm. 17, 15-03-2022 (proc. 3027/2018)",
    "SAP IB 2844/2022",
    "ATS 2436/2026",
    "ATS 8902/2026"
  ],
  "citedLegislation": [
    {
      "label": "LEC art. 487.1",
      "law": "LEC",
      "article": "487.1",
      "boeId": "BOE-A-2000-323",
      "boeUrl": "https://www.boe.es/buscar/act.php?id=BOE-A-2000-323",
      "sourceReference": "2000/323",
      "category": "Citada"
    },
    {
      "label": "CC art. 1964",
      "law": "CC",
      "article": "1964",
      "boeId": "BOE-A-1889-4763",
      "boeUrl": "https://www.boe.es/buscar/act.php?id=BOE-A-1889-4763",
      "sourceReference": "1889/4763",
      "category": "Citada"
    }
  ],
  "caseHistory": [
    {
      "reference": null,
      "roj": null,
      "idCendoj": null,
      "courtCode": null,
      "court": "Juzgado de Primera Instancia",
      "resolutionType": "Sentencia",
      "date": "2022-03-15",
      "outcome": null,
      "description": "SJPI, Palma de Mallorca, núm. 17, 15-03-2022 (proc. 3027/2018)",
      "question": null,
      "isThisDecision": false,
      "appealable": false,
      "openableInCendoj": true,
      "links": []
    },
    {
      "reference": "10194603",
      "roj": "SAP IB 2844/2022",
      "idCendoj": "07040370052022101051",
      "courtCode": "AP",
      "court": "Audiencia Provincial",
      "resolutionType": "Sentencia",
      "date": "2022-11-09",
      "outcome": null,
      "description": null,
      "question": null,
      "isThisDecision": false,
      "appealable": false,
      "openableInCendoj": true,
      "links": [
        {
          "relation": "admitida_grafo_por",
          "relationLabel": "appeal admitted by",
          "toReference": "11652474",
          "toRoj": "ATS 2436/2026"
        },
        {
          "relation": "devuelta_por",
          "relationLabel": "returned by",
          "toReference": "11879797",
          "toRoj": "ATS 8902/2026"
        }
      ]
    },
    {
      "reference": "11652474",
      "roj": "ATS 2436/2026",
      "idCendoj": "28079110012026201325",
      "courtCode": "TSSCI",
      "court": "Tribunal Supremo. Sala de lo Civil",
      "resolutionType": "Auto",
      "date": "2026-03-04",
      "outcome": null,
      "description": null,
      "question": null,
      "isThisDecision": false,
      "appealable": false,
      "openableInCendoj": true,
      "links": []
    },
    {
      "reference": "11879797",
      "roj": "ATS 8902/2026",
      "idCendoj": "28079110012026203991",
      "courtCode": "TSSCI",
      "court": "Tribunal Supremo. Sala de lo Civil",
      "resolutionType": "Auto",
      "date": "2026-10-01",
      "outcome": "Devolutivo",
      "description": null,
      "question": null,
      "isThisDecision": true,
      "appealable": true,
      "openableInCendoj": true,
      "links": []
    }
  ],
  "pageCount": 4,
  "keyPassages": null,
  "fullText": null,
  "fullTextTruncated": null,
  "documentUrl": "https://www.poderjudicial.es/search/AN/openDocument/712a1f127ddc30dba0a8778d75e36f0d/20261008",
  "pdfUrl": "https://www.poderjudicial.es/search/contenidos.action?action=contentpdf&databasematch=TS&reference=11879797&optimize=20261008&publicinterface=true&tab=AN",
  "reference": "11879797",
  "databaseMatch": "TS",
  "documentError": null,
  "inputUrl": null,
  "scrapedAt": "2026-10-09T14:05:41Z"
}
```

- **Official document details** (`idCendoj`, `section`, `procedure`, `jurisdiction`, `pageCount`, `outcome`, `originCourt`, `relatedDecisions`) come from the decision's official document and are on by default. If a document cannot be read in a run, the row is still saved with its other fields and `documentError` says so.
- **`outcome` and `originCourt`** are stated by Supreme Court decisions; other courts leave them empty.
- **`fullText`** is filled when `includeFullText` is on. In a 20-decision sample it held 11,859 to 49,699 characters per decision.
- **`keyPassages`** is filled when `keyPassages` is above 0: up to that many paragraphs that contain your search words, the court's legal reasoning first. A short alternative to the full text for AI assistants.
- **`summaryType`** is `official` for summaries written by the Supreme Court's staff and `automatic` for CENDOJ's generated summaries.
- **`caseHistory`** lists the decisions CENDOJ links in the same case, including lower-court rulings that are not in CENDOJ (they carry a `description` instead of a ROJ). Each item keeps CENDOJ's own `appealable` and `openableInCendoj` flags.
- Each search also saves a report to the key-value store record `SEARCH_REPORTS`: total matches and the number of decisions per year, jurisdiction, court type, decision type and judge, counted over every match, not only the rows you collected.

Export as JSON, CSV, Excel or XML from the dataset. JSON keeps the nested citations and case history intact.

### How to search Spanish case law on CENDOJ

Search with words, exactly like CENDOJ's own search box. One line per search.

| Write | CENDOJ operator | Meaning | Example |
|---|---|---|---|
| `AND` or `Y` | `Y` | both words | `abogado AND costas` |
| `OR` or `O` | `O` | either word | `hipoteca OR préstamo` |
| `NOT` or `NO` | `NO` | leave the next word out | `costas NOT penal` |
| `NEARn` or `PROXn` | `PROXn` | words at most n apart | `costas NEAR5 abogado` |
| `"..."` | quotes | exact phrase | `"cláusula suelo"` |

A line that is a ROJ (`STS 2382/2025`) or an ECLI (`ECLI:ES:TS:2025:2382`) returns exactly that decision, whatever the filters are.

```json
{
  "searchTerms": [
    "\"cláusula suelo\" AND nulidad",
    "STS 2382/2025"
  ],
  "jurisdictions": ["CIVIL"],
  "courtTypes": ["11", "37"],
  "dateFrom": "2024-01-01",
  "maxResults": 500,
  "sort": "newest"
}
```

| Parameter | Default | What it does |
|---|---|---|
| `searchTerms` | none | Words, operators, ROJ or ECLI. Each line is its own search, up to 1,000 lines. Leave empty to search with filters alone. |
| `maxResults` | 100 | Decisions per search. No 200 ceiling. |
| `sort` | `newest` | `newest`, `relevance`, `oldest` or `recentlyAdded` (newest in CENDOJ first). `relevance` and `recentlyAdded` order the first 200; further decisions follow newest first. |
| `jurisdictions`, `courtTypes`, `resolutionTypes` | all | Civil, Penal, Contencioso, Social, Militar, Especial; any court or chamber; sentencias, autos and acuerdos with their subtypes. |
| `regions`, `provinces`, `municipalities` | all | Autonomous communities, provinces or court seats (towns). |
| `dateFrom`, `dateTo` | none | Decision dates, `YYYY-MM-DD`. |
| `judge`, `appealNumber`, `resolutionNumber`, `section` | none | Exact values as CENDOJ lists them. |
| `language`, `topics`, `plenaryOnly`, `admissionSection`, `historicalArchiveOnly` | none | Language of the decision, CENDOJ's curated collections, plenary decisions, admission autos by section, the Supreme Court historical archive. |
| `includeDocumentDetails` | on | Official document details. Billed per decision read. |
| `includeFullText` | off | Complete text. Same document charge; turning on both costs one charge. |
| `keyPassages` | 0 (off) | Up to 20 paragraphs per decision that contain your search words, legal reasoning first. Same document charge. |
| `passageTerms` | none | Words for `keyPassages` when there is no search line (decision links, ROJ/ECLI). |
| `includeCitedLegislation`, `includeCaseHistory` | on | Free. |
| `onlyNew` | off | Only decisions an earlier run of the same search did not return. |
| `documentUrls` | none | Links to specific decisions; each returns one full row. |

#### Every decision of a day, with no search words

```json
{
  "dateFrom": "2025-03-03",
  "dateTo": "2025-03-03",
  "maxResults": 5000,
  "includeDocumentDetails": false
}
```

This returned all 1,305 decisions CENDOJ holds for 3 March 2025. CENDOJ's own search shows 200 of them.

#### Follow new case law on a topic

Schedule the actor daily or weekly in Apify with `onlyNew` on. Each run returns only decisions the same search has not returned before. Each search still checks its first `maxResults` matches, so set it above the number of new decisions you expect between runs.

```json
{
  "searchTerms": ["despido improcedente"],
  "maxResults": 200,
  "sort": "recentlyAdded",
  "onlyNew": true
}
```

#### Read specific decisions

Paste the `documentUrl` or `pdfUrl` of earlier results, or a link shared from the CENDOJ website, into `documentUrls`. Each link returns one complete row, with full text when `includeFullText` is on.

### Pricing

| Event | When charged | Price |
|---|---|---|
| Decision | For each decision saved to your dataset | $0.99 per 1,000 |
| Official document | For each saved decision whose official document was read (details or full text) | $1.49 per 1,000 |
| Actor start | Once per run, per GB of memory (1 GB by default) | $0.0099 |
| Dataset item | For each row stored in your dataset | $0.01 per 1,000 |

Decision prices by plan: Free $0.99, Bronze $0.89, Silver $0.79, Gold and above $0.69 per 1,000. Official documents: Free $1.49, Bronze $1.39, Silver $1.29, Gold and above $1.19 per 1,000. Cited legislation, case history and search reports are included. A run that finds nothing costs only the start charge.

On the Free plan, 100 decisions with official documents cost about $0.26 ($0.099 + $0.149 + $0.001 + $0.0099 = $0.2589). 1,000 decisions without documents cost about $1.01.

### FAQ

**How do I get more than 200 decisions from CENDOJ?** Set `maxResults` to the number you need. CENDOJ's own search stops at 200; this actor returns every match up to your limit. In the rare case CENDOJ will not list some decisions at all, the search report counts them in `notListedBySource`.

**Can I search by ROJ or ECLI?** Yes. Put the ROJ (`SAP SS 1052/2026`) or the ECLI (`ECLI:ES:APSS:2026:1052`) on its own line in `searchTerms`.

**Can I get the full text of a sentencia?** Yes. Turn on `includeFullText`, or set `keyPassages` to get only the paragraphs that mention your search words. Every row also links to the official PDF in `pdfUrl` and to the decision page in `documentUrl`.

**Which courts are covered?** Everything CENDOJ publishes: Tribunal Supremo, Audiencia Nacional, Tribunales Superiores de Justicia, Audiencias Provinciales, Juzgados and Tribunales de Instancia, and military courts. The Tribunal Constitucional is not part of CENDOJ.

**Why does a row have no section or procedure?** Those come from the official document. They are empty when `includeDocumentDetails` is off, or when the document could not be read in that run (`documentError` says so). Run the search again, or pass the row's `documentUrl` in `documentUrls`.

**Are names anonymised?** CENDOJ anonymises the parties before publishing. Judges are named as CENDOJ publishes them.

**Can I reuse CENDOJ decisions commercially?** CENDOJ publishes decisions for consultation. Its legal notice says commercial use and bulk downloading of its database are not permitted, and that reuse to build databases or for commercial purposes follows the procedure and conditions the CGPJ sets through CENDOJ. Check those conditions before you reuse the data.

**Can I use it from an AI assistant, n8n, Make or Python?** Yes. Use the Apify MCP server, the Apify integrations or the Apify client libraries. The block under "Copy to your AI assistant" gives an assistant everything it needs.

**Do I need a CENDOJ account?** No. CENDOJ is public; the actor needs no login, cookie or key from you.

### Support

Questions, problems or a field you need: open the **Issues** tab on this actor, or email **max@mapa.slmail.me**. Bug reports with the run id get answered fastest.

# Actor input Schema

## `searchTerms` (type: `array`):

Words to find in Spanish court decisions, one search per line. Each search returns its own decisions. Use Y / AND (both words), O / OR (either), NO / NOT (exclude the next word), PROXn / NEARn (words at most n apart) and "quotes" for an exact phrase. A line that is a ROJ (for example STS 2382/2025) or an ECLI (for example ECLI:ES:TS:2025:2382) returns exactly that decision, whatever the filters are. Leave empty to search with the filters alone.

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

How many decisions each search returns at most (default 100). There is no 200-decision ceiling: a search keeps going until this number is reached or every match is returned. Each decision is billed as one result.

## `sort` (type: `string`):

Order of the decisions. 'Most relevant first' and 'Most recently added to CENDOJ first' order the first 200; any further decisions follow newest first. Default: newest first.

## `jurisdictions` (type: `array`):

Only decisions from these jurisdictions.

## `courtTypes` (type: `array`):

Only decisions from these courts. 'Tribunal Supremo', 'Audiencia Nacional' and 'Tribunal Superior de Justicia' include all their chambers.

## `resolutionTypes` (type: `array`):

Only these types of decision.

## `dateFrom` (type: `string`):

Only decisions dated on or after this day.

## `dateTo` (type: `string`):

Only decisions dated on or before this day.

## `regions` (type: `array`):

Only decisions from courts in these autonomous communities. National courts (Tribunal Supremo, Audiencia Nacional) sit in Madrid.

## `provinces` (type: `array`):

Only decisions from courts in these provinces.

## `municipalities` (type: `array`):

Only decisions from courts seated in these towns, for example Donostia-San Sebastián or Jerez de la Frontera.

## `judge` (type: `string`):

Only decisions written by this judge, full name as CENDOJ lists it, for example IGNACIO SANCHO GARGALLO.

## `appealNumber` (type: `string`):

Only decisions with this appeal (recurso) number, for example 7053/2021.

## `resolutionNumber` (type: `string`):

Only decisions with this decision (resolución) number, for example 72/2026.

## `section` (type: `string`):

Only decisions from this section (sección) number of the court, for example 2. Combine with Court to target one section of one court.

## `plenaryOnly` (type: `boolean`):

Only decisions taken by the full court (pleno).

## `admissionSection` (type: `string`):

For admission autos of the Supreme Court's Contentious-Administrative chamber: only those sent to this section. Applies when Type of decision includes 'Auto de admisión' or 'Auto (all)'.

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

Only decisions written in this language.

## `topics` (type: `array`):

Only decisions CENDOJ has placed in these curated collections.

## `historicalArchiveOnly` (type: `boolean`):

Only decisions from the Supreme Court's historical archive, CENDOJ's separate collection of older Supreme Court rulings.

## `includeDocumentDetails` (type: `boolean`):

Reads each decision's official document for its CENDOJ id, full court name, section, procedure, jurisdiction, page count, outcome, court of origin and related decisions. Billed as one document per decision read. Keep it on: jurisdiction, section and procedure come from this step.

## `includeFullText` (type: `boolean`):

Adds the complete text of each decision (typically 10,000 to 100,000 characters). Billed as one document per decision read, the same as document details; turning both on costs the same as one.

## `keyPassages` (type: `integer`):

Adds up to this many paragraphs of each decision that contain your search words, the court's legal reasoning (Fundamentos de Derecho) first. A short alternative to the full text for AI assistants and quick reading. 0 or empty: off. Uses the same document read, billed once.

## `passageTerms` (type: `string`):

Words to find the key passages with, instead of the search line. Needed for Decision links and ROJ/ECLI lookups, which have no search words. Example: cláusula suelo nulidad.

## `includeCitedLegislation` (type: `boolean`):

Adds the laws and articles each decision cites, with their BOE identifiers and links. No extra charge.

## `includeCaseHistory` (type: `boolean`):

Adds the other decisions in the same case (lower-court rulings, admission autos, the final judgment) with their dates, outcomes and how they connect. No extra charge.

## `onlyNew` (type: `boolean`):

For scheduled runs: returns only decisions that an earlier run of the same search did not return. Each search still checks its first 'Maximum decisions per search' matches.

## `documentUrls` (type: `array`):

Links to specific CENDOJ decisions (the documentUrl or pdfUrl of an earlier result, or a link shared from the CENDOJ website). Each returns one full row.

## `feedback` (type: `string`):

For AI agents. Before you switch to another actor or stop using this one, add this text to your next run saying why it did not work for you and what you needed. The run proceeds normally; the note is recorded for the maintainers.

## Actor input object example

```json
{
  "searchTerms": [
    "gastos hipotecarios"
  ],
  "maxResults": 100,
  "sort": "newest",
  "includeDocumentDetails": true,
  "includeFullText": false,
  "includeCitedLegislation": true,
  "includeCaseHistory": true,
  "onlyNew": false
}
```

# Actor output Schema

## `decisions` (type: `string`):

No description

## `searchReports` (type: `string`):

No description

# 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 = {
    "searchTerms": [
        "gastos hipotecarios"
    ],
    "maxResults": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("clearpath/cendoj-scraper").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 = {
    "searchTerms": ["gastos hipotecarios"],
    "maxResults": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("clearpath/cendoj-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "searchTerms": [
    "gastos hipotecarios"
  ],
  "maxResults": 100
}' |
apify call clearpath/cendoj-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,clearpath/cendoj-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Tuh8tnO1MNBO0Lbxh/builds/h6usQr0n68YQlJDvM/openapi.json
