# 見積ほどき | Japanese Construction Estimate Comparator (`iidata/mitsumori-hodoki`) Actor

Upload Japanese construction estimates and automatically compare missing work, quantities, unit prices, and totals. Get an HTML report and editable Excel.

- **URL**: https://apify.com/iidata/mitsumori-hodoki.md
- **Developed by:** [Takuya Iida](https://apify.com/iidata) (community)
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1,500.00 / 1,000 generate one comparisons

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## 見積ほどき｜日本語の相見積を自動比較

工事・設備・改修の見積書をアップロードするだけで、明細をそろえ、抜け・数量差・単価差を比較します。結果はブラウザで確認できるHTMLレポートと、社内で編集できるExcelで受け取れます。

### こんな作業を短くします

- 表記が違う明細を、人が一行ずつ探して並べる
- 片方にだけある工事項目を見落とさないよう確認する
- 数量・単価・金額の差をExcelへ転記する
- 数量×単価、小計・税・合計の不一致を探す

見積ほどきは最終判断を自動化するものではありません。確認すべき箇所を先に絞り、原本照合を速くするためのツールです。

### 使い方

1. `2〜5件を比較` を選びます。
2. 基準にする見積と、比較する見積をアップロードします。
3. **Start** を押します。
4. 実行結果の **比較レポートを開く**、または **Excelをダウンロード** を選びます。

ファイルを用意せず確認する場合は、処理モードで `サンプルで試す` を選択してください。

### 対応範囲

| 項目 | 対応内容 |
|---|---|
| ファイル | PDF / XLSX / CSV / TXT |
| 言語・用途 | 日本語の工事・設備・改修見積 |
| 文書数 | 1回につき最大5件 |
| 比較 | 最初の見積を基準に、残りを1件ずつ比較 |
| 出力 | HTML / XLSX / JSON / Apify Dataset |

文字を選択できないスキャンPDF、写真、手書き、パスワード付きPDFは現行版の対象外です。

### 出力内容

#### HTML比較レポート

合計金額、差分行数、基準側にだけある明細、比較側にだけある明細を一覧できます。

#### Excel

- `概要`：文書ごとの件数、合計、警告数
- `明細`：抽出した分類、名称、数量、単位、単価、金額、信頼度
- `比較`：明細の対応関係、数量差、単価差、金額差、判定
- `ご確認ください`：対応範囲と利用上の注意

#### Dataset / JSON

APIや定期処理では、構造化した行データをそのまま利用できます。レコード種別は `documentSummary`、`lineItem`、`comparison`、`unparsedLine`、`error` です。

### 料金

ApifyのPay per event方式です。

| イベント | 料金 | 発生条件 |
|---|---:|---|
| 見積1件の処理 | $0.75 | 1文書を正常に明細化したとき |
| 比較表の生成 | $1.50 | 1回の実行で比較表を生成したとき |

2社比較の例は `$0.75 × 2 + $1.50 = $3.00` です。これにApify標準のごく少額のActor開始料金が加わります。実際の請求は、実行前にApify上で表示される価格を確認してください。

### API入力

画面のファイルアップロードに加え、APIでは公開HTTPS URLまたはテキストを指定できます。

```json
{
  "mode": "compare",
  "minMatchScore": 72,
  "documents": [
    {"name": "A社見積", "url": "https://example.com/estimate-a.pdf"},
    {"name": "B社見積", "text": "内装工事\nクロス張替 180 ㎡ 1,250 225,000\n合計 225,000"}
  ]
}
```

`minMatchScore` は50〜95です。大きくすると誤った対応づけを減らせます。通常は72のまま利用してください。

### プライバシーと安全性

- 現行版は外部の生成AI APIへ見積書を送りません。
- URL入力は公開HTTPSに限定し、ローカル・予約済み・プライベートネットワークを拒否します。
- ダウンロードは20MB、PDFは100ページ、Excelは20万セルまでです。
- 原文行は `includeRawText=true` のときだけDatasetに含めます。
- 入出力の保持・削除・アクセス権は、利用者のApifyストレージ設定に従います。

### 必ず原本をご確認ください

書式や文字配置により、抽出漏れ・誤抽出・誤った明細対応が起こる場合があります。契約、発注、支払、会計・税務判断の前に、低信頼行、未解析行、警告行を原本と照合してください。

### 開発者向け

```bash
python -m unittest discover -v
python -m src.local_cli INPUT_EXAMPLE.json
```

課金イベントは `document-processed` と `comparison-generated` です。Apify Consoleでは `.actor/pay_per_event.json` と同じ価格を設定し、二重課金を避けるため `apify-default-dataset-item` を無効にします。

# Changelog

This Actor's version history is a separate document: https://apify.com/iidata/mitsumori-hodoki/changelog.md

# Actor input Schema

## `mode` (type: `string`):

通常は「比較」を選択してください。1件だけ明細化する場合は「明細化」、お試しは「サンプル」です。

## `estimateAFile` (type: `string`):

文字情報を含むPDF、XLSX、CSV、TXTをアップロードします。比較表の左側になる見積です。

## `estimateAName` (type: `string`):

レポートとExcelに表示する見積元の名前です。会社名などに変更できます。

## `estimateBFile` (type: `string`):

比較モードでは2件目まで指定してください。

## `estimateBName` (type: `string`):

レポートとExcelに表示する2件目の見積元の名前です。

## `estimateCFile` (type: `string`):

3件目も比較する場合に、PDF、XLSX、CSV、TXTをアップロードします。

## `estimateCName` (type: `string`):

レポートとExcelに表示する3件目の見積元の名前です。

## `estimateDFile` (type: `string`):

4件目も比較する場合に、PDF、XLSX、CSV、TXTをアップロードします。

## `estimateDName` (type: `string`):

レポートとExcelに表示する4件目の見積元の名前です。

## `estimateEFile` (type: `string`):

5件目も比較する場合に、PDF、XLSX、CSV、TXTをアップロードします。

## `estimateEName` (type: `string`):

レポートとExcelに表示する5件目の見積元の名前です。

## `documents` (type: `array`):

API利用者向けの詳細入力です。画面のアップロードと合計して最大5件まで。

## `minMatchScore` (type: `integer`):

50〜95。大きくすると誤った組み合わせを減らせます。通常は72のままで構いません。

## `includeRawText` (type: `boolean`):

監査・調整用です。通常はオフのままにしてください。

## `enableOcr` (type: `boolean`):

OpenAI APIへ対象PDF全体を送信します。非公開OPENAI_API_KEYの設定が必要。1件10ページ、合計20ページまで。2回の数値照合に失敗した場合は停止します。

## `reviewInputUrl` (type: `string`):

見積ほどきサービスが発行する正規化済み結果のURL。通常は入力不要です。

## Actor input object example

```json
{
  "mode": "compare",
  "estimateAName": "A社見積",
  "estimateBName": "B社見積",
  "estimateCName": "C社見積",
  "estimateDName": "D社見積",
  "estimateEName": "E社見積",
  "documents": [],
  "minMatchScore": 72,
  "includeRawText": false,
  "enableOcr": false
}
```

# Actor output Schema

## `report` (type: `string`):

No description

## `excel` (type: `string`):

No description

## `dataset` (type: `string`):

No description

## `json` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("iidata/mitsumori-hodoki").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("iidata/mitsumori-hodoki").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call iidata/mitsumori-hodoki --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,iidata/mitsumori-hodoki"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/7oHFHnnKadneiYusL/builds/cHBi2z8XPiObokf1E/openapi.json
