{
  "openapi": "3.0.1",
  "info": {
    "title": "Hlídač Státu + ARES",
    "description": "Search and monitor Czech public contracts from Hlídač státu. Filter by buyer or supplier IČO, keywords, dates, value, and attention indicators; enrich each organization with official ARES company data. Export clean results or schedule monitoring for newly published contracts.",
    "version": "0.2",
    "x-build-id": "DKUFVUdBC560UA9pl"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fetchfinch~hlidac-statu-ares-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fetchfinch-hlidac-statu-ares-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/fetchfinch~hlidac-statu-ares-monitor/runs": {
      "post": {
        "operationId": "runs-sync-fetchfinch-hlidac-statu-ares-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/fetchfinch~hlidac-statu-ares-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-fetchfinch-hlidac-statu-ares-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",
        "required": [
          "operation"
        ],
        "properties": {
          "operation": {
            "title": "What should this run do?",
            "enum": [
              "search",
              "monitor"
            ],
            "type": "string",
            "description": "Search returns current matches. Monitor stores a baseline and returns only contracts not seen on earlier scheduled runs.",
            "default": "search"
          },
          "searchTerms": {
            "title": "Keywords or phrase",
            "maxLength": 500,
            "type": "string",
            "description": "Words searched across the contract register. Czech inflection and Hlídač full-text behavior apply. Clear this when another guided filter is sufficient."
          },
          "buyerIcos": {
            "title": "Public buyers — IČOs",
            "maxItems": 100,
            "type": "array",
            "description": "Return contracts where any of these entities is the payer/buyer. IČOs are normalized and checksum-validated.",
            "items": {
              "type": "string",
              "pattern": "^[0-9 ]{1,12}$"
            },
            "default": []
          },
          "supplierIcos": {
            "title": "Suppliers — IČOs",
            "maxItems": 100,
            "type": "array",
            "description": "Return contracts where any of these entities is a recipient/supplier.",
            "items": {
              "type": "string",
              "pattern": "^[0-9 ]{1,12}$"
            },
            "default": []
          },
          "publishedFrom": {
            "title": "Published from",
            "type": "string",
            "description": "Optional inclusive Register-of-Contracts publication date."
          },
          "publishedTo": {
            "title": "Published through",
            "type": "string",
            "description": "Optional inclusive publication end date."
          },
          "signedFrom": {
            "title": "Signed from",
            "type": "string",
            "description": "Optional inclusive contract signing date."
          },
          "signedTo": {
            "title": "Signed through",
            "type": "string",
            "description": "Optional inclusive signing end date."
          },
          "minValueCzk": {
            "title": "Minimum calculated value (CZK)",
            "minimum": 0,
            "type": "number",
            "description": "Minimum Hlídač-calculated contract value including VAT."
          },
          "maxValueCzk": {
            "title": "Maximum calculated value (CZK)",
            "minimum": 0,
            "type": "number",
            "description": "Maximum Hlídač-calculated contract value including VAT."
          },
          "categories": {
            "title": "Contract categories",
            "type": "array",
            "description": "Optional top-level categories assigned by Hlídač. A contract may match more than one selected category.",
            "items": {
              "type": "string",
              "enum": [
                "it",
                "stav",
                "doprava",
                "stroje",
                "telco",
                "zdrav",
                "jidlo",
                "bezpecnost",
                "prirodnizdroj",
                "energie",
                "agro",
                "kancelar",
                "remeslo",
                "social",
                "finance",
                "legal",
                "techsluzby",
                "vyzkum",
                "marketing",
                "jine",
                "dary",
                "zvirata"
              ],
              "enumTitles": [
                "IT",
                "Construction",
                "Transport and postal services",
                "Machinery and equipment",
                "Telecommunications",
                "Healthcare",
                "Water and food",
                "Security equipment and services",
                "Natural resources",
                "Energy",
                "Agriculture",
                "Office supplies and services",
                "Trades",
                "Social services",
                "Finance",
                "Legal and real-estate services",
                "Technical services",
                "Science, research and education",
                "Advertising and marketing",
                "Other services",
                "Gifts and subsidies",
                "Animals"
              ]
            },
            "default": []
          },
          "onlyWithIssues": {
            "title": "Only contracts with Hlídač issues",
            "type": "boolean",
            "description": "Post-filter retrieved contracts to those with at least one Hlídač issue record.",
            "default": false
          },
          "onlyMissingPrice": {
            "title": "Only contracts with no positive price",
            "type": "boolean",
            "description": "Post-filter contracts where no positive supplied or calculated value is available.",
            "default": false
          },
          "onlyNearProcurementLimit": {
            "title": "Only contracts near a procurement threshold",
            "type": "boolean",
            "description": "Post-filter using Hlídač's near-threshold analytical hint.",
            "default": false
          },
          "onlyPoliticalLink": {
            "title": "Only contracts with a reported political connection",
            "type": "boolean",
            "description": "Post-filter using current, recent, historical, or analytical political-connection fields from Hlídač.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum output contracts",
            "minimum": 1,
            "maximum": 2500,
            "type": "integer",
            "description": "Maximum visible results written to the dataset and charged in this run.",
            "default": 100
          },
          "scanLimit": {
            "title": "Maximum contracts scanned",
            "minimum": 1,
            "maximum": 2500,
            "type": "integer",
            "description": "Used when attention-indicator post-filters are enabled. A larger scan can find more qualifying results but performs more source requests. It never increases output above maxItems.",
            "default": 500
          },
          "aresEnrichment": {
            "title": "Add official ARES entity data",
            "type": "boolean",
            "description": "Add registered name/address, legal-form code, tax ID, CZ-NACE activities, source status, and update date for buyers and suppliers.",
            "default": true
          },
          "includeAttachments": {
            "title": "Include attachment metadata",
            "type": "boolean",
            "description": "Include pages, content type, extraction quality, word counts, and redaction statistics. Binary files and full extracted text are always excluded.",
            "default": false
          },
          "sort": {
            "title": "Contract sort",
            "enum": [
              "relevance",
              "newest_published",
              "oldest_published",
              "lowest_value",
              "highest_value",
              "most_issues"
            ],
            "type": "string",
            "description": "Monitor mode always scans newest published contracts first.",
            "default": "newest_published"
          },
          "advancedQuery": {
            "title": "Advanced Hlídač query",
            "maxLength": 3000,
            "type": "string",
            "description": "Optional raw Hlídač query clause ANDed with the guided filters. Intended for users familiar with Hlídač/Elastic query syntax."
          },
          "monitorKey": {
            "title": "Monitor key",
            "pattern": "^[A-Za-z0-9_-]{3,80}$",
            "type": "string",
            "description": "Stable ID reused by scheduled runs. Use a different key for each saved search.",
            "default": "my-contract-monitor"
          },
          "firstRunBehavior": {
            "title": "First monitor run",
            "enum": [
              "baseline_only",
              "emit_current"
            ],
            "type": "string",
            "description": "Store baseline only avoids an initial flood. Emit current contracts returns the first snapshot as NEW events.",
            "default": "baseline_only"
          },
          "resetState": {
            "title": "Reset saved monitor",
            "type": "boolean",
            "description": "Delete the baseline for this monitor key before the run.",
            "default": false
          },
          "stateStoreName": {
            "title": "Advanced: named state store",
            "pattern": "^[A-Za-z0-9_-]{3,63}$",
            "type": "string",
            "description": "Named key-value store shared by scheduled runs.",
            "default": "hlidac-statu-monitor-state"
          },
          "requestTimeoutSecs": {
            "title": "Advanced: API timeout (seconds)",
            "minimum": 10,
            "maximum": 180,
            "type": "integer",
            "description": "Per-request timeout.",
            "default": 45
          },
          "maxRequestRetries": {
            "title": "Advanced: API retries",
            "minimum": 0,
            "maximum": 6,
            "type": "integer",
            "description": "Retries for throttling, server errors, and transient network failures.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}