{
  "openapi": "3.0.1",
  "info": {
    "title": "Leilões de Falência e Recuperação Judicial",
    "description": "Editais de leilão em processos de falência e recuperação judicial de empresas (PJ), direto do DJEN/Comunica do CNJ. Filtros por tribunal, período, origem, categoria do bem e valor. Cada registro traz processo CNJ, vara, link da fonte oficial, data de coleta e status.",
    "version": "0.1",
    "x-build-id": "GtBoCykgY0wu0Vgwq"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kman-br~leiloes-falencia/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kman-br-leiloes-falencia",
        "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/kman-br~leiloes-falencia/runs": {
      "post": {
        "operationId": "runs-sync-kman-br-leiloes-falencia",
        "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/kman-br~leiloes-falencia/run-sync": {
      "post": {
        "operationId": "run-sync-kman-br-leiloes-falencia",
        "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": {
          "tribunais": {
            "title": "Tribunais",
            "type": "array",
            "description": "Siglas dos tribunais (ex.: TJMG, TJSP). Padrão TJMG, que tem editais com praça futura na janela padrão. TJSP e TJMG foram validados; outros tribunais funcionam com aviso, pois o texto das publicações pode ter outro formato.",
            "default": [
              "TJMG"
            ],
            "items": {
              "type": "string"
            }
          },
          "origem": {
            "title": "Origem do processo",
            "enum": [
              "falencia",
              "recuperacao_judicial",
              "ambos"
            ],
            "type": "string",
            "description": "Tipo do processo: falência, recuperação judicial ou ambos (padrão). Só empresas (pessoa jurídica).",
            "default": "ambos"
          },
          "categorias": {
            "title": "Categorias do bem",
            "type": "array",
            "description": "Tipos de bem a devolver. Vazio = todos. A categoria é inferida por palavras do texto do edital.",
            "items": {
              "type": "string",
              "enum": [
                "imovel",
                "veiculo",
                "maquina",
                "estoque",
                "outros"
              ],
              "enumTitles": [
                "Imóvel",
                "Veículo",
                "Máquina/equipamento",
                "Estoque/mercadoria",
                "Outros"
              ]
            }
          },
          "diasAtras": {
            "title": "Dias para trás",
            "minimum": 1,
            "maximum": 180,
            "type": "integer",
            "description": "Quantos dias para trás buscar, contando da data final (ou de hoje). Padrão 60 (no TJMG, 17 lotes com praça futura em 60 dias, medido em 13/10/2026). Ignorado se a data inicial for informada. Sem datas e sem resultado, o Actor tenta uma vez com 90 dias.",
            "default": 60
          },
          "dataInicio": {
            "title": "Data inicial (disponibilização)",
            "type": "string",
            "description": "AAAA-MM-DD, data de publicação no diário. Máximo de 180 dias até a data final."
          },
          "dataFim": {
            "title": "Data final (disponibilização)",
            "type": "string",
            "description": "AAAA-MM-DD, data de publicação no diário. Padrão: hoje (horário de Brasília)."
          },
          "valorMax": {
            "title": "Valor máximo de avaliação (R$)",
            "minimum": 0,
            "type": "integer",
            "description": "Teto do valor de avaliação em R$. Só exclui lotes com valor identificado acima do teto; lotes sem valor identificado permanecem."
          },
          "apenasEditais": {
            "title": "Apenas editais",
            "type": "boolean",
            "description": "Ligado (padrão): só devolve publicações que têm data de leilão/praça E (lote ou valor), isto é, editais de verdade; decisões que apenas citam o leilão são descartadas e só contadas no resumo do run. Desligado: inclui também essas publicações como \"parcial\" (não cobradas).",
            "default": true
          },
          "maxItems": {
            "title": "Máximo de itens",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Máximo de lotes devolvidos (e, portanto, cobrados). O Actor para ao atingir o teto.",
            "default": 50
          },
          "somenteNovidades": {
            "title": "Somente novidades",
            "type": "boolean",
            "description": "Checagem barata para uso agendado: devolve só lotes ainda não entregues (ou que mudaram) desde o último run com os mesmos filtros; o segundo run igual grava 0 itens. O estado (só ids e hashes, sem texto) fica num key-value store nomeado da sua conta.",
            "default": false
          },
          "intervaloMs": {
            "title": "Intervalo entre requisições (ms)",
            "minimum": 1000,
            "type": "integer",
            "description": "Mínimo 1000. Respeita a API pública do CNJ.",
            "default": 1200
          },
          "proxyResidencialBR": {
            "title": "Proxy residencial BR (Apify)",
            "type": "boolean",
            "description": "Ligado por padrão, porque a API do CNJ recusa IPs de fora do Brasil (como os da Apify). Usa o Apify Proxy residencial com saída no Brasil (grupo RESIDENTIAL, país BR). O tráfego de proxy é cobrado pela Apify na sua conta; desligue só se rodar o Actor a partir de um IP brasileiro.",
            "default": true
          },
          "somenteMeioEdital": {
            "title": "Somente publicações do tipo Edital",
            "type": "boolean",
            "description": "Ligado (padrão): consulta só publicações marcadas como Edital no DJEN (filtro meio=E da API), o que reduz muito o volume baixado. Desligado: inclui também intimações do Diário, onde às vezes aparecem lotes com praça já realizada.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}