{
  "openapi": "3.0.1",
  "info": {
    "title": "Mansion Review Scraper — Japan Condo Valuation Data & API",
    "description": "Mansion-Review.jp scraper & data API for Japan condo resale valuations. One record per building: monthly 坪単価 (price-per-tsubo) resale series + city/town/station benchmarks, deviation score, rating, listed-price range, build year, floors, units, station access, photos. Clean JSON/CSV.",
    "version": "1.0",
    "x-build-id": "tVWhFb5XHpruOtXfv"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sian.agency~mansion-review-valuation-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sian.agency-mansion-review-valuation-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/sian.agency~mansion-review-valuation-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sian.agency-mansion-review-valuation-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/sian.agency~mansion-review-valuation-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sian.agency-mansion-review-valuation-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": {
          "searchMode": {
            "title": "🧭 Target by",
            "enum": [
              "byArea",
              "byBuildingId"
            ],
            "type": "string",
            "description": "🧭 How to tell the scraper which buildings to value:\n\n- **By area** — paste a prefecture / city / town / station index URL (or pick a kind + ID below). Every building listed on the index page is auto-discovered and valued. Leave the area inputs blank to scan the `/mansion/` hub.\n- **By building** — paste specific building URLs or numeric IDs to value exactly those buildings.",
            "default": "byArea"
          },
          "areaUrls": {
            "title": "📍 Area index / hub URLs",
            "type": "array",
            "description": "📍 mansion-review.jp **index** URLs — a prefecture / city / town / station page or the `/mansion/` hub. Every building anchored on the page is discovered and valued. Used when **Target by = By area**.\n\n**TIP:** Open any area page on mansion-review.jp (e.g. a city or station page), then copy the URL from the address bar.\n\n**BULK EDIT:** Click \"Bulk edit\" to paste many URLs, one per line. Leave blank to scan the `/mansion/` hub.",
            "default": [
              "https://www.mansion-review.jp/mansion/city/667.html"
            ],
            "items": {
              "type": "string"
            }
          },
          "areaKind": {
            "title": "🗂️ Area kind (optional)",
            "enum": [
              "",
              "prefecture",
              "city",
              "town",
              "station",
              "line",
              "ranking"
            ],
            "type": "string",
            "description": "🗂️ Instead of a URL, pick an area **kind** and supply its **ID** below. Builds the index URL `https://www.mansion-review.jp/mansion/<kind>/<id>.html`.",
            "default": ""
          },
          "areaId": {
            "title": "🔢 Area ID (optional)",
            "type": "string",
            "description": "🔢 The numeric ID for the chosen **Area kind** (e.g. `667` for a city). Found in any mansion-review.jp area URL. Required only when **Area kind** is set."
          },
          "buildingIds": {
            "title": "🆔 Building URLs or IDs",
            "type": "array",
            "description": "🆔 **By building mode.** mansion-review.jp building URLs (e.g. https://www.mansion-review.jp/mansion/763410.html) or bare numeric IDs (e.g. `763410`).\n\n**BULK EDIT:** Click \"Bulk edit\" to paste many URLs/IDs, one per line.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "🔢 Max buildings",
            "minimum": 1,
            "type": "integer",
            "description": "🔢 Maximum buildings to value this run.\n\n- **FREE tier:** capped at 25 buildings per run.\n- **PAID tier:** unlimited — set as high as you need.",
            "default": 100
          },
          "yearsAgo": {
            "title": "📅 Price-series window (years)",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "📅 How many years of monthly 坪単価 (resale price-per-tsubo) history to pull for each building. Default 10.",
            "default": 10
          },
          "includeRentSouba": {
            "title": "🔑 Add rent price series (enrich)",
            "type": "boolean",
            "description": "🔑 Also fetch each building's **chintai (rent) 坪単価** series alongside the resale series. One extra request per building; billed as a separate enrich event only for buildings that have a rent series.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}