{
  "openapi": "3.0.1",
  "info": {
    "title": "Japan Subsidy Monitor (jGrants): changes and attachments",
    "description": "Japanese subsidy (hojokin) programs from the official jGrants public API, with change detection and attachment fingerprints.",
    "version": "0.2",
    "x-build-id": "MguQr5rfUpLWHT75O"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/northgrain-lab~jgrants-subsidy-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-northgrain-lab-jgrants-subsidy-monitor",
        "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/northgrain-lab~jgrants-subsidy-monitor/runs": {
      "post": {
        "operationId": "runs-sync-northgrain-lab-jgrants-subsidy-monitor",
        "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/northgrain-lab~jgrants-subsidy-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-northgrain-lab-jgrants-subsidy-monitor",
        "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": "Search keywords",
            "type": "array",
            "description": "Each keyword is sent to the official jGrants search (2 to 255 characters; the Actor checks this before the run). Results of all keywords are merged and de-duplicated by program ID.",
            "default": [
              "補助金"
            ],
            "items": {
              "type": "string"
            }
          },
          "area": {
            "title": "Target area",
            "enum": [
              "",
              "全国",
              "北海道地方",
              "東北地方",
              "関東・甲信越地方",
              "東海・北陸地方",
              "近畿地方",
              "中国地方",
              "四国地方",
              "九州・沖縄地方",
              "北海道",
              "青森県",
              "岩手県",
              "宮城県",
              "秋田県",
              "山形県",
              "福島県",
              "茨城県",
              "栃木県",
              "群馬県",
              "埼玉県",
              "千葉県",
              "東京都",
              "神奈川県",
              "新潟県",
              "富山県",
              "石川県",
              "福井県",
              "山梨県",
              "長野県",
              "岐阜県",
              "静岡県",
              "愛知県",
              "三重県",
              "滋賀県",
              "京都府",
              "大阪府",
              "兵庫県",
              "奈良県",
              "和歌山県",
              "鳥取県",
              "島根県",
              "岡山県",
              "広島県",
              "山口県",
              "徳島県",
              "香川県",
              "愛媛県",
              "高知県",
              "福岡県",
              "佐賀県",
              "長崎県",
              "熊本県",
              "大分県",
              "宮崎県",
              "鹿児島県",
              "沖縄県",
              "海外"
            ],
            "type": "string",
            "description": "Passed as it is to the official jGrants search as the area filter (one value). How the API narrows the results is up to the API (not tested in this Actor).",
            "default": ""
          },
          "employees": {
            "title": "Company size",
            "enum": [
              "",
              "従業員数の制約なし",
              "5名以下",
              "20名以下",
              "50名以下",
              "100名以下",
              "300名以下",
              "900名以下",
              "901名以上"
            ],
            "type": "string",
            "description": "Passed as it is to the official jGrants search as the employee-count filter (one value). How the API narrows the results is up to the API (not tested in this Actor).",
            "default": ""
          },
          "industry": {
            "title": "Industry",
            "enum": [
              "",
              "農業、林業",
              "漁業",
              "鉱業、採石業、砂利採取業",
              "建設業",
              "製造業",
              "電気・ガス・熱供給・水道業",
              "情報通信業",
              "運輸業、郵便業",
              "卸売業、小売業",
              "金融業、保険業",
              "不動産業、物品賃貸業",
              "学術研究、専門・技術サービス業",
              "宿泊業、飲食サービス業",
              "生活関連サービス業、娯楽業",
              "教育、学習支援業",
              "医療、福祉",
              "複合サービス事業",
              "サービス業（他に分類されないもの）",
              "公務（他に分類されるものを除く）",
              "分類不能の産業"
            ],
            "type": "string",
            "description": "Passed as it is to the official jGrants search as the industry filter (one value). How the API narrows the results is up to the API (not tested in this Actor).",
            "default": ""
          },
          "purpose": {
            "title": "Purpose",
            "enum": [
              "",
              "新たな事業を行いたい",
              "販路拡大・海外展開をしたい",
              "イベント・事業運営支援がほしい",
              "事業を引き継ぎたい",
              "研究開発・実証事業を行いたい",
              "人材育成を行いたい",
              "資金繰りを改善したい",
              "設備整備・IT導入をしたい",
              "雇用・職場環境を改善したい",
              "エコ・SDGs活動支援がほしい",
              "災害（自然災害、感染症等）支援がほしい",
              "教育・子育て・少子化支援がほしい",
              "スポーツ・文化支援がほしい",
              "安全・防災対策支援がほしい",
              "まちづくり・地域振興支援がほしい"
            ],
            "type": "string",
            "description": "Passed as it is to the official jGrants search as the purpose filter (one value). How the API narrows the results is up to the API (not tested in this Actor).",
            "default": ""
          },
          "onlyAcceptingNow": {
            "title": "Only programs accepting applications now",
            "type": "boolean",
            "description": "On: the official search is asked only for programs inside an application period. Off: the search is not limited that way. What the API returns when this is off was not tested.",
            "default": true
          },
          "sortBy": {
            "title": "Sort",
            "enum": [
              "deadline",
              "start_newest",
              "amount_desc"
            ],
            "type": "string",
            "description": "The order in which programs are processed and returned. The sort is done inside this Actor.",
            "default": "deadline"
          },
          "maxItems": {
            "title": "Maximum programs",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "The cap for one run, on the programs counted and on the rows returned. A program is counted once its detail has been fetched (if \"Fetch program details\" is off: once it is taken from the sorted list). A program whose detail request returns no usable detail is skipped and not counted, so the number of detail requests can exceed this value. In \"all\" mode at most this many rows are returned. In \"changes_only\" mode programs without a change are counted but not returned: at most this many new / changed rows plus at most this many \"no longer listed\" rows are returned. If the environment variable APIFY_USER_IS_PAYING is not 1 and this value is above 10, the Actor uses 10.",
            "default": 10
          },
          "includeDetail": {
            "title": "Fetch program details",
            "type": "boolean",
            "description": "On: one extra request per program for summary text, rate, rounds and attachment fingerprints. Off: list fields only (fewer requests, but no summary, rate, rounds or attachments).",
            "default": true
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "all",
              "changes_only"
            ],
            "type": "string",
            "description": "all: return one row per counted program, up to the number set in \"Maximum programs\". changes_only: remember the previous run (see \"State name\") and return only programs that are new, changed, or no longer listed, with the changed fields and their previous values.",
            "default": "all"
          },
          "stateKey": {
            "title": "State name",
            "type": "string",
            "description": "Used by \"changes_only\". Runs with the same name share one memory of the previous run; use different names for different watch lists.",
            "default": "default"
          },
          "requestIntervalSeconds": {
            "title": "Seconds between requests",
            "minimum": 7,
            "maximum": 60,
            "type": "integer",
            "description": "Pause between requests to the official API, in whole seconds. The jGrants API terms (Article 5-5) prohibit heavy access in a short time. The minimum accepted value is 7, and 7 is the default. The Actor waits at least this many seconds between requests.",
            "default": 7
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}