{
  "openapi": "3.0.1",
  "info": {
    "title": "Belgian Gazette Monitor — Staatsblad Delta (KBO)",
    "description": "Delta monitor for the Belgian Official Gazette (Belgisch Staatsblad / Moniteur belge) and KBO company filings: new filings, board changes, dissolutions, new publications — run-over-run events, not a stateless re-export. Full-text + KBO extraction. FPS Justice CC0 open data.",
    "version": "0.1",
    "x-build-id": "AIacOC9CGuftpchh4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/masterly_function~belgian-gazette-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-masterly_function-belgian-gazette-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/masterly_function~belgian-gazette-monitor/runs": {
      "post": {
        "operationId": "runs-sync-masterly_function-belgian-gazette-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/masterly_function~belgian-gazette-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-masterly_function-belgian-gazette-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "gazette",
              "registrations"
            ],
            "type": "string",
            "description": "gazette = Belgisch Staatsblad publications (laws, decrees, orders). registrations = Bijlage van de Rechtspersonen (KBO company filings).",
            "default": "registrations"
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "YYYY-MM-DD. Default: yesterday.",
            "default": "YESTERDAY"
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "YYYY-MM-DD. Default: today.",
            "default": "TODAY"
          },
          "language": {
            "title": "Interface language",
            "enum": [
              "nl",
              "fr"
            ],
            "type": "string",
            "description": "Which ejustice interface to query. The per-filing language is reported separately from this choice (incumbent conflates the two).",
            "default": "nl"
          },
          "searchQuery": {
            "title": "Search query (gazette + registrations mode)",
            "type": "string",
            "description": "Keyword filter. Gazette mode: full text of each publication (article.pl HTML). Registrations mode: full text of each filing PDF (tsv_pdf, pdf-parse — text layer verified 2026-09-05); KBO near the 'Ondernemingsnr' label is extracted as kboEnterpriseNumber."
          },
          "documentType": {
            "title": "Document type (gazette mode)",
            "type": "string",
            "description": "e.g. Wet, Koninklijk besluit, Ministerieel besluit."
          },
          "category": {
            "title": "Registration category (registrations mode)",
            "type": "string",
            "description": "e.g. Oprichting, Einde, Benaming, Maatschappelijke zetel, Kapitaal, Ontslagen - benoemingen, Statuten, Jaarrekeningen."
          },
          "companyName": {
            "title": "Company name contains (registrations mode)",
            "type": "string",
            "description": "Case-insensitive substring match on the registered company name (client-side). Deliberately NOT the server-side naam parameter: naam+postalCode combined is a server-side quirk on ejustice (returns 'Geen' when both individually match), so this actor filters the parsed rows instead."
          },
          "legalForm": {
            "title": "Legal form (registrations mode)",
            "type": "string",
            "description": "Case-insensitive substring match on the filing's legal form (e.g. BV, NV, VZW, ASBL) as published in the Bijlage row."
          },
          "enterpriseNumber": {
            "title": "Enterprise number (registrations mode)",
            "type": "string",
            "description": "KBO/BTW number to monitor a specific company. LIVE via the native Bijlage search endpoint (rech_res.pl): accepts 0758528122 / 758528122 / 0758.528.122. Server-side date window; result rows key on the same docid as the day index, so both paths dedupe against one state."
          },
          "postalCode": {
            "title": "Postal code (registrations mode)",
            "type": "string",
            "description": "Registered-office postal code (rech_res.pl postkode). Broad queries over long windows trip the server-side 10.000-result cap — surfaced as a run_status row, never silence; narrow the window."
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Upper bound on rows emitted per run. Delta monitors rarely need more than a few hundred.",
            "default": 500
          },
          "emitDeltaOnly": {
            "title": "Emit delta events only",
            "type": "boolean",
            "description": "true = only filings/publications not seen in any prior run (persistent state per mode). false = full export of the window.",
            "default": true
          },
          "resetState": {
            "title": "Reset state (testing only)",
            "type": "boolean",
            "description": "Wipes tracking state before the run. Never enable on a schedule.",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}