{
  "openapi": "3.0.1",
  "info": {
    "title": "Foreclosure Auctions Scraper (Germany ZVG & Japan Akiya)",
    "description": "Extract official judicial real estate foreclosure auctions in Germany (zvg-portal.de, 16 Länder) and Japan (bit.courts.go.jp, 47 prefectures / akiya). Parses court Gutachten & 3点セット PDFs via PyMuPDF for market valuation, minimum bid, m², occupancy, and optional BYOK LLM risk flags.",
    "version": "1.0",
    "x-build-id": "IVJRB8LFH1o9Pgaw5"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/vesper_studio~foreclosure-real-estate-auctions/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-vesper_studio-foreclosure-real-estate-auctions",
        "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/vesper_studio~foreclosure-real-estate-auctions/runs": {
      "post": {
        "operationId": "runs-sync-vesper_studio-foreclosure-real-estate-auctions",
        "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/vesper_studio~foreclosure-real-estate-auctions/run-sync": {
      "post": {
        "operationId": "run-sync-vesper_studio-foreclosure-real-estate-auctions",
        "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": {
          "sources": {
            "title": "Official Court Portals",
            "type": "array",
            "description": "Select which official judicial auction portals to scrape: Germany (zvg-portal.de) and/or Japan (www.bit.courts.go.jp).",
            "items": {
              "type": "string",
              "enum": [
                "zvg_de",
                "bit_jp"
              ],
              "enumTitles": [
                "Germany - zvg-portal.de (Zwangsversteigerungen)",
                "Japan - bit.courts.go.jp (不動産競売 / Akiya)"
              ]
            },
            "default": [
              "zvg_de",
              "bit_jp"
            ]
          },
          "deStates": {
            "title": "Germany: Bundesländer (state codes)",
            "type": "array",
            "description": "German federal state codes (`land_abk`): bw, by, be, br, hb, hh, he, mv, ni, nw, rp, sl, sn, st, sh, th. Leave empty to scan all 16 Länder when `zvg_de` is enabled.",
            "items": {
              "type": "string"
            },
            "default": [
              "be"
            ]
          },
          "jpPrefectures": {
            "title": "Japan: Prefectures / Court Areas (JIS codes)",
            "type": "array",
            "description": "Japanese prefecture codes (e.g. '13' Tokyo, '27' Osaka, '14' Kanagawa, '26' Kyoto, '01'/'91'-'94' Hokkaido, '40' Fukuoka) or prefecture names in English/Japanese (e.g. 'Tokyo', '大阪府'). Leave empty to scan Tokyo ('13') by default, or use 'ALL' to scan all 47 prefectures.",
            "items": {
              "type": "string"
            },
            "default": [
              "13"
            ]
          },
          "propertyTypes": {
            "title": "Property type filter",
            "type": "array",
            "description": "Optional normalized property category filter: residential_house, apartment, commercial_mixed, land, garage_other. Leave empty for all property types.",
            "items": {
              "type": "string",
              "enum": [
                "residential_house",
                "apartment",
                "commercial_mixed",
                "land",
                "garage_other"
              ],
              "enumTitles": [
                "Residential House (EFH / MFH / 戸建て)",
                "Apartment / Condo (ETW / マンション)",
                "Commercial / Mixed-Use (Gewerbe / Wohn-Geschäftshaus)",
                "Land / Plot (Grundstück / 土地)",
                "Garage / Parking / Other"
              ]
            },
            "default": []
          },
          "minMarketValue": {
            "title": "Minimum market value (local currency EUR / JPY)",
            "minimum": 0,
            "type": "number",
            "description": "Optional minimum appraised value (Verkehrswert in EUR or 売却基準価額 in JPY).",
            "default": 0
          },
          "maxMarketValue": {
            "title": "Maximum market value (local currency EUR / JPY)",
            "minimum": 0,
            "type": "number",
            "description": "Optional maximum appraised value (0 = no upper limit).",
            "default": 0
          },
          "parsePdfDetails": {
            "title": "Download & parse official court PDFs (Gutachten / Bekanntmachung / 3点セット)",
            "type": "boolean",
            "description": "When enabled, downloads official PDF attachments and parses text with PyMuPDF to extract surface area, construction year, tenancy/occupancy status, minimum bid / Wertgrenzen (§ 74a/§ 85a ZVG), and legal risk flags. Each parsed PDF bills one 'pdf-parsed' event.",
            "default": true
          },
          "maxPdfPages": {
            "title": "Maximum PDF pages to parse per document",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Caps PyMuPDF page parsing per document (keeps memory < 512 MB on 100+ page Gutachten).",
            "default": 20
          },
          "includeCancelled": {
            "title": "Include cancelled / withdrawn auctions",
            "type": "boolean",
            "description": "Include listings marked as cancelled/withdrawn (Termin aufgehoben / 中止).",
            "default": false
          },
          "llmApiKey": {
            "title": "Optional BYOK LLM API Key (OpenAI / Gemini / Anthropic)",
            "type": "string",
            "description": "Optional Bring-Your-Own-Key API key. When provided, sends the extracted Gutachten / 3点セット text (or HTML summary for scanned PDFs) to your chosen LLM to produce a structured risk & anomaly analysis. Never required."
          },
          "llmProvider": {
            "title": "BYOK LLM Provider",
            "enum": [
              "auto",
              "openai",
              "gemini",
              "anthropic"
            ],
            "type": "string",
            "description": "LLM provider for optional risk summary (auto-detected from key prefix if set to 'auto').",
            "default": "auto"
          },
          "llmModel": {
            "title": "BYOK LLM Model override (optional)",
            "type": "string",
            "description": "Optional model name (defaults: gpt-4o-mini, gemini-2.5-flash, claude-3-5-haiku-latest)."
          },
          "onlyNew": {
            "title": "Only new auction lots (delta mode)",
            "type": "boolean",
            "description": "Skip court cases already delivered in previous runs using the persistent named Apify Key-Value Store ('foreclosure-real-estate-auctions-seen' / 'seen_auction_lots'). Checkpoints on completion and graceful abort.",
            "default": false
          },
          "requestDelaySec": {
            "title": "Polite delay between requests per host (seconds)",
            "minimum": 0.1,
            "maximum": 10,
            "type": "number",
            "description": "Minimum delay between consecutive HTTP requests to the same judicial server.",
            "default": 0.4
          },
          "maxItems": {
            "title": "Maximum auction lots",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of auction lots to deliver across all selected sources. Each delivered lot bills one 'auction-lot' event.",
            "default": 20
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}