# eproc Scraper (`national_scrim/eproc-scraper`) Actor

Consulta pública eproc/PJe-style por número CNJ, sem login.

- **URL**: https://apify.com/national\_scrim/eproc-scraper.md
- **Developed by:** [Bruno-Arantir](https://apify.com/national_scrim) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## eproc Scraper

**Public eproc / PJe-style Brazilian court lookup by CNJ number — no lawyer login.**

Consulte andamentos **públicos** de instâncias eproc (consulta pública) para monitoramento processual. Sem senha de advogado, sem cookie de parte, sem CAPTCHA solve.

- **Fonte principal (sem CAPTCHA):** [DataJud API Pública do CNJ](https://datajud-wiki.cnj.jus.br/api-publica/acesso/) — busca por número CNJ, alias automático (`8.13` → `tjmg`, `4.04` → `trf4`).
- Fallback: HTML da consulta pública eproc. CAPTCHA/login = fail closed.
- `sessionCookies` (opcional): cole o Cookie da **sua** sessão pública. Sem solve de CAPTCHA e sem cookies de terceiros.
- Dedup pelo CNJ (20 dígitos). Teto `maxItems` 5.000.

### Instâncias suportadas (descobertas)

Todas usam o padrão `externo_controlador.php?acao=processo_consulta_publica`:

| id | Sistema | Base URL pública |
| --- | --- | --- |
| `trf4` | TRF4 eproc2 | `https://eproc.trf4.jus.br/eproc2trf4` |
| `tjmg-eproc` | TJMG eproc 1º grau | `https://eproc-consulta-publica-1g.tjmg.jus.br/eproc` |
| `tjsp-eproc` | TJSP eproc 1º grau | `https://eproc1g.tjsp.jus.br/eproc` |
| `jfrj` | JF Rio de Janeiro | `https://eproc.jfrj.jus.br/eproc` |
| `jfes` | JF Espírito Santo | `https://eproc.jfes.jus.br/eproc` |
| `jfpr` | JF Paraná | `https://eproc.jfpr.jus.br/eproc` |
| `jfrs` | JF Rio Grande do Sul | `https://eproc.jfrs.jus.br/eproc` |
| `jfsc` | JF Santa Catarina | `https://eproc.jfsc.jus.br/eproc` |
| `custom` | Outro eproc multi-tenant | `baseUrl` informado |

Path canônico: `{baseUrl}/externo_controlador.php?acao=processo_consulta_publica`.

**HTML eproc:** TJMG e JFRJ costumam exibir `txtInfraCaptcha`. Sem cookie próprio, o Actor **não resolve** CAPTCHA — usa DataJud ou falha fechado.

**Proxy (HTML):** Apify Console → Use Apify Proxy → grupo **RESIDENTIAL** → country **BR**. DataJud geralmente não precisa de proxy.

Não cobre PJe autenticado, Projudi interno, nem teses/inteiro teor restrito.

### Amostra de saída

Exemplo ilustrativo do HTML público de resultado (campos variam por tribunal).

```json
{
  "processNumber": "5001234-56.2023.4.04.0000",
  "class": "Apelação Cível",
  "subject": "Direito administrativo",
  "court": "TRF4 / 4ª Turma",
  "parties": ["AUTOR: Exemplo Ltda", "RÉU: União"],
  "lastMovementDate": "2026-08-20T00:00:00.000Z",
  "lastMovementSummary": "Juntada de petição",
  "status": "Em tramitação",
  "sourceUrl": "https://eproc.trf4.jus.br/eproc2trf4/externo_controlador.php?acao=processo_consulta_publica"
}
```

### Configuração

| Campo | Default | Descrição |
| --- | --- | --- |
| `processNumbers` | — | Lista CNJ |
| `instance` | trf4 | Preset da tabela |
| `baseUrl` | — | Obrigatório se custom |
| `maxItems` | 20 | Teto 5.000 |
| `delayMs` | 800 | Pausa entre consultas |
| `proxyConfiguration` | — | Opcional |

### PPE

Evento `dataset-item`: **US$ 5,00 / 1.000 processos** sugerido (CAPTCHA/login walls, HTML heterogêneo).

### LGPD / ética

Andamentos e nomes de partes em consulta **pública** são dados pessoais em muitos casos (art. 7º e 11 da LGPD + resoluções do CNJ sobre publicidade processual). Use só para finalidade legítima, minimize campos e não redistribua listas de partes. **Segredo de justiça e área logada não são alvo.** Este Actor não contorna autenticação nem CAPTCHA.

### Desenvolvimento

```bash
cd actors/eproc-scraper
npm install && npm test && npm run build
apify run
```

# Actor input Schema

## `processNumbers` (type: `array`):

Um por linha, com ou sem máscara. Padrão NNNNNNN-DD.AAAA.J.TR.OOOO.

## `instance` (type: `string`):

Preset da consulta pública. custom usa baseUrl.

## `baseUrl` (type: `string`):

Origem do eproc sem o path de ação, ex. https://eproc.trf4.jus.br/eproc2trf4. Obrigatório se instance=custom.

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

Limite rígido (teto 5.000).

## `delayMs` (type: `integer`):

Pausa educada entre consultas.

## `sessionCookies` (type: `string`):

Cole o header Cookie copiado do SEU navegador, já autenticado na consulta pública. Só use cookies que você possui. Não resolve CAPTCHA e não entra em área de advogado por conta de terceiros.

## `datajudApiKey` (type: `string`):

Padrão: chave pública oficial do CNJ (datajud-wiki). Só preencha se o CNJ rotacionar a chave.

## `skipDatajud` (type: `boolean`):

Força só o HTML eproc (útil para testar o fallback).

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

Para o HTML eproc: Apify RESIDENTIAL + BR. DataJud costuma funcionar sem proxy.

## Actor input object example

```json
{
  "processNumbers": [
    "5000000-00.2020.4.04.0000"
  ],
  "instance": "trf4",
  "maxItems": 5,
  "delayMs": 400,
  "skipDatajud": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (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 = {
    "processNumbers": [
        "5000000-00.2020.4.04.0000"
    ],
    "maxItems": 5,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("national_scrim/eproc-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 = {
    "processNumbers": ["5000000-00.2020.4.04.0000"],
    "maxItems": 5,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("national_scrim/eproc-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 '{
  "processNumbers": [
    "5000000-00.2020.4.04.0000"
  ],
  "maxItems": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call national_scrim/eproc-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,national_scrim/eproc-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/YiHpunlEwZS2U4mFn/builds/EnDhwqI5orYF03hxY/openapi.json
