{
  "openapi": "3.0.1",
  "info": {
    "title": "Japan Government Tenders Scraper + AI Extraction（官公需・入札情報）",
    "description": "Structured Japanese public tenders: deadlines, qualification grades, region requirements — every field with a verbatim source citation.",
    "version": "0.1",
    "x-build-id": "KlSJKnfmuswK698Li"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/minako-ph~japan-tender-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-minako-ph-japan-tender-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/minako-ph~japan-tender-scraper/runs": {
      "post": {
        "operationId": "runs-sync-minako-ph-japan-tender-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/minako-ph~japan-tender-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-minako-ph-japan-tender-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": {
          "keywords": {
            "title": "Keywords（キーワード）",
            "type": "array",
            "description": "Search keywords, combined with OR (each keyword is queried separately and results are deduplicated). Searches the full announcement text, not just titles. Japanese keywords work best — e.g. 清掃 (cleaning), 警備 (security), 舗装 (paving), システム保守 (system maintenance). The portal's own query syntax (AND / OR / ANDNOT / parentheses) passes through inside a single keyword, e.g. \"清掃 AND 委託\". Either keywords or prefectures is required.",
            "items": {
              "type": "string"
            }
          },
          "prefectures": {
            "title": "Prefectures（都道府県コード）",
            "type": "array",
            "description": "JIS X 0401 prefecture codes, two digits with leading zero: \"13\" = Tokyo, \"14\" = Kanagawa, \"27\" = Osaka … \"01\" = Hokkaido to \"47\" = Okinawa. Multiple codes allowed. Either keywords or prefectures is required.",
            "items": {
              "type": "string"
            }
          },
          "category": {
            "title": "Category（カテゴリ）",
            "enum": [
              "all",
              "goods",
              "construction",
              "services"
            ],
            "type": "string",
            "description": "Portal category filter: goods (物品) / construction (工事) / services (役務). Caution: only ~48% of portal records carry a category tag, so filtering by category misses untagged tenders. Prefer keyword search and use the AI-extracted `enriched.industryCategory` in the output, which classifies every tender.",
            "default": "all"
          },
          "certification": {
            "title": "Certification grades（統一資格等級）",
            "type": "array",
            "description": "Filter by the portal's unified qualification grade tag: any of \"A\", \"B\", \"C\", \"D\". This is portal metadata (present on some records only); the AI-extracted `enriched.qualification.grade` is more complete.",
            "items": {
              "type": "string"
            }
          },
          "dateFrom": {
            "title": "Announced from（公告日 From）",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Only tenders announced on/after this date, format YYYY-MM-DD. Note: records appear on the portal about 1 day after the issuing organization publishes them."
          },
          "dateTo": {
            "title": "Announced until（公告日 To）",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Only tenders announced on/before this date, format YYYY-MM-DD."
          },
          "maxItems": {
            "title": "Max items（最大件数）",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of unique tenders to output (after deduplication). 1–1000.",
            "default": 50
          },
          "enrich": {
            "title": "AI extraction（LLM構造化）",
            "type": "boolean",
            "description": "When true (default), each tender's announcement text is read by an LLM and structured into deadlines, qualification requirements (grade / registration / region / licenses), performance period, bidding method and a summary — every value verified against the source text by verbatim-quote matching; values that cannot be verified are returned as null, never guessed. When false, only the portal metadata is returned (cheaper: billed as basic items only).",
            "default": true
          },
          "llmApiKey": {
            "title": "Your Anthropic API key (BYOK)",
            "type": "string",
            "description": "Bring your own Anthropic API key to pay LLM costs yourself — enriched items are then billed at the reduced BYOK rate. The key is stored as a secret and never appears in logs or error messages."
          },
          "incrementalMode": {
            "title": "Incremental mode（差分実行）",
            "type": "boolean",
            "description": "When true (default), tenders already delivered by previous runs with the same search conditions are skipped, so scheduled runs return only new tenders (ideal for daily monitoring + webhook). Set false to re-fetch everything.",
            "default": true
          },
          "batch": {
            "title": "Batch mode (reserved)",
            "type": "boolean",
            "description": "Reserved for a future version (Anthropic Batch API, ~50% lower LLM cost, up to 24h latency). Not accepted yet: setting true makes the run fail with an explanatory message before any charge.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}