{
  "openapi": "3.0.1",
  "info": {
    "title": "DataJud Scraper",
    "description": "Extract Brazilian court process records from the CNJ DataJud public database across 90+ federal, state, labor and superior courts. Scrape process number, class, subjects, judging body, filing date and the full timestamped movement timeline.",
    "version": "0.1",
    "x-build-id": "1fiAO30KD0YtMdtdF"
  },
  "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": {
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum number of process records to collect. Optional."
          },
          "tribunal": {
            "title": "Court (tribunal)",
            "enum": [
              "stf",
              "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 Elasticsearch index (api_publica_<tribunal>).",
            "default": "tjsp"
          },
          "processNumbers": {
            "title": "Process numbers",
            "type": "array",
            "description": "Exact process numbers (numeroProcesso, 20 digits, with or without punctuation). Each is looked up exactly. Leave empty to use the filters below instead.",
            "items": {
              "type": "string"
            }
          },
          "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."
          },
          "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."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional proxy. The DataJud API works from datacenter IPs, so a proxy is not required.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}