# DataJud Scraper - Brazil Court Cases & Processos (CNJ API) (`recordsdata/datajud-scraper`) Actor

Query Brazil's official DataJud API (CNJ) for judicial process data across 91 federal, state, labor, electoral and military courts. Look up by process number, filter by class/court, or pull recent activity, with full movement history.

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

## Pricing

from $15.47 / 1,000 process records

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

<p align="center">
  <img src="https://api.apify.com/v2/key-value-stores/AAm3a1h3Z9nYfrvh9/records/banner?v=3" alt="RecordsData" width="100%" />
</p>

## DataJud Scraper - Brazil Court Cases & Processos (CNJ API)

### What does DataJud Scraper do?

**DataJud Scraper** queries [DataJud](https://www.cnj.jus.br/sistemas/datajud/), the CNJ's (Brazil's National Council of Justice) official public API for judicial process metadata, covering **all 91 federal, state, labor, electoral and military courts in Brazil** - TJSP, TJRJ, TRF1-6, TST, STJ, every TRT and TRE, and more. Look up a specific process by its CNJ number, filter by procedural class and judging unit, or pull the most recently updated processes from a court - each with the full procedural movement (movimento) history.

No login, no scraping, no anti-bot workarounds - this is Brazil's own official open-data judicial API. Runs on the Apify platform with API access, scheduling, monitoring and CSV/Excel/JSON export.

### Why use DataJud Scraper?

- **Legal tech & litigation monitoring** - track process status changes across any Brazilian court without building 91 separate integrations.
- **Credit & risk analysis** - check for pending litigation against a company or individual before extending credit or closing a deal.
- **Legal research** - pull real case metadata (class, judging unit, timeline) at scale for academic or market research.
- **Law firm business development** - monitor new filings by class or court to spot emerging caseloads.

### How DataJud Scraper compares to alternatives

Measured against the other Brazil court-data actors on the Apify Store (September 2026):

| | This actor | Other DataJud actors |
|---|---|---|
| Primary price per 1,000 processes | $7.50 | $8.00 to $21.00 |
| Court coverage | All 91 CNJ courts (federal, state, labor, electoral, military) | Varies |
| Case movements | Separate event at $0.90 per 1,000 movements | Often bundled or absent |
| Source | Official CNJ DataJud API | Same or unofficial |

Lowest measured price in the niche, with movements billed separately so you only pay for the depth you use.

### How to use DataJud Scraper

1. Go to the **Input tab** and select one or more **tribunals** (courts) to query.
2. Choose a search mode: paste exact **process numbers**, set a **class/court code** filter, or leave both empty to pull the most recently updated processes.
3. Toggle **include movement history** if you need the full procedural timeline per case.
4. Click **Run**. Download results as JSON, CSV, or Excel from the dataset viewer.

### Input

- **Tribunals** - one or more courts to query, by official DataJud alias (e.g. `tjsp`, `trf1`, `tst`).
- **Process numbers** *(optional)* - exact CNJ process numbers to look up.
- **Classe Processual code / Órgão Julgador code** *(optional)* - filter by procedural class and/or judging unit.
- **Max processes per tribunal** - cap on how many records to collect per court (10 on free plan).
- **Include movement history** - also emit one record per procedural movement (billed separately).

Example input:

```json
{
    "tribunals": ["tjsp", "trf1"],
    "numerosProcesso": ["00008323520184013202"],
    "maxItemsPerTribunal": 100,
    "includeMovements": true
}
```

### Output

Two record types: one per process, and optionally one per procedural movement.

```json
{
    "recordType": "process-record",
    "tribunal": "TJSP",
    "numeroProcesso": "00613622820088260000",
    "grau": "G2",
    "classeCodigo": 198,
    "classeNome": "Apelação Cível",
    "orgaoJulgadorNome": "10ª CÂMARA DE DIREITO PRIVADO",
    "dataAjuizamento": "20080912000000",
    "sistemaNome": "SAJ",
    "movimentoCount": 90
}
```

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

### Data table

| Field | Description |
| --- | --- |
| `tribunal` / `grau` | Issuing court and instance (G1 = first instance, G2 = appeals, JE = special court) |
| `numeroProcesso` | The 20-digit unique CNJ process number |
| `classeCodigo` / `classeNome` | Procedural class code and name (e.g. Apelação Cível, Execução Fiscal) |
| `orgaoJulgadorCodigo` / `orgaoJulgadorNome` | The specific judging unit/chamber |
| `dataAjuizamento` | Filing date |
| `dataHoraUltimaAtualizacao` | Last time DataJud's own index refreshed this process |
| `movimentoCount` | Number of procedural movements on record |
| `movimentoCodigo` / `movimentoNome` / `movimentoDataHora` | Movement records only: each individual procedural step and its date |

### Pricing / Cost estimation

This actor uses **Pay Per Event** pricing. The **process record** is the primary event; movement records are only billed when "include movement history" is on.

### Tips or Advanced options

- **Use process-number lookup for known cases** - the fastest, most precise mode: one request per number, per tribunal.
- **Use class/court filters for bulk monitoring** - e.g. pull every new "Execução Fiscal" filing at a given court to build a lead list.
- **Leave both empty for a recent-activity feed** - returns the most recently updated processes at each selected court, sorted newest-first.

### FAQ, disclaimers, and support

**Is this legal?** DataJud is the CNJ's own official open-data initiative - process metadata is public record under Brazilian law, and the API is explicitly published for public/commercial reuse with a shared public API key.

**Why do some processes show `nivelSigilo` above 0?** Some cases carry a confidentiality level under Brazilian procedural law - DataJud itself limits how much detail is exposed for those, and this actor returns exactly what the API provides.

Found a bug or need a specific court's data structure explained? Open an issue in the Issues tab or contact us for a **custom scraper** tailored to your legal-data pipeline.

# Actor input Schema

## `tribunals` (type: `array`):

One or more Brazilian courts to query, by their official DataJud alias.

## `numerosProcesso` (type: `array`):

Exact CNJ process numbers to look up (20-digit unique numbering, digits only). Searched in every selected tribunal. Leave empty to use class/court filters or pull recent activity instead.

## `classeCodigo` (type: `integer`):

CNJ procedural class code (e.g. 1116 = Execução Fiscal). See the Glossário de Dados on the DataJud wiki for the full code table.

## `orgaoJulgadorCodigo` (type: `integer`):

Code of the specific judging unit/chamber within the tribunal.

## `maxItemsPerTribunal` (type: `integer`):

Maximum number of process records to collect from each selected tribunal.

## `includeMovements` (type: `boolean`):

Also emit one record per procedural movement (movimento) in each process's timeline. Billed as a separate event.

## Actor input object example

```json
{
  "tribunals": [
    "tjsp"
  ],
  "maxItemsPerTribunal": 100,
  "includeMovements": false
}
```

# Actor output Schema

## `dataset` (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 = {
    "tribunals": [
        "tjsp"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("recordsdata/datajud-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 = { "tribunals": ["tjsp"] }

# Run the Actor and wait for it to finish
run = client.actor("recordsdata/datajud-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 '{
  "tribunals": [
    "tjsp"
  ]
}' |
apify call recordsdata/datajud-scraper --silent --output-dataset

```

## MCP server setup

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