{
  "openapi": "3.0.1",
  "info": {
    "title": "Japan Government Tenders & Awards (kkj.go.jp)",
    "description": "Structured Japanese government procurement notices (national / prefectural / municipal) from the official kkj.go.jp search API. English field schema, source attribution embedded in every record.",
    "version": "0.1",
    "x-build-id": "y4PmW65AGeu6pLPoh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jpopendata~japan-tenders/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jpopendata-japan-tenders",
        "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/jpopendata~japan-tenders/runs": {
      "post": {
        "operationId": "runs-sync-jpopendata-japan-tenders",
        "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/jpopendata~japan-tenders/run-sync": {
      "post": {
        "operationId": "run-sync-jpopendata-japan-tenders",
        "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": {
          "keyword": {
            "title": "Keyword",
            "type": "string",
            "description": "REQUIRED unless a prefecture is chosen or noticeType is `award` (the kkj.go.jp API needs at least one server-side selector; a run with none stops immediately with an explanation). Full-text search keyword — Japanese works best, e.g. 情報システム, ネットワーク, 清掃. Supports the portal's operators: `A AND B`, `A OR B`, `A ANDNOT B`, `NOT A`, parentheses (half-width spaces around operators are required).",
            "default": "情報システム"
          },
          "noticeType": {
            "title": "Notice type",
            "enum": [
              "tender",
              "award",
              "both"
            ],
            "type": "string",
            "description": "Optional, default both. tender = call-for-tender notices only, award = award/bid-result documents only (title-based classification, see README for coverage caveats), both = everything.",
            "default": "both"
          },
          "organizationLevel": {
            "title": "Organization level",
            "type": "array",
            "description": "Optional. Filter by issuing organization level (heuristic classification from the organization name). Empty = all levels. Via API a single value or comma-separated string is accepted too.",
            "items": {
              "type": "string",
              "enum": [
                "national",
                "prefecture",
                "municipal",
                "agency"
              ],
              "enumTitles": [
                "National government",
                "Prefecture",
                "Municipality",
                "Agency / incorporated body"
              ]
            },
            "default": []
          },
          "prefecture": {
            "title": "Prefecture",
            "enum": [
              "",
              "national",
              "Hokkaido",
              "Aomori",
              "Iwate",
              "Miyagi",
              "Akita",
              "Yamagata",
              "Fukushima",
              "Ibaraki",
              "Tochigi",
              "Gunma",
              "Saitama",
              "Chiba",
              "Tokyo",
              "Kanagawa",
              "Niigata",
              "Toyama",
              "Ishikawa",
              "Fukui",
              "Yamanashi",
              "Nagano",
              "Gifu",
              "Shizuoka",
              "Aichi",
              "Mie",
              "Shiga",
              "Kyoto",
              "Osaka",
              "Hyogo",
              "Nara",
              "Wakayama",
              "Tottori",
              "Shimane",
              "Okayama",
              "Hiroshima",
              "Yamaguchi",
              "Tokushima",
              "Kagawa",
              "Ehime",
              "Kochi",
              "Fukuoka",
              "Saga",
              "Nagasaki",
              "Kumamoto",
              "Oita",
              "Miyazaki",
              "Kagoshima",
              "Okinawa"
            ],
            "type": "string",
            "description": "Optional. Choose one of the 47 prefectures by its English name (e.g. \"Tokyo\", \"Osaka\", \"Kyoto\"). Via API/CLI pass the English name exactly as listed (e.g. \"Tokyo\", not \"東京都\" / \"13\" / \"tokyo-to\" — the platform validates the list before the run starts and rejects anything else with the list of valid values). Cities are NOT prefectures: use \"Kanagawa\" for Yokohama, \"Aichi\" for Nagoya, \"Osaka\" for Osaka-shi. Sent to the API as LG_Code. Choose \"national\" to keep only records classified as national-government level (client-side filter — must be combined with a keyword or noticeType award).",
            "default": ""
          },
          "dateFrom": {
            "title": "Published from (YYYY-MM-DD)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Optional. Publication-date window start (CFT_Issue_Date), inclusive, as YYYY-MM-DD (e.g. 2026-08-01). If omitted and the result set needs more than one API request, deep pagination only covers the last 365 days — set this explicitly to reach older notices."
          },
          "dateTo": {
            "title": "Published to (YYYY-MM-DD)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Optional. Publication-date window end (CFT_Issue_Date), inclusive, as YYYY-MM-DD (e.g. 2026-08-31). Must not be before dateFrom."
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Optional, default 50. Maximum number of records to output (1..10000). The upstream API returns at most 1,000 records per request; beyond that the actor slices the date range into windows (more requests, politeness-throttled).",
            "default": 50
          },
          "maxApiRequests": {
            "title": "Max API requests per run",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Optional, default 60. Hard safety cap on upstream API requests in one run (politeness: the portal forbids sustained bulk access). When the cap is hit the run still SUCCEEDS with the records collected so far (complete=false in RUN_SUMMARY).",
            "default": 60
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. Apify proxy settings. Default: NO proxy (direct connection works). Note: kkj.go.jp has been observed to challenge/rate-limit datacenter IPs; the actor backs off and stops on repeated 429s — it never attempts WAF evasion.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}