{
  "openapi": "3.0.1",
  "info": {
    "title": "Japan Public Tender Alerts — kkj.go.jp Bid Monitoring",
    "description": "New Japanese government tender notices (入札公告) from kkj.go.jp, filtered by keyword, prefecture and date. Returns only records new since the last run, as clean JSON. Official public API, no login or key. 官公需情報ポータルの入札公告を絞り込み、前回実行からの新着だけを構造化データで返します。",
    "version": "0.2",
    "x-build-id": "ltev9XbeH4YTp8O9I"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/aflame_brigantine~kkj-tender-alert/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-aflame_brigantine-kkj-tender-alert",
        "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/aflame_brigantine~kkj-tender-alert/runs": {
      "post": {
        "operationId": "runs-sync-aflame_brigantine-kkj-tender-alert",
        "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/aflame_brigantine~kkj-tender-alert/run-sync": {
      "post": {
        "operationId": "run-sync-aflame_brigantine-kkj-tender-alert",
        "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": "全文検索語（いずれかを含む案件を取得、OR検索）。空欄なら全国・全件を対象にします。 How matching works: your words are sent to kkj.go.jp's own full-text search as one query joined with OR. kkj matches the notice title and body text (and, according to kkj, attached documents), so a hit may not have the word in its title. This Actor does no extra filtering of its own. 照合は kkj.go.jp の全文検索が行います（件名・公告本文、kkj の説明では添付資料も対象）。この Actor が独自に絞り込むことはありません。",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "prefectures": {
            "title": "Prefectures",
            "type": "array",
            "description": "絞り込む都道府県名（複数選択可）。空欄なら全国。",
            "items": {
              "type": "string",
              "enum": [
                "北海道",
                "青森県",
                "岩手県",
                "宮城県",
                "秋田県",
                "山形県",
                "福島県",
                "茨城県",
                "栃木県",
                "群馬県",
                "埼玉県",
                "千葉県",
                "東京都",
                "神奈川県",
                "新潟県",
                "富山県",
                "石川県",
                "福井県",
                "山梨県",
                "長野県",
                "岐阜県",
                "静岡県",
                "愛知県",
                "三重県",
                "滋賀県",
                "京都府",
                "大阪府",
                "兵庫県",
                "奈良県",
                "和歌山県",
                "鳥取県",
                "島根県",
                "岡山県",
                "広島県",
                "山口県",
                "徳島県",
                "香川県",
                "愛媛県",
                "高知県",
                "福岡県",
                "佐賀県",
                "長崎県",
                "熊本県",
                "大分県",
                "宮崎県",
                "鹿児島県",
                "沖縄県"
              ]
            },
            "default": []
          },
          "category": {
            "title": "Category",
            "enum": [
              "",
              "物品",
              "工事",
              "役務"
            ],
            "type": "string",
            "description": "業種区分で絞り込みます（API は単一選択のみ対応）。空欄なら全カテゴリー。",
            "default": ""
          },
          "publishedAfter": {
            "title": "Published after",
            "pattern": "^$|^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "公告日の下限（YYYY-MM-DD）。既定は実行日の7日前。",
            "default": ""
          },
          "onlyNew": {
            "title": "Only tenders not delivered before (new only)",
            "type": "boolean",
            "description": "前回までの run で出力済みの案件を除き、初めて見た案件だけを出力・課金対象にします。「前回」の記録は名前付きストア（下の stateStoreName、既定は検索条件ごとに自動）に残ります。false にすると毎回すべて出力します。",
            "default": true
          },
          "includeContact": {
            "title": "Include raw description text",
            "type": "boolean",
            "description": "公告文（ProjectDescription）を無加工のまま含めます。オフの場合は電話番号・メールアドレスらしき文字列を除去します。",
            "default": false
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "1 run あたりの最大取得件数（新着課金の上限にもなります）。都道府県を絞らない場合は都道府県ごとに分割取得してこの件数までマージします。メモリ保護のため1都道府県あたりの取得件数は200件に制限されるので、1都道府県のみを対象にする検索では実質200件が上限になります（複数/全国を対象にする場合は都道府県ごとに最大200件ずつ集めてから、全体でこの件数に絞り込みます）。既定値は初回実行の課金を抑えるため小さめにしています。",
            "default": 20
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "新着があれば、新着一覧をこの URL に POST します（任意）。Slack / Discord / Teams の受信 Webhook URL をそのまま貼れます（下の webhookFormat を合わせてください）。",
            "default": ""
          },
          "webhookFormat": {
            "title": "Webhook format",
            "enum": [
              "json",
              "slack",
              "discord",
              "teams"
            ],
            "type": "string",
            "description": "webhookUrl に送る本文の形式。json（既定）は従来どおりの生データ。slack / discord / teams は各サービスの受信 Webhook がそのまま読める読みやすいメッセージ（件名・発注機関・開札日・リンク）を送ります。",
            "default": "json"
          },
          "stateStoreName": {
            "title": "State store name (advanced)",
            "type": "string",
            "description": "「前回から新着」の記録を置く名前付き Key-value ストアの名前。空欄なら検索条件（キーワード・都道府県・カテゴリー）から自動で kkj-seen-<ハッシュ> が付き、同じ条件の run 同士で記録を共有します。複数のアラートで記録を分けたい・共有したいときだけ指定してください（英小文字・数字・ハイフン、3〜63 文字）。記録を消して最初からやり直すには、Console の Storage でこのストアを削除します。",
            "default": ""
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}