# Italy Constitutional Court Decisions — Official Open Data (`promptica/italy-constitutional-court-decisions`) Actor

Italian Constitutional Court decisions and official summaries since 1956, with full text, filters and persistent monitoring. CC BY-SA 3.0 attribution included.

- **URL**: https://apify.com/promptica/italy-constitutional-court-decisions.md
- **Developed by:** [Lorenzo Talamucci](https://apify.com/promptica) (community)
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $5.00 / 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/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

## Italy Constitutional Court Decisions Scraper — Official Open Data

Extract judgments and orders of Italy's **Corte costituzionale** from its official open-data archives, covering 1956 onwards. Designed for legal research, law firms, legaltech, compliance and retrieval-augmented generation (RAG) pipelines.

### Quick start

```json
{"maxResults":3,"includiTesto":true}
```

```json
{"annoDa":2020,"annoA":2025,"tipo":"sentenza","giudizio":"incidentale","ricerca":"Toscana","maxResults":100}
```

```json
{"anno":2025,"numero":1,"soloNuove":true,"monitorNome":"my-court-search","maxResults":1}
```

Use `anno` for one year or `annoDa`/`annoA` for a range, never both. With no year input, the current UTC year is selected. Types: `tutti`, `sentenza`, `ordinanza`. Proceedings: `tutti`, `incidentale`, `principale`, `conflitto`. `numero` matches an exact decision number; `ricerca` is a case-insensitive substring search across full text and official summaries, even when full text is not exported. A missing proceeding in the source cannot match a specific proceeding filter.

`maxResults` (default 20, 1–50,000) bounds the **matching window**, including already seen decisions. Ordering is year descending, then number descending. For a historical export exceeding this window, split by year or increase the limit. Broad ranges can reach the time limit: check `OUTPUT.partial` and split the years; there is no automatic pagination cursor.

### Output

| Field | Meaning |
|---|---|
| `id`, `court`, `type`, `number`, `year` | Stable year/number/type identity; type is `judgment` or `order` |
| `decisionDate`, `depositDate` | ISO dates, or null if unavailable |
| `judgmentType` | Official Italian proceeding classification |
| `subject`, `summary` | Joined official massima headings and texts; null when not yet published |
| `fullText` | Source panel, introduction, reasoning and operative provisions; only with `includiTesto` |
| `ecli`, `sourceUrl` | Source-provided ECLI and official decision page |
| `license`, `attribution` | Mandatory source license and credit retained in every record |

Text is decoded from the source encoding, HTML entities are decoded, line endings normalized, and sections joined. No AI-generated summaries, guessed ECLI or inferred proceeding labels. Null means the source does not provide that value, not an extraction of a blank legal conclusion.

### Monitoring

`soloNuove` uses the named Apify key-value store `monitorNome`. First run emits unseen decisions in the matching window; later runs emit only previously unseen identities. **Revisions and newly published massime for an already delivered decision are not emitted again.** Use a separate store for each query/output mode, and avoid concurrent runs sharing a monitor name. Increasing `maxResults` can expose more historical decisions. Records are marked seen only after dataset delivery. Delivery and monitor persistence are not atomic: interrupted runs can replay a delivered record, but do not intentionally discard undelivered records. Deduplicate downstream by `id`.

### Pricing (configuration proposed to the publisher)

| Event | Proposed price |
|---|---:|
| Actor start, at 1 GB | $0.05 |
| Dataset decision | $0.005 |
| `testo-integrale`, when requested and nonempty | additional $0.02 |

Apify's Store pricing is authoritative; these prices must be configured by the publisher. The standard dataset event is billed by `Actor.pushData`; the premium event uses `Actor.charge`. Unknown/unconfigured premium events warn once and do not stop extraction. Billing failures and exhausted budgets stop further delivery without retrying ambiguous charges. Premium charging follows successful storage and monitor persistence. These platform writes are not atomic: an interruption can leave delivered text uncharged. An ambiguous billing error is reported without an automatic retry.

### Source, attribution and share-alike

Source: Corte costituzionale Open Data (dati.cortecostituzionale.it) and official bulk downloads (dati.cortecostituzionale.it). Source data are supplied under **CC BY-SA 3.0 (creativecommons.org)**. Commercial reuse is allowed subject to the license, including **attribution and share-alike**. Keep the source credit and license link, identify modifications, and distribute adaptations under the same or a permitted compatible license. This Actor does not grant exclusive rights or relicense the source under MIT. Respect the applicable conditions when redistributing legal text or building derivative datasets.

Attribution in every row: “Corte costituzionale, dati.cortecostituzionale.it — CC BY-SA 3.0. Structured and normalized by Promptica.” Fixtures are real source records under the same license. No affiliation with or endorsement by the Court is implied.

The official pages describe approximately 18,000–20,000 historical decisions, not a current measured total. They give inconsistent daily/weekly update descriptions; no update-frequency SLA is promised. The massime ZIP whose filename ends in `2001_2015` is the official current link and contains later annual archives (through 2026 at verification).

### Reliability and limitations

Node 22, default 1 GB. The source publishes only multi-year bulk ZIP URLs (2001-current: about 56 MB decisions + 11 MB massime at verification). No public annual URL was verified. A cold single-year run extracts and caches only the official nested annual ZIPs in the named key-value store `corte-annual-cache-v1`. Each later run checks live source ETag/Last-Modified/size before using those smaller files; changed source or corrupt cache forces a fresh bulk download. Cache outages fall back to the source; a failed freshness check never serves stale data. Multi-year exports still download the relevant bulk partitions. The prefill requests the current UTC year implicitly and three results, so it does not become a fixed historical year next January.

Every download starts **directly, also in cloud**. The Apify proxy is initialized lazily only after two direct TimeoutErrors for that request; proxy failures cannot delay a successful direct request. Four attempts maximum with backoff. Header/connect and idle-read timeouts detect stalled transfers; total body time scales with announced size (30 seconds plus bytes at a conservative 128 KiB/s). The platform deadline still overrides downloads. Interrupted transfers resume using Range + If-Range only with a source validator and advertised support; Content-Range and validators are checked. If the source returns 200 instead of 206, partial bytes are discarded before restarting. At verification this source advertised Range but ignored it: resumption cannot be forced. No login or CAPTCHA bypass.

Only selected annual JSON files are expanded; at most one year of decisions and massime is parsed together. Downloads and ZIP expansion have hard size caps. Under-five-minute operation is a cloud acceptance criterion, not a guarantee during source outages. Cache cold/invalidated runs still need the full relevant ZIPs.

Internal deadline: the platform `timeoutAt` minus 30 seconds. Without a platform timeout (including local runs), no fixed total-duration cap applies. Invalid input, unavailable source, archive errors and deadlines return controlled completion with any delivered rows preserved. Always inspect `OUTPUT.error`, `OUTPUT.partial` and the terminal status: **SUCCEEDED alone does not prove a complete extraction**. External process termination, platform faults and out-of-memory events cannot be guaranteed recoverable. No claim of zero future failures.

### Development and provenance

```bash
npm ci
npm test
apify run --input-file test/prefill.json
apify run --input-file test/monitor.json
apify run --input-file test/monitor.json
```

`test/collaudo.json` defines the seven cloud verification cases; this repository's factory runner executes them only under the publisher's authorization. Local smoke evidence is in `test/results.json`.

Implementation reuses the repository's PVP retry/runtime/main pattern, `yauzl` for bounded ZIP reads and `he` for entities. Synthos-Logic/giurisprudenza-db, consulta.py (github.com) (MIT) was inspected as a reference for nested yearly ZIPs and the year/number/type join; its Python scraper is not bundled or executed.

### Italiano

Scarica sentenze e ordinanze della Corte costituzionale dagli open data ufficiali, con massime quando presenti e testo integrale facoltativo. Filtra anno/intervallo, tipo, numero, giudizio e testo. `soloNuove` conserva gli identificativi in uno store nominato: stessa ricerca, stesso `monitorNome`, senza esecuzioni concorrenti. Non ripropone aggiornamenti di pronunce già viste. Conservare attribuzione e licenza CC BY-SA 3.0, rispettando lo share-alike. Controllare sempre `OUTPUT` per errori o risultati parziali.

### Altri dati pubblici italiani / More Italian public data

Italy Public Data by Promptica — altri dataset / other datasets:

- [Italy Public Procurement — ANAC CIG](https://apify.com/promptica/anac-appalti-italia) — Estrae i bandi di gara pubblici italiani (CIG) dagli open data ufficiali ANAC, inclusi gli affidamenti sotto soglia UE che TED non copre. Filtra per CPV, provincia, importo, stazione appaltante, oggetto e settore. Dati 100% pubblici.
- [Estrai aste giudiziarie PVP — Perizie e monitor](https://apify.com/promptica/aste-giudiziarie-pvp) — Aste giudiziarie PVP: estrai immobili, prezzi, date, tribunali e link alle perizie dal portale ufficiale. Filtri e monitor delle aste nuove o cambiate.
- [EPREL — EU Energy Label Database (etichette energetiche UE)](https://apify.com/promptica/eprel-etichette-energetiche) — Estrae dati pubblici dal registro EPREL della Commissione Europea sulle etichette energetiche: classe, consumi, parametri tecnici, produttore. Utile per e-commerce compliance (Reg. UE 2017/1369).
- [Italy & Spain Fuel Prices Scraper — MIMIT / MITECO](https://apify.com/promptica/europe-fuel-prices-italy-spain) — Official station-level fuel prices, location and brand filters, radius search and persistent price-change monitoring for Italy and Spain.
- [Gazzetta Ufficiale RAG — Leggi, Decreti e Concorsi (Italia)](https://apify.com/promptica/gazzetta-ufficiale-rag) — Estrae atti normativi e concorsi pubblici dalla Gazzetta Ufficiale italiana (gazzettaufficiale.it) come record Markdown strutturati, pronti per pipeline RAG. Filtra per serie, tipo atto, data, e parola chiave. Dati 100% pubblici, nessuna chiave API.
- [inPA Concorsi Pubblici — Portale del reclutamento](https://apify.com/promptica/inpa-concorsi-pubblici) — Estrae i concorsi pubblici e gli avvisi di selezione della PA italiana dal portale ufficiale inPA. Filtra per ente, parola chiave, numero minimo di posti e data. Dati 100% pubblici.
- [Italy Administrative Court Rulings Scraper — OpenGA](https://apify.com/promptica/italy-administrative-court-rulings-openga) — Official Italian administrative court CSV metadata: Consiglio di Stato, CGARS and TAR, licensed CC BY 4.0, filters and persistent monitoring.
- [Estrai fornitori MePA e Consip — Elenco ufficiale imprese PA](https://apify.com/promptica/italy-consip-suppliers) — Fornitori MePA e Consip: imprese abilitate e aggiudicatarie della PA con partita IVA, sede, aggiudicazioni e contratti attivi. Open data ufficiali.
- [Estrai PEC enti pubblici — Indice IPA: comuni ed enti (AgID)](https://apify.com/promptica/italy-ipa-public-bodies) — PEC degli enti pubblici italiani dall'Indice IPA di AgID: comuni, enti e stazioni appaltanti con codice fiscale, indirizzo, sito e email istituzionali.
- [Scarica elenco farmacie italiane — Anagrafe Ministero Salute](https://apify.com/promptica/italy-pharmacies) — Elenco farmacie italiane dall'anagrafe ufficiale del Ministero della Salute: nome, partita IVA, indirizzo, comune e provincia. Filtri, storico e monitor.
- [Estrai aste immobili Demanio — Immobili dello Stato in vendita](https://apify.com/promptica/italy-state-property-sales) — Aste immobili dell'Agenzia del Demanio: immobili dello Stato in vendita con prezzo base, scadenza offerte, luogo, superficie e bandi. Filtri e monitor.
- [TED Gare d'Appalto EU](https://apify.com/promptica/ted-gare-eu) — Estrae bandi di gara pubblici europei dal portale ufficiale TED (Tenders Electronic Daily, Gazzetta Ufficiale UE). Dati 100% pubblici via API ufficiale TED. Filtra per codice CPV, paese, parole chiave e data.

# Actor input Schema

## `anno` (type: `integer`):

Optional exact year. Omit year/range to use the current UTC year automatically.

## `annoDa` (type: `integer`):

Use anno OR annoDa/annoA.

## `annoA` (type: `integer`):

Use anno OR annoDa/annoA.

## `numero` (type: `integer`):

Exact decision number.

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

Number of matching decisions to inspect, including already seen decisions.

## `tipo` (type: `string`):

All values, or select the required category.

## `giudizio` (type: `string`):

All values, or select the required category.

## `ricerca` (type: `string`):

Case-insensitive substring in text, headings and official summaries.

## `includiTesto` (type: `boolean`):

Full text triggers premium charge when available.

## `soloNuove` (type: `boolean`):

Persistent deduplication by decision identity within maxResults matching window.

## `monitorNome` (type: `string`):

Use a distinct store for each saved search. Do not run the same monitor concurrently.

## Actor input object example

```json
{
  "maxResults": 3,
  "tipo": "tutti",
  "giudizio": "tutti",
  "includiTesto": false,
  "soloNuove": false,
  "monitorNome": "corte-monitor"
}
```

# Actor output Schema

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

No description

## `summary` (type: `string`):

No description

## `diagnostics` (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 = {
    "maxResults": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("promptica/italy-constitutional-court-decisions").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 = { "maxResults": 3 }

# Run the Actor and wait for it to finish
run = client.actor("promptica/italy-constitutional-court-decisions").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 '{
  "maxResults": 3
}' |
apify call promptica/italy-constitutional-court-decisions --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,promptica/italy-constitutional-court-decisions"
        }
    }
}
```

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/1q94bnLZOlXvmp9Qf/builds/JmsooUHt4H6R3PyTj/openapi.json
