{
  "openapi": "3.0.1",
  "info": {
    "title": "DataJud Scraper - Brazil Court Cases & Processos (CNJ API)",
    "description": "Scrape Brazil's official DataJud (CNJ) API for judicial processes across 91 federal, state, labor, electoral and military courts. Look up by CNJ process number, class or judging unit, or pull recent activity with movement history. Export CSV, Excel, JSON. No login or API key.",
    "version": "0.1",
    "x-build-id": "W5JwRs14fJ7qo37U4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/recordsdata~datajud-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-recordsdata-datajud-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/recordsdata~datajud-scraper/runs": {
      "post": {
        "operationId": "runs-sync-recordsdata-datajud-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/recordsdata~datajud-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-recordsdata-datajud-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "tribunals"
        ],
        "properties": {
          "tribunals": {
            "title": "Courts (tribunals)",
            "type": "array",
            "description": "Pick one or more Brazilian courts to search. Examples: TJSP = Sao Paulo state court, TRF1 = Federal Regional Court 1, TST = Superior Labor Court. 91 courts are available. Leave the default (TJSP) to try it.",
            "items": {
              "type": "string",
              "enum": [
                "tst",
                "tse",
                "stj",
                "stm",
                "trf1",
                "trf2",
                "trf3",
                "trf4",
                "trf5",
                "trf6",
                "tjac",
                "tjal",
                "tjam",
                "tjap",
                "tjba",
                "tjce",
                "tjdft",
                "tjes",
                "tjgo",
                "tjma",
                "tjmg",
                "tjms",
                "tjmt",
                "tjpa",
                "tjpb",
                "tjpe",
                "tjpi",
                "tjpr",
                "tjrj",
                "tjrn",
                "tjro",
                "tjrr",
                "tjrs",
                "tjsc",
                "tjse",
                "tjsp",
                "tjto",
                "trt1",
                "trt2",
                "trt3",
                "trt4",
                "trt5",
                "trt6",
                "trt7",
                "trt8",
                "trt9",
                "trt10",
                "trt11",
                "trt12",
                "trt13",
                "trt14",
                "trt15",
                "trt16",
                "trt17",
                "trt18",
                "trt19",
                "trt20",
                "trt21",
                "trt22",
                "trt23",
                "trt24",
                "tre-ac",
                "tre-al",
                "tre-am",
                "tre-ap",
                "tre-ba",
                "tre-ce",
                "tre-dft",
                "tre-es",
                "tre-go",
                "tre-ma",
                "tre-mg",
                "tre-ms",
                "tre-mt",
                "tre-pa",
                "tre-pb",
                "tre-pe",
                "tre-pi",
                "tre-pr",
                "tre-rj",
                "tre-rn",
                "tre-ro",
                "tre-rr",
                "tre-rs",
                "tre-sc",
                "tre-se",
                "tre-sp",
                "tre-to",
                "tjmmg",
                "tjmrs",
                "tjmsp"
              ],
              "enumTitles": [
                "TST",
                "TSE",
                "STJ",
                "STM",
                "TRF1",
                "TRF2",
                "TRF3",
                "TRF4",
                "TRF5",
                "TRF6",
                "TJAC",
                "TJAL",
                "TJAM",
                "TJAP",
                "TJBA",
                "TJCE",
                "TJDFT",
                "TJES",
                "TJGO",
                "TJMA",
                "TJMG",
                "TJMS",
                "TJMT",
                "TJPA",
                "TJPB",
                "TJPE",
                "TJPI",
                "TJPR",
                "TJRJ",
                "TJRN",
                "TJRO",
                "TJRR",
                "TJRS",
                "TJSC",
                "TJSE",
                "TJSP",
                "TJTO",
                "TRT1",
                "TRT2",
                "TRT3",
                "TRT4",
                "TRT5",
                "TRT6",
                "TRT7",
                "TRT8",
                "TRT9",
                "TRT10",
                "TRT11",
                "TRT12",
                "TRT13",
                "TRT14",
                "TRT15",
                "TRT16",
                "TRT17",
                "TRT18",
                "TRT19",
                "TRT20",
                "TRT21",
                "TRT22",
                "TRT23",
                "TRT24",
                "TRE-AC",
                "TRE-AL",
                "TRE-AM",
                "TRE-AP",
                "TRE-BA",
                "TRE-CE",
                "TRE-DFT",
                "TRE-ES",
                "TRE-GO",
                "TRE-MA",
                "TRE-MG",
                "TRE-MS",
                "TRE-MT",
                "TRE-PA",
                "TRE-PB",
                "TRE-PE",
                "TRE-PI",
                "TRE-PR",
                "TRE-RJ",
                "TRE-RN",
                "TRE-RO",
                "TRE-RR",
                "TRE-RS",
                "TRE-SC",
                "TRE-SE",
                "TRE-SP",
                "TRE-TO",
                "TJMMG",
                "TJMRS",
                "TJMSP"
              ]
            },
            "default": [
              "tjsp"
            ]
          },
          "numerosProcesso": {
            "title": "Look up by process number (optional)",
            "type": "array",
            "description": "Paste exact CNJ process numbers, one per line, for example 0000832-35.2018.4.01.3202 (formatted or 20 digits). Each number is searched in every selected court. When filled, all filters below are ignored.",
            "items": {
              "type": "string"
            }
          },
          "query": {
            "title": "Search words (optional)",
            "type": "string",
            "description": "Words that must all appear in the class, subject or judging unit name, for example \"dano moral\" or \"execução fiscal\". Portuguese, accents optional."
          },
          "classeCodigo": {
            "title": "Class code (optional)",
            "type": "integer",
            "description": "CNJ procedural class code, for example 1116 = Execução Fiscal (tax enforcement), 198 = Apelação Cível (civil appeal)."
          },
          "assuntoCodigo": {
            "title": "Subject code (optional)",
            "type": "integer",
            "description": "CNJ subject code, for example 9607 = Contratos Bancários (bank contracts). Matches any subject of the process."
          },
          "orgaoJulgadorCodigo": {
            "title": "Judging unit code (optional)",
            "type": "integer",
            "description": "Code of the court unit or chamber (órgão julgador), as shown in the orgaoJulgadorCodigo column of a previous run."
          },
          "movimentoCodigo": {
            "title": "Movement code (optional)",
            "type": "integer",
            "description": "Only processes that have a movement with this CNJ code anywhere in their history, for example 51 = Conclusão (sent to the judge), 92 = Publicação."
          },
          "grau": {
            "title": "Court degree (optional)",
            "enum": [
              "any",
              "G1",
              "G2",
              "JE",
              "TR",
              "SUP"
            ],
            "type": "string",
            "description": "Restrict to one degree of jurisdiction, for example G2 for appeals. Leave on \"Any degree\" to get all.",
            "default": "any"
          },
          "filedFrom": {
            "title": "Filed from (date, optional)",
            "type": "string",
            "description": "Only processes filed on or after this date, for example 2026-01-01."
          },
          "filedTo": {
            "title": "Filed until (date, optional)",
            "type": "string",
            "description": "Only processes filed on or before this date, for example 2026-06-30."
          },
          "updatedFrom": {
            "title": "Updated from (date, optional)",
            "type": "string",
            "description": "Only processes the court updated on or after this date, for example 2026-10-01. Handy to pull what changed recently."
          },
          "updatedTo": {
            "title": "Updated until (date, optional)",
            "type": "string",
            "description": "Only processes the court updated on or before this date, for example 2026-10-31."
          },
          "maxItemsPerTribunal": {
            "title": "Max processes per court",
            "minimum": 1,
            "type": "integer",
            "description": "How many processes to collect from each selected court, newest activity first. Free plan: capped at 10. Paid plans: up to 1,000,000. Each process is one billed result.",
            "default": 100
          },
          "includeMovements": {
            "title": "Add movement history (extra cost)",
            "type": "boolean",
            "description": "Adds one extra row per procedural movement (code, name, date, judging unit). Adds one billed event per movement and a process can have hundreds, so keep it off unless you need the full timeline.",
            "default": false
          },
          "onlyChanged": {
            "title": "Only new or changed processes",
            "type": "boolean",
            "description": "Skips processes already delivered by an earlier run of this same search, unless the court updated them since. Great for scheduled runs; skipped processes are not charged. Max processes per court then limits how many of the newest matches are checked.",
            "default": false
          },
          "stateKey": {
            "title": "Monitor name (optional)",
            "type": "string",
            "description": "A label to keep several independent monitors for the same search, for example \"banks-sp\". Leave empty for the default monitor.",
            "default": ""
          },
          "resetSeen": {
            "title": "Start the monitor over",
            "type": "boolean",
            "description": "Clears the list of already-delivered processes for this search and monitor name, so everything counts as new again.",
            "default": false
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}