{
  "openapi": "3.0.1",
  "info": {
    "title": "見積ほどき | Japanese Construction Estimate Comparator",
    "description": "Upload Japanese construction estimates and automatically compare missing work, quantities, unit prices, and totals. Get an HTML report and editable Excel.",
    "version": "0.0",
    "x-build-id": "cHBi2z8XPiObokf1E"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/iidata~mitsumori-hodoki/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-iidata-mitsumori-hodoki",
        "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/iidata~mitsumori-hodoki/runs": {
      "post": {
        "operationId": "runs-sync-iidata-mitsumori-hodoki",
        "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/iidata~mitsumori-hodoki/run-sync": {
      "post": {
        "operationId": "run-sync-iidata-mitsumori-hodoki",
        "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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "処理モード",
            "enum": [
              "parse",
              "compare",
              "sample",
              "ai-review"
            ],
            "type": "string",
            "description": "通常は「比較」を選択してください。1件だけ明細化する場合は「明細化」、お試しは「サンプル」です。",
            "default": "compare"
          },
          "estimateAFile": {
            "title": "基準にする見積（1件目）",
            "type": "string",
            "description": "文字情報を含むPDF、XLSX、CSV、TXTをアップロードします。比較表の左側になる見積です。"
          },
          "estimateAName": {
            "title": "1件目の表示名",
            "type": "string",
            "description": "レポートとExcelに表示する見積元の名前です。会社名などに変更できます。",
            "default": "A社見積"
          },
          "estimateBFile": {
            "title": "比較する見積（2件目）",
            "type": "string",
            "description": "比較モードでは2件目まで指定してください。"
          },
          "estimateBName": {
            "title": "2件目の表示名",
            "type": "string",
            "description": "レポートとExcelに表示する2件目の見積元の名前です。",
            "default": "B社見積"
          },
          "estimateCFile": {
            "title": "比較する見積（3件目・任意）",
            "type": "string",
            "description": "3件目も比較する場合に、PDF、XLSX、CSV、TXTをアップロードします。"
          },
          "estimateCName": {
            "title": "3件目の表示名",
            "type": "string",
            "description": "レポートとExcelに表示する3件目の見積元の名前です。",
            "default": "C社見積"
          },
          "estimateDFile": {
            "title": "比較する見積（4件目・任意）",
            "type": "string",
            "description": "4件目も比較する場合に、PDF、XLSX、CSV、TXTをアップロードします。"
          },
          "estimateDName": {
            "title": "4件目の表示名",
            "type": "string",
            "description": "レポートとExcelに表示する4件目の見積元の名前です。",
            "default": "D社見積"
          },
          "estimateEFile": {
            "title": "比較する見積（5件目・任意）",
            "type": "string",
            "description": "5件目も比較する場合に、PDF、XLSX、CSV、TXTをアップロードします。"
          },
          "estimateEName": {
            "title": "5件目の表示名",
            "type": "string",
            "description": "レポートとExcelに表示する5件目の見積元の名前です。",
            "default": "E社見積"
          },
          "documents": {
            "title": "API用 documents（任意）",
            "type": "array",
            "description": "API利用者向けの詳細入力です。画面のアップロードと合計して最大5件まで。",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "title": "Document name",
                  "type": "string",
                  "description": "Name shown in output."
                },
                "text": {
                  "title": "Estimate text",
                  "type": "string",
                  "description": "Pasted estimate text."
                },
                "url": {
                  "title": "Document URL",
                  "type": "string",
                  "description": "Public HTTPS URL to PDF, TXT, or CSV."
                }
              }
            },
            "default": []
          },
          "minMatchScore": {
            "title": "明細名の一致しきい値",
            "minimum": 50,
            "maximum": 95,
            "type": "integer",
            "description": "50〜95。大きくすると誤った組み合わせを減らせます。通常は72のままで構いません。",
            "default": 72
          },
          "includeRawText": {
            "title": "未解析の原文行も出力する",
            "type": "boolean",
            "description": "監査・調整用です。通常はオフのままにしてください。",
            "default": false
          },
          "enableOcr": {
            "title": "鮮明なスキャンPDFを画像として読む",
            "type": "boolean",
            "description": "OpenAI APIへ対象PDF全体を送信します。非公開OPENAI_API_KEYの設定が必要。1件10ページ、合計20ページまで。2回の数値照合に失敗した場合は停止します。",
            "default": false
          },
          "reviewInputUrl": {
            "title": "AI精査用の署名付き入力URL",
            "type": "string",
            "description": "見積ほどきサービスが発行する正規化済み結果のURL。通常は入力不要です。"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}