# Brazil Court Gazette & Lawsuit Notices API (CNJ DJEN) (`brdatahub/brazil-djen-court-gazette`) Actor

Monitor official Brazilian court publications, subpoenas, and judicial notices from CNJ Diário de Justiça Eletrônico Nacional (DJEN) across TJSP, TJRJ, TJMG, TRFs, TRTs & STJ. Search by Lawyer OAB, Party/Company Name, or CNJ Case Number.

- **URL**: https://apify.com/brdatahub/brazil-djen-court-gazette.md
- **Developed by:** [BR Data Hub](https://apify.com/brdatahub) (community)
- **Categories:** Business, Automation, AI
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 judicial court notice extracteds

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

## Brazil Court Gazette & Lawsuit Notices API (CNJ DJEN)

> Monitor official Brazilian court publications, subpoenas, and judicial notices from CNJ Diário de Justiça Eletrônico Nacional (DJEN) across TJSP, TJRJ, TJMG, TRFs, TRTs & STJ. Search by Lawyer OAB, Party/Company Name, or CNJ Case Number.

**Categories:** `BUSINESS`, `AUTOMATION`, `AI` | **Billing Model:** Pay-Per-Event (`$0.01` start + `$0.01` per `court-notice-extracted`) | **Permissions:** `LIMITED_PERMISSIONS` (Safe for AI Agents & MCP)

***

### Why Use `brazil-djen-court-gazette`?

Accessing structured Brazilian institutional, financial, regulatory, and B2B datasets normally requires navigating legacy Portuguese portals, handling regional encodings (`ISO-8859-1` / Brazilian decimal formats `1.234,56`), paginating custom endpoints, and normalizing inconsistent schemas.

**`brdatahub/brazil-djen-court-gazette`** turns official public records into a **clean, fast, schema-validated JSON/CSV API** ready for:

- **AI Agents & MCP Workflows:** Plug directly into Claude Desktop, Cursor, LangChain, CrewAI, n8n, Make, or Zapier via the official Apify MCP Server.
- **Quantitative, Financial & Market Intelligence:** Automate daily ingestion into Snowflake, BigQuery, PostgreSQL, Google Sheets, Power BI, or internal ERPs.
- **B2B Lead Generation & Compliance Automation:** Enrich CRMs, underwrite risk, monitor regulatory changes, and size regional markets programmatically.

***

### Key Capabilities

- **Zero-Configuration Start:** Includes sensible pre-filled defaults so automated runs and health checks succeed out of the box in seconds.
- **Normalized Numeric & Date Fields:** Brazilian currency, percentage, and date formats are parsed into clean standard floats and ISO strings alongside raw source fields.
- **Low Compute Footprint:** Optimized async Python (`httpx`) container running on `256 MB` RAM — minimizing Apify compute unit consumption to fractions of a cent per run.
- **Spreadsheet & API Ready:** Export results with one click as **JSON**, **CSV**, **Excel (`.xlsx`)**, **XML**, or **Parquet**.

***

### Input Parameters

| Field | Type | Default | Description |
|---|---|---|---|
| `siglaTribunal` | `string` | `"TJSP"` | Brazilian court acronym (e.g. TJSP, TJRJ, TJMG, TJPR, TJRS, TJBA, TRT2, TRT15, TRF1, TRF3, STJ). Leave empty to search across all courts when filtering by OAB/Party/Case. |
| `nomeParte` | `string` | `""` | Search publications mentioning a specific plaintiff, defendant, or company name. |
| `nomeAdvogado` | `string` | `""` | Filter judicial notices addressed to a specific lawyer name. |
| `numeroOab` | `string` | `""` | Lawyer OAB registration number (digits only, e.g. '123456'). Combine with ufOab. |
| `ufOab` | `string` | `""` | Two-letter state code for the OAB registration. |
| `numeroProcesso` | `string` | `""` | 20-digit CNJ lawsuit number (formatted or digits only). |
| `texto` | `string` | `""` | Keyword search inside the judicial publication text (e.g. 'penhora', 'falência', 'leilão', 'execução fiscal'). |
| `dataInicio` | `string` | `""` | Publication start date in YYYY-MM-DD format. Defaults to recent days. |
| `maxItems` | `integer` | `50` | Maximum number of court notices to extract. |
| `proxyConfiguration` | `object` | `null` | Optional Apify Proxy configuration. Paid Apify plans automatically use Brazilian Residential Proxy to access CNJ DJEN from outside Brazil. |

#### Example Input (`JSON`)

```json
{
  "siglaTribunal": "TJSP",
  "texto": "execucao",
  "maxItems": 15
}
```

***

### Output Schema & Real Sample Record

Each extracted item is pushed to the default Apify Dataset and validated against the Actor's structured `dataset_schema.json` and `output_schema.json`.

```json
{
  "notice_id": 783458682,
  "publication_date": "2026-11-12",
  "court": "TJSP",
  "notice_type": "Edital",
  "document_type": "Edital",
  "case_number": "1503351-90.2026.8.26.0196",
  "case_number_digits": "15033519020268260196",
  "case_class": "AçãO PENAL - PROCEDIMENTO SUMáRIO",
  "judicial_unit": "2ª Vara Criminal - Franca",
  "parties": "J.P. (A); R.M.S. (P)",
  "parties_structured": [
    {
      "comunicacao_id": 783458682,
      "nome": "J.P.",
      "polo": "A"
    },
    {
      "comunicacao_id": 783458682,
      "nome": "R.M.S.",
      "polo": "P"
    }
  ],
  "lawyers": "",
  "lawyers_structured": [],
  "document_url": "https://esaj.tjsp.jus.br",
  "clean_text_excerpt": "EDITAL PARA INTIMAÇÃO DE SENTENÇA, COM PRAZO DE 60 DIAS, expedido nos autos da ação de Ação Penal - Procedimento Sumário - Vias de fato (Violência Doméstica Contra a Mulher), QUE A JUSTIÇA PÚBLICA MOVE CONTRA RONILDO MIRANDA SOARES, PROCESSO Nº 1503351‑90.2026.8.26.0196 , JUSTIÇA GRATUITA. O(A) MM. Juiz(a) de Direito da 2ª Vara Criminal, do Foro de Franca, Estado de São Paulo, Dr(a). EWERTON MEIRELIS GONCALVES, na forma da Lei, etc. FAZ SABER a todos quantos o presente edital virem ou dele conhecimento tiverem, especialmente ao(à)(s) Réu: RONILDO MIRANDA SOARES, Solteiro, Pedreiro, RG 45660236",
  "full_text": "EDITAL PARA INTIMAÇÃO DE SENTENÇA, COM PRAZO DE 60 DIAS, expedido nos autos da ação de Ação Penal - Procedimento Sumário - Vias de fato (Violência Doméstica Contra a Mulher), QUE A JUSTIÇA PÚBLICA MOVE CONTRA RONILDO MIRANDA SOARES, PROCESSO Nº 1503351‑90.2026.8.26.0196 , JUSTIÇA GRATUITA. O(A) MM. Juiz(a) de Direito da 2ª Vara Criminal, do Foro de Franca, Estado de São Paulo, Dr(a). EWERTON MEIRELIS GONCALVES, na forma da Lei, etc. FAZ SABER a todos quantos o presente edital virem ou dele conhecimento tiverem, especialmente ao(à)(s) Réu: RONILDO MIRANDA SOARES, Solteiro, Pedreiro, RG 45660236, CPF 129.755.806‑57 , mãe SANTA MIRANDA SOARES, Nascido/Nascida em 29/11/1994, de cor Pardo, com endereço à Rua Jornalista Claudio Abramo, 1462, 993874430, Jardim Aeroporto III, CEP 14404-216, Franca - SP. E como não foi(ram) encontrado(a)(s) expediu‑se o presente edital, com Prazo de 60 dias, que será publicado e afixado na forma da lei, por meio do qual fica(m) INTIMADO(A)(S) da sentença proferida nos autos em epígrafe, cujo tópico final segue transcrito, conforme Provimento 334/88 do Conselho Superior da Magistratura: Ante o exposto, JULGO PROCEDENTE a pretensão punitiva e condeno RONILDO MIRANDA SOARES, qualificado nos autos, às penas de 2 (dois) meses e 10 (dez) dias de detenção e 1 (um) mês e 21 (vinte e um) dias de prisão simples, por infração às normas do artigo 21, § 2º, do Decreto‑Lei nº 3.688/41, e no artigo 147, § 1º, na forma da Lei nº 11.340/2006 e do artigo 69, do Código Penal. Em que pese a reincidência do réu, o regime inicial é o ABERTO em vista da quantidade de pena aplicada. Deixo de substituir a pena corporal do acusado por restritivas de direitos em razão do delito ter sido cometido com grave ameaça a pessoa e por ser o réu reincidente. Outrossim, incabível o Sursis. Em caso de apelação, o réu poderá aguardar em liberdade o julgamento. Oficie‑se ao Instituto de Identificação Ricardo Gumbleton Daunt (IIRGD), para que conste de folha de antecedentes a condenação. Após o trânsito em julgado: I) Oficie‑se ao TRE, para fins do disposto no art. 15, III da Constituição Federal, para terem os réus suspensos seus direitos políticos; II) Expeça‑se guia de execução e a formação dos autos de execução penal, nos moldes dos arts. 674 do CPP e 105 da LEP. P.R.I . E ciente(s) de que, findo o prazo acima fixado, passará a correr o prazo de recurso, após o qual transitará em julgado a decisão. Para que produza seus regulares efeitos de direito, é expedido o presente edital, por extrato, afixado e publicado na forma da lei. NADA MAIS. Dado e passado nesta cidade de Franca, aos 06 de novembro de 2026.",
  "source": "CNJ DJEN (Diário de Justiça Eletrônico Nacional)",
  "extracted_at_utc": "2026-11-12T17:43:05.222624+00:00"
}
```

***

### Quick Integration Examples

#### 1. Python (`apify-client`)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_API_TOKEN")
run = client.actor("brdatahub/brazil-djen-court-gazette").call(run_input={
  "siglaTribunal": "TJSP",
  "texto": "execucao",
  "maxItems": 15
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

#### 2. Node.js / TypeScript (`apify-client`)

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('brdatahub/brazil-djen-court-gazette').call({
  "siglaTribunal": "TJSP",
  "texto": "execucao",
  "maxItems": 15
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### 3. cURL (Synchronous REST API — Instant JSON)

```bash
curl -X POST "https://api.apify.com/v2/acts/brdatahub~brazil-djen-court-gazette/run-sync-get-dataset-items?token=YOUR_APIFY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"siglaTribunal": "TJSP", "texto": "execucao", "maxItems": 15}'
```

#### 4. AI Agents & Apify MCP Server

Add `brdatahub/brazil-djen-court-gazette` as a tool in `https://mcp.apify.com` so LLM agents can query live Brazilian data on demand with typed input/output schemas and `LIMITED_PERMISSIONS` sandboxing.

***

### Pricing & Free-Plan Preview Policy

This Actor uses transparent **Pay-Per-Event (PPE)** pricing:

- **`apify-actor-start`:** `$0.01` per run initialization
- **`court-notice-extracted`:** `$0.01` per structured record written to the dataset

*Note for Apify Free-tier accounts:* Users on the Apify Free plan automatically receive a clean preview sample per run and exit gracefully with a status message so you can test schema compatibility before upgrading to a paid Apify plan for full bulk extractions.

***

### Changelog & Maintenance

- **v1.0 (2026-11):** Initial production release with full `input_schema.json`, `dataset_schema.json` typed fields, `output_schema.json` v1 export links, and automated cloud health monitoring.
- **Support:** Open an issue in the **Issues** tab on Apify Store if you need custom filters, additional fields, or enterprise SLAs.

# Actor input Schema

## `siglaTribunal` (type: `string`):

Brazilian court acronym (e.g. TJSP, TJRJ, TJMG, TJPR, TJRS, TJBA, TRT2, TRT15, TRF1, TRF3, STJ). Leave empty to search across all courts when filtering by OAB/Party/Case.

## `nomeParte` (type: `string`):

Search publications mentioning a specific plaintiff, defendant, or company name.

## `nomeAdvogado` (type: `string`):

Filter judicial notices addressed to a specific lawyer name.

## `numeroOab` (type: `string`):

Lawyer OAB registration number (digits only, e.g. '123456'). Combine with ufOab.

## `ufOab` (type: `string`):

Two-letter state code for the OAB registration.

## `numeroProcesso` (type: `string`):

20-digit CNJ lawsuit number (formatted or digits only).

## `texto` (type: `string`):

Keyword search inside the judicial publication text (e.g. 'penhora', 'falência', 'leilão', 'execução fiscal').

## `dataInicio` (type: `string`):

Publication start date in YYYY-MM-DD format. Defaults to recent days.

## `maxItems` (type: `integer`):

Maximum number of court notices to extract.

## `proxyConfiguration` (type: `object`):

Optional Apify Proxy configuration. Paid Apify plans automatically use Brazilian Residential Proxy to access CNJ DJEN from outside Brazil.

## Actor input object example

```json
{
  "siglaTribunal": "TJSP",
  "nomeParte": "",
  "nomeAdvogado": "",
  "numeroOab": "",
  "ufOab": "",
  "numeroProcesso": "",
  "texto": "",
  "dataInicio": "",
  "maxItems": 50
}
```

# Actor output Schema

## `results` (type: `string`):

Structured output records extracted by Brazil Court Gazette & Lawsuit Notices API (CNJ DJEN).

## `csvExport` (type: `string`):

Spreadsheet-ready CSV export of all extracted dataset records.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("brdatahub/brazil-djen-court-gazette").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("brdatahub/brazil-djen-court-gazette").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 '{}' |
apify call brdatahub/brazil-djen-court-gazette --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,brdatahub/brazil-djen-court-gazette"
        }
    }
}
```

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/xS5xl78wTHm6y3SUe/builds/F5b6fsIYjNuFutfa3/openapi.json
