{
  "openapi": "3.0.1",
  "info": {
    "title": "DataJud Scraper: Brazil Court Cases, Processos, CNJ API",
    "description": "Consulta processual scraper for Brazilian court records (processos judiciais) via the CNJ DataJud public API. Search 90+ tribunais (STF, STJ, TJ, TRT, TRF) by process number, class, subject, court, movement and date. Get the full movement docket. Export JSON, CSV, Excel for KYB and due diligence.",
    "version": "0.1",
    "x-build-id": "3aaAMhBoNsYbmBdWj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapers_lat~datajud-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapers_lat-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/scrapers_lat~datajud-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapers_lat-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/scrapers_lat~datajud-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapers_lat-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",
        "properties": {
          "maxCases": {
            "title": "Max Cases",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum number of court process (case) records to collect. Optional."
          },
          "tribunal": {
            "title": "Court (tribunal)",
            "enum": [
              "stj",
              "tst",
              "tse",
              "stm",
              "trf1",
              "trf2",
              "trf3",
              "trf4",
              "trf5",
              "trf6",
              "tjsp",
              "tjrj",
              "tjmg",
              "tjrs",
              "tjpr",
              "tjba",
              "tjsc",
              "tjgo",
              "tjpe",
              "tjce",
              "tjdft",
              "tjes",
              "tjpa",
              "tjmt",
              "tjms",
              "tjpb",
              "tjrn",
              "tjal",
              "tjpi",
              "tjse",
              "tjma",
              "tjto",
              "tjro",
              "tjam",
              "tjac",
              "tjap",
              "tjrr",
              "trt1",
              "trt2",
              "trt3",
              "trt4",
              "trt5",
              "trt6",
              "trt7",
              "trt8",
              "trt9",
              "trt10",
              "trt11",
              "trt12",
              "trt13",
              "trt14",
              "trt15",
              "trt16",
              "trt17",
              "trt18",
              "trt19",
              "trt20",
              "trt21",
              "trt22",
              "trt23",
              "trt24",
              "tjmmg",
              "tjmrs",
              "tjmsp"
            ],
            "type": "string",
            "description": "Which court index to query. Each value maps to a DataJud index (api_publica_<tribunal>). TJSP is the largest index and the public CNJ API is often overloaded on it; if a TJSP run reports that DataJud did not answer, retry later. The STF does not publish to DataJud.",
            "default": "tjsp"
          },
          "tribunais": {
            "title": "Courts (multiple, parallel)",
            "type": "array",
            "description": "Query several courts at once, in parallel (faster than one run per court). Use the same aliases as the single Court field (for example [\"tjsp\",\"tjrj\",\"trt2\"]). When set, this overrides the single Court field. Leave empty to use the single Court field.",
            "items": {
              "type": "string"
            }
          },
          "processNumbers": {
            "title": "Process numbers",
            "type": "array",
            "description": "Exact process numbers (numeroProcesso, 20 digits, with or without punctuation). Each is looked up exactly across every selected court. Leave empty to use the filters below instead.",
            "items": {
              "type": "string"
            }
          },
          "query": {
            "title": "Free-text search",
            "type": "string",
            "description": "Full-text query across the court index (class, subject and movement names), for example \"recuperação judicial\" or \"honorários\". Combined with the other filters below. Optional."
          },
          "classeCode": {
            "title": "Class code (classe.codigo)",
            "type": "integer",
            "description": "Filter by procedural class code (TPU/CNJ class table), e.g. 12154 for Execução de Título Extrajudicial. Optional."
          },
          "assuntoCode": {
            "title": "Subject code (assuntos.codigo)",
            "type": "integer",
            "description": "Filter by subject/matter code (TPU/CNJ subject table). Optional."
          },
          "orgaoJulgadorCode": {
            "title": "Judging body code (orgaoJulgador.codigo)",
            "type": "integer",
            "description": "Filter by the judging body (court chamber/vara) code. Optional."
          },
          "grau": {
            "title": "Instance (grau)",
            "type": "string",
            "description": "Filter by judicial instance/level, for example G1 (first instance), G2 (appeals), JE, SUP. Optional."
          },
          "movimentoCode": {
            "title": "Movement code (movimentos.codigo)",
            "type": "integer",
            "description": "Only processes that contain this procedural movement code (CNJ movement table), for example 246 for sentence, 26 for distribution. Useful to find cases at a given procedural stage. Optional."
          },
          "filedFrom": {
            "title": "Filed from (dataAjuizamento)",
            "type": "string",
            "description": "Only processes filed on or after this date (YYYY-MM-DD). Optional."
          },
          "filedTo": {
            "title": "Filed to (dataAjuizamento)",
            "type": "string",
            "description": "Only processes filed on or before this date (YYYY-MM-DD). Optional."
          },
          "updatedFrom": {
            "title": "Last updated from (dataHoraUltimaAtualizacao)",
            "type": "string",
            "description": "Only processes whose last update is on or after this date (YYYY-MM-DD). Use to monitor recently-moved cases. Optional."
          },
          "updatedTo": {
            "title": "Last updated to (dataHoraUltimaAtualizacao)",
            "type": "string",
            "description": "Only processes whose last update is on or before this date (YYYY-MM-DD). Optional."
          },
          "withSummary": {
            "title": "AI case summary (paid add-on)",
            "type": "boolean",
            "description": "Optional paid AI add-on, off by default. Adds a plain-language Portuguese summary of each case (class, subject, current status). Billed only when produced. Requires a paid Apify plan.",
            "default": false
          },
          "withTranslate": {
            "title": "AI English translation (paid add-on)",
            "type": "boolean",
            "description": "Optional paid AI add-on, off by default. Adds a clear English summary/translation of each Portuguese case. Billed only when produced. Requires a paid Apify plan.",
            "default": false
          },
          "withExtract": {
            "title": "AI structured extract (paid add-on)",
            "type": "boolean",
            "description": "Optional paid AI add-on, off by default. Extracts structured case data: class, subjects, current stage, court, key dates and amounts. Billed only when produced. Requires a paid Apify plan.",
            "default": false
          },
          "autoDetectCourt": {
            "title": "Detect the court from the CNJ number",
            "type": "boolean",
            "description": "Process-number lookups go straight to the court encoded in the CNJ number (segments J.TR), so you do not need to pick the court. Each row has tribunalDetectado. Numbers not found return a free not_found row.",
            "default": true
          },
          "onlyChangedSinceLastRun": {
            "title": "Only cases with new updates since the last run",
            "type": "boolean",
            "description": "Return only cases whose DataJud update date changed since the last run with the same monitor name, with temNovidade and novosMovimentos (the movements added since then). Unchanged cases are not charged.",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Name of the saved watch list."
          },
          "resetSeen": {
            "title": "Start the watch list over",
            "type": "boolean",
            "description": "Forget the saved state and return every case once.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}