{
  "openapi": "3.0.1",
  "info": {
    "title": "Hilma Tender Watcher",
    "description": "Daily scan of Finnish public-procurement notices (Hilma) with AI relevance scoring. Bring your ICP — get back only tenders worth pitching, with Finnish-language rationale per match. Webhook for hot leads (score 70+). Uses Hilma's official free API + your Anthropic key.",
    "version": "0.1",
    "x-build-id": "GNfEC3V7uKEE1u1WY"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/aihu~hilma-tender-watcher/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-aihu-hilma-tender-watcher",
        "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/aihu~hilma-tender-watcher/runs": {
      "post": {
        "operationId": "runs-sync-aihu-hilma-tender-watcher",
        "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/aihu~hilma-tender-watcher/run-sync": {
      "post": {
        "operationId": "run-sync-aihu-hilma-tender-watcher",
        "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",
        "required": [
          "icp_description",
          "anthropic_api_key",
          "hilma_api_key"
        ],
        "properties": {
          "icp_description": {
            "title": "ICP description",
            "type": "string",
            "description": "Describe your ideal procurement target in Finnish or English. The LLM uses this to score each notice's fit. One paragraph is enough."
          },
          "keywords": {
            "title": "Keywords (case-insensitive)",
            "type": "array",
            "description": "Notice title or description must include at least one keyword. Leave empty for no keyword filter.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "cpv_code_prefixes": {
            "title": "CPV code prefixes",
            "type": "array",
            "description": "Match notices with any CPV code starting with one of these prefixes (e.g. '72' for IT services, '80' for education).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "buyer_includes": {
            "title": "Buyer-org includes",
            "type": "array",
            "description": "Buyer organization name must contain at least one of these substrings (case-insensitive).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "buyer_excludes": {
            "title": "Buyer-org excludes",
            "type": "array",
            "description": "Buyer organization name must NOT contain any of these substrings (case-insensitive).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "min_value_eur": {
            "title": "Minimum value (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip notices with declared value below this. Leave empty for no minimum. Notices without a declared value are kept by default."
          },
          "min_relevance_score": {
            "title": "Minimum relevance score",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Only output notices scoring at or above this (0-100). Default 60.",
            "default": 60
          },
          "webhook_url": {
            "title": "Webhook URL (optional)",
            "type": "string",
            "description": "POST a JSON payload here for every notice scoring 70 or above. Use a Slack incoming webhook, n8n, or your own endpoint."
          },
          "anthropic_api_key": {
            "title": "Anthropic API key",
            "type": "string",
            "description": "Your own Anthropic API key. Get one at https://console.anthropic.com. Used to score notice relevance with Claude Haiku."
          },
          "hilma_api_key": {
            "title": "Hilma API key (avp-read)",
            "type": "string",
            "description": "Your free Hilma API key from https://hns-hilma-prod-apim.developer.azure-api.net/ — register, subscribe to the avp-read product, copy the primary key. Sanctioned official endpoint, designed for value-added services like this Actor."
          },
          "max_notices_to_fetch": {
            "title": "Max notices per run",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Safety cap on total notices fetched per run. Useful for testing.",
            "default": 500
          },
          "since_hours": {
            "title": "Lookback window (hours)",
            "minimum": 1,
            "maximum": 168,
            "type": "integer",
            "description": "How far back to look for new notices. Default 24h matches a daily schedule. Increase to 48-72 for safety on first runs.",
            "default": 24
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}