{
  "openapi": "3.0.1",
  "info": {
    "title": "Poland Court Judgments API – SAOS Case Law",
    "description": "Search Polish court judgments (orzeczenia sądów) from the official SAOS API by court, date and phrase. Get case numbers, judges, keywords and optional published full text. Export CSV, JSON or Excel.",
    "version": "0.1",
    "x-build-id": "cY1Re7eq1AsQIXRch"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/enterprising_hamster~polish-court-judgments-saos/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-enterprising_hamster-polish-court-judgments-saos",
        "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-court-judgments-saos/runs": {
      "post": {
        "operationId": "runs-sync-enterprising_hamster-polish-court-judgments-saos",
        "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-court-judgments-saos/run-sync": {
      "post": {
        "operationId": "run-sync-enterprising_hamster-polish-court-judgments-saos",
        "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": {
          "courtType": {
            "title": "Court type",
            "enum": [
              "ANY",
              "COMMON",
              "SUPREME",
              "ADMINISTRATIVE",
              "CONSTITUTIONAL_TRIBUNAL",
              "NATIONAL_APPEAL_CHAMBER"
            ],
            "type": "string",
            "description": "ANY searches all available courts. Coverage checked 2026-10-18: COMMON about 474k judgments through 2026; SUPREME latest June 2016; Constitutional Tribunal December 2015; National Appeal Chamber September 2018; ADMINISTRATIVE no results. SAOS is incomplete and freshness varies.",
            "default": "ANY"
          },
          "commonCourtType": {
            "title": "Common court subtype",
            "enum": [
              "",
              "APPEAL",
              "REGIONAL",
              "DISTRICT"
            ],
            "type": "string",
            "description": "Optional. Requires courtType COMMON. Sent as ccCourtType.",
            "default": ""
          },
          "dateFrom": {
            "title": "Judgment date from",
            "type": "string",
            "description": "Inclusive start date, YYYY-MM-DD. Empty means no lower bound.",
            "default": ""
          },
          "dateTo": {
            "title": "Judgment date to",
            "type": "string",
            "description": "Inclusive end date, YYYY-MM-DD. Empty means no upper bound.",
            "default": ""
          },
          "phrase": {
            "title": "Search phrase",
            "type": "string",
            "description": "Searches metadata and text using SAOS query language. Use double quotes for an exact phrase, for example \"kredyt frankowy\".",
            "default": ""
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Exact SAOS subject keywords. All supplied keywords must match (AND). Source keywords are available for common courts.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "judgmentTypes": {
            "title": "Judgment types",
            "type": "array",
            "description": "Include any selected judgment type (OR). Empty includes all types.",
            "items": {
              "type": "string",
              "enum": [
                "DECISION",
                "RESOLUTION",
                "SENTENCE",
                "REGULATION",
                "REASONS"
              ],
              "enumTitles": [
                "Decision (postanowienie)",
                "Resolution (uchwała)",
                "Sentence (wyrok)",
                "Regulation (zarządzenie)",
                "Reasons (uzasadnienie)"
              ]
            },
            "default": []
          },
          "includeFullText": {
            "title": "Include full text",
            "type": "boolean",
            "description": "Fetch individual judgment details. Successful text costs $0.01 per delivered judgment; metadata and text failures cost $0.003. Search snippets alone are not full text.",
            "default": false
          },
          "onlyWithText": {
            "title": "Only judgments with a text snippet",
            "type": "boolean",
            "description": "Skip empty search snippets before fetching details, saving rows, or charging. Defaults to true with includeFullText and false for metadata. Set false explicitly to include empty snippets. A nonempty snippet does not guarantee usable full text."
          },
          "textFormat": {
            "title": "Full text format",
            "enum": [
              "plain",
              "html"
            ],
            "type": "string",
            "description": "Plain text preserves paragraphs and published anonymisation markers. HTML preserves source markup.",
            "default": "plain"
          },
          "maxTextChars": {
            "title": "Maximum text characters",
            "minimum": 0,
            "type": "integer",
            "description": "Full text character cap after formatting. Zero means unlimited. Capped HTML may end inside a tag. textLength reports the original formatted length.",
            "default": 0
          },
          "sortOrder": {
            "title": "Sort order",
            "enum": [
              "newest",
              "oldest"
            ],
            "type": "string",
            "description": "Sort by judgment date. The source may contain invalid or future dates.",
            "default": "newest"
          },
          "skipInvalidDates": {
            "title": "Skip invalid dates",
            "type": "boolean",
            "description": "Skip malformed dates, years outside 1900–2100, and dates after the UTC scrape date. Skipped records are not charged.",
            "default": true
          },
          "maxItems": {
            "title": "Maximum output items",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard cap on actual dataset rows. Skipped records do not count. Text filtering may require more search pages to fill this cap.",
            "default": 100
          },
          "onlyNew": {
            "title": "Only new IDs",
            "type": "boolean",
            "description": "Skip IDs retained in a named key-value store. Retains the most recent 50,000 delivered IDs. Does not detect edits. Avoid concurrent runs sharing stateKey.",
            "default": false
          },
          "stateKey": {
            "title": "Seen state key",
            "type": "string",
            "description": "Persistent ID set key. Use 1–100 letters, digits, underscores, or hyphens. Use different keys for independent feeds."
          },
          "maxRequestsPerSecond": {
            "title": "Maximum requests per second",
            "minimum": 0.2,
            "maximum": 3,
            "type": "number",
            "description": "Shared rate cap across search, details, and retries. Default 1 request/second; maximum 3. At most 2 requests in flight.",
            "default": 1
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}