{
  "openapi": "3.0.1",
  "info": {
    "title": "Polish Legal Acts API – Dziennik Ustaw & ELI",
    "description": "Polish legal acts (akty prawne) from the official Sejm ELI API — Dziennik Ustaw and Monitor Polski. Metadata, legal references and optional plain text. Export CSV, JSON or Excel.",
    "version": "0.1",
    "x-build-id": "kYrElB05HjBVPfWtW"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/enterprising_hamster~polish-legal-acts-eli/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-enterprising_hamster-polish-legal-acts-eli",
        "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/enterprising_hamster~polish-legal-acts-eli/runs": {
      "post": {
        "operationId": "runs-sync-enterprising_hamster-polish-legal-acts-eli",
        "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/enterprising_hamster~polish-legal-acts-eli/run-sync": {
      "post": {
        "operationId": "run-sync-enterprising_hamster-polish-legal-acts-eli",
        "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": {
          "publisher": {
            "title": "Publication",
            "enum": [
              "DU",
              "MP"
            ],
            "type": "string",
            "description": "DU searches Dziennik Ustaw. MP searches Monitor Polski.",
            "default": "DU"
          },
          "year": {
            "title": "Publication year",
            "minimum": 1,
            "maximum": 9999,
            "type": "integer",
            "description": "Optional publication year. Provide this or dateFrom. Omit it to search across years within a date range."
          },
          "dateFrom": {
            "title": "Start date",
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "type": "string",
            "description": "Inclusive lower date bound in YYYY-MM-DD format. Required when year is omitted. dateField selects the date being filtered."
          },
          "dateTo": {
            "title": "End date",
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "type": "string",
            "description": "Optional inclusive upper date bound in YYYY-MM-DD format. Must be on or after dateFrom. Omit unused date fields."
          },
          "dateField": {
            "title": "Date to filter",
            "enum": [
              "promulgation",
              "announcement",
              "effect"
            ],
            "type": "string",
            "description": "Promulgation uses pubDateFrom/pubDateTo, announcement uses dateFrom/dateTo, and effect uses dateEffectFrom/dateEffectTo in the ELI API.",
            "default": "promulgation"
          },
          "titleContains": {
            "title": "Words in the title",
            "type": "string",
            "description": "Optional title search. Polish inflection matters. Use the stem podatk for tax acts; podatek may return no matches. Omit this field for all titles."
          },
          "keywords": {
            "title": "Official keywords",
            "type": "array",
            "description": "Official Polish ELI subject keywords, sent as a comma-separated keyword parameter. Empty means no keyword filter.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "actTypes": {
            "title": "Act types",
            "type": "array",
            "description": "Exact Polish types, for example Ustawa, Rozporządzenie, or Obwieszczenie. One type is filtered by the API. Multiple types are matched locally with OR and can require more search pages.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "inForceOnly": {
            "title": "Only acts in force",
            "type": "boolean",
            "description": "Ask the ELI API to return only acts marked in force. Output inForce requires details when the search response omits it.",
            "default": false
          },
          "includeDetails": {
            "title": "Include act details",
            "type": "boolean",
            "description": "Fetch each act's details for keywords, references, issuing bodies, and inForce. Adds one request per act. Disable for search metadata only.",
            "default": true
          },
          "includeText": {
            "title": "Include plain text",
            "type": "boolean",
            "description": "Extract available HTML or PDF text. Successful text costs USD 0.008 per act. Missing or failed text costs the metadata rate of USD 0.002. No OCR is provided.",
            "default": false
          },
          "maxTextChars": {
            "title": "Maximum text characters",
            "minimum": 0,
            "maximum": 2147483647,
            "type": "integer",
            "description": "Zero means no user cutoff. An automatic ceiling of 8,000,000 characters and a JSON byte budget below the 9 MB dataset-item limit still apply. Positive values impose a smaller cutoff. textLength counts retained characters; textTruncated reports any truncation.",
            "default": 0
          },
          "sortOrder": {
            "title": "Publication position order",
            "enum": [
              "newest",
              "oldest"
            ],
            "type": "string",
            "description": "Newest means descending API publication position; oldest means ascending. Across years this does not guarantee chronological date order. Use year for one year's positions.",
            "default": "newest"
          },
          "maxItems": {
            "title": "Maximum output items",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard cap on delivered dataset items. Seen revisions and filtered act types do not count toward this limit.",
            "default": 100
          },
          "onlyNew": {
            "title": "Monitor new and changed acts",
            "type": "boolean",
            "description": "Skip previously delivered ELI plus changeDate revisions stored in a named key-value store. Retains the latest 50,000 revisions. Use serial runs for each stateKey and an overlapping publication date range to revisit changed acts.",
            "default": false
          },
          "stateKey": {
            "title": "Monitoring state key",
            "type": "string",
            "description": "Independent revision set within the named polish-legal-acts-seen store. Use 1-100 letters, digits, underscores, or hyphens. Changing this key starts a new monitoring history."
          },
          "maxRequestsPerSecond": {
            "title": "Maximum requests per second",
            "minimum": 0.2,
            "maximum": 10,
            "type": "number",
            "description": "Shared rate cap for search, details, text, and retries. Default 3 requests per second, maximum 10, with at most 2 requests in flight. Lower it during source outages.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}