{
  "openapi": "3.0.1",
  "info": {
    "title": "Japan Government Subsidies & Grants (jGrants)",
    "description": "Open Japanese government subsidy calls (補助金) from the official jGrants public API run by the Digital Agency. English field schema, source attribution embedded in every record, optional per-subsidy detail enrichment.",
    "version": "0.1",
    "x-build-id": "WfQPHDf5X4n4cFpcW"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jpopendata~japan-grants/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jpopendata-japan-grants",
        "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-grants/runs": {
      "post": {
        "operationId": "runs-sync-jpopendata-japan-grants",
        "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-grants/run-sync": {
      "post": {
        "operationId": "run-sync-jpopendata-japan-grants",
        "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": "Full-text search keyword, minimum 2 characters (upstream API requirement; Japanese works best). Default `補助金` (\"subsidy\") matches broadly.",
            "default": "補助金"
          },
          "acceptanceOnly": {
            "title": "Currently accepting only",
            "type": "boolean",
            "description": "If enabled (default), only subsidies whose application window is currently open are returned (upstream `acceptance=1`). Disable to include closed/upcoming calls.",
            "default": true
          },
          "includeDetail": {
            "title": "Fetch per-subsidy detail",
            "type": "boolean",
            "description": "If enabled, the actor calls the detail API once per record (politeness-throttled, ~1 record / 1.2 s) and adds usePurpose, industry, subsidyRate, application periods, and attachment METADATA (file names only — binaries are never downloaded). Each detail is one API request, so coverage is capped by `maxApiRequests`.",
            "default": false
          },
          "usePurpose": {
            "title": "Use purpose (利用目的)",
            "type": "string",
            "description": "Optional server-side filter. Must match one of the portal's Japanese labels verbatim, e.g. `新たな事業を行いたい`, `設備整備・IT導入をしたい`, `まちづくり・地域振興支援がほしい`, `研究開発・実証事業を行いたい`. A non-matching value simply returns 0 hits (the actor warns)."
          },
          "industry": {
            "title": "Industry (業種)",
            "type": "string",
            "description": "Optional server-side filter. Japan Standard Industrial Classification division label in Japanese, verbatim — e.g. `製造業`, `情報通信業`, `建設業`, `医療、福祉`. A non-matching value returns 0 hits (the actor warns)."
          },
          "targetAreaSearch": {
            "title": "Target area (対象地域)",
            "type": "string",
            "description": "Optional server-side filter: `全国` (nationwide) or a prefecture name in Japanese, e.g. `東京都`, `大阪府`, `北海道`, `神奈川県`."
          },
          "targetNumberOfEmployees": {
            "title": "Target company size (従業員数)",
            "type": "string",
            "description": "Optional server-side filter. Portal labels, verbatim — e.g. `従業員数の制約なし`, `5名以下`, `20名以下`, `50名以下`, `100名以下`, `300名以下`, `900名以下`, `901名以上`."
          },
          "sort": {
            "title": "Sort by",
            "enum": [
              "acceptance_end_datetime",
              "acceptance_start_datetime",
              "created_date"
            ],
            "type": "string",
            "description": "Upstream sort field. Default sorts by application deadline (soonest first with order=ASC).",
            "default": "acceptance_end_datetime"
          },
          "order": {
            "title": "Sort order",
            "enum": [
              "ASC",
              "DESC"
            ],
            "type": "string",
            "description": "Sort order",
            "default": "ASC"
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of records to output. The list API returns the full hit set in one request; this truncates client-side (after upstream sorting).",
            "default": 100
          },
          "maxApiRequests": {
            "title": "Max API requests per run",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Hard safety cap on upstream API requests in one run (politeness: the API rate-limits sustained bulk access). 1 request is the list; with includeDetail each record costs 1 more. The run stops enriching gracefully when the cap is hit.",
            "default": 60
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify proxy settings. Default is NO proxy (direct connection). The actor backs off exponentially on 429/5xx and fails visibly on a persistent block — it never attempts rate-limit 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}