{
  "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": "xYueD5GPl7EcZTdGO"
  },
  "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": "Tribunals (courts)",
            "type": "array",
            "description": "Brazilian courts to query, by official DataJud alias (tjsp = Sao Paulo state court, trf1 = Federal Regional Court 1, tst = Superior Labor Court, tre-sp = Sao Paulo electoral court). 91 courts available: federal, state, labor, electoral and military. Defaults to tjsp.",
            "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": "Process numbers (optional)",
            "type": "array",
            "description": "Exact CNJ process numbers to look up (20-digit unique numbering; formatted numbers such as 0000832-35.2018.4.01.3202 are accepted and normalized). Each number is searched in every selected tribunal. Leave empty to use class/court filters or pull the most recently updated processes.",
            "items": {
              "type": "string"
            }
          },
          "classeCodigo": {
            "title": "Filter by class code (optional)",
            "type": "integer",
            "description": "CNJ procedural class code (classe processual), for example 1116 for Execução Fiscal (tax enforcement) or 198 for Apelação Cível (civil appeal). Code tables: DataJud wiki, Glossário de Dados. Ignored when process numbers are given."
          },
          "assuntoCodigo": {
            "title": "Filter by subject code (optional)",
            "type": "integer",
            "description": "CNJ subject code (assunto) listed on the process, for example 9607 for Contratos Bancários (bank contracts). Matches any subject of the process, not only the main one. Ignored when process numbers are given."
          },
          "orgaoJulgadorCodigo": {
            "title": "Filter by judging unit code (optional)",
            "type": "integer",
            "description": "Code of the judging unit or chamber (órgão julgador) inside the tribunal, as returned in the orgaoJulgadorCodigo column. Combine with the other filters to narrow results. Ignored when process numbers are given."
          },
          "movimentoCodigo": {
            "title": "Filter by movement code (optional)",
            "type": "integer",
            "description": "Only processes that have a movement (movimento) with this CNJ code anywhere in their history, for example 51 for Conclusão (case sent to the judge) or 92 for Publicação. Ignored when process numbers are given."
          },
          "grau": {
            "title": "Court degree",
            "enum": [
              "any",
              "G1",
              "G2",
              "JE",
              "TR",
              "SUP"
            ],
            "type": "string",
            "description": "Restrict to one degree of jurisdiction: G1 first instance, G2 second instance (appeals), JE special civil court, TR appeals panel, SUP superior court. Leave on Any to get all. Ignored when process numbers are given.",
            "default": "any"
          },
          "query": {
            "title": "Text in class, subject or court unit (optional)",
            "type": "string",
            "description": "Words that must all appear in the class name, a subject name or the judging unit name, for example \"dano moral\" or \"execução fiscal\". Portuguese, accents optional. Ignored when process numbers are given."
          },
          "filedFrom": {
            "title": "Filed from (optional)",
            "type": "string",
            "description": "Only processes filed (data de ajuizamento) on or after this date. Format YYYY-MM-DD, for example 2026-01-01. Leave empty for no lower bound."
          },
          "filedTo": {
            "title": "Filed to (optional)",
            "type": "string",
            "description": "Only processes filed on or before this date. Format YYYY-MM-DD, for example 2026-06-30. Leave empty for no upper bound."
          },
          "updatedFrom": {
            "title": "Updated from (optional)",
            "type": "string",
            "description": "Only processes whose record was last updated on or after this date (dataHoraUltimaAtualizacao). Format YYYY-MM-DD. Useful to pull what changed recently."
          },
          "updatedTo": {
            "title": "Updated to (optional)",
            "type": "string",
            "description": "Only processes whose record was last updated on or before this date. Format YYYY-MM-DD. Leave empty for no upper bound."
          },
          "maxItemsPerTribunal": {
            "title": "Max processes per tribunal",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of process records to collect from each selected tribunal (up to 1,000,000 on a paid plan; the free plan is limited to 10). Each process is one billed process-record event. Newest activity comes first. In only-changed mode this is how many of the newest matching processes are looked at per tribunal; processes already delivered are skipped for free.",
            "default": 100
          },
          "includeMovements": {
            "title": "Include movement history",
            "type": "boolean",
            "description": "Also emit one record per procedural movement (movimento) in each process timeline, with the movement code, name, date, judging unit and tabulated complements. Each movement is a separate billed movement-record event and one process can have hundreds, so keep this off unless you need the full history.",
            "default": false
          },
          "onlyChanged": {
            "title": "Only new or changed processes (monitor mode)",
            "type": "boolean",
            "description": "Skip every process this same search already delivered in an earlier run, unless the court has updated it since (new movements change its last-update stamp). Scheduled runs then return just what is new or changed, and skipped processes are not charged. Max processes per tribunal then bounds how many of the newest matches are looked at.",
            "default": false
          },
          "stateKey": {
            "title": "Monitor name (optional)",
            "type": "string",
            "description": "Optional label to keep several independent monitors for the same search. Runs that share the same filters and name share one list of seen processes. Leave empty to use the default monitor.",
            "default": ""
          },
          "resetSeen": {
            "title": "Reset seen processes",
            "type": "boolean",
            "description": "Clear the stored list of already-delivered processes for this search and monitor name before the run, so every matching process 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}