{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Court Listings",
    "description": "Daily hearing lists from the HMCTS Court and Tribunal Hearings service. Case number, party, hearing type, time, courtroom and judge for Crown, magistrates, civil, family, tribunal and Insolvency and Companies Court lists.",
    "version": "0.1",
    "x-build-id": "tJ1HtWgTCoH2LXei7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/spookyweb~uk-court-listings/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-spookyweb-uk-court-listings",
        "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/spookyweb~uk-court-listings/runs": {
      "post": {
        "operationId": "runs-sync-spookyweb-uk-court-listings",
        "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/spookyweb~uk-court-listings/run-sync": {
      "post": {
        "operationId": "run-sync-spookyweb-uk-court-listings",
        "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": {
          "courtNames": {
            "title": "🏛 Court or tribunal names",
            "type": "array",
            "description": "Names of the courts to read, matched as a case insensitive substring, so \"Manchester\" reaches every Manchester court and \"Crown Court\" reaches all of them. Leave empty to read every court the service publishes. Apostrophes and punctuation are ignored when matching.",
            "items": {
              "type": "string"
            }
          },
          "locationIds": {
            "title": "🏛 Court location IDs",
            "type": "array",
            "description": "Numeric HMCTS location ids, used instead of or alongside the names when you already know the exact court. For example 111 is the Business and Property Courts at the Rolls Building and 109 is the Royal Courts of Justice.",
            "items": {
              "type": "string"
            }
          },
          "maxCourts": {
            "title": "Maximum courts to read",
            "minimum": 1,
            "maximum": 400,
            "type": "integer",
            "description": "Hard cap on how many matching courts are visited in one run. The service publishes around 365 courts, so a run with no court filter is capped by this number rather than by patience.",
            "default": 25
          },
          "listTypes": {
            "title": "📋 List types",
            "type": "array",
            "description": "Keep only lists whose type contains one of these words, for example insolvency, crown, magistrates, family, civil or sscs. Leave empty to keep every list the selected courts publish.",
            "items": {
              "type": "string"
            }
          },
          "listDateFrom": {
            "title": "📅 Earliest list date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Keep only lists dated on or after this day, written as YYYY-MM-DD. Lists appear the working day before the hearing and are removed once the day has passed, so this is a narrow window in practice."
          },
          "listDateTo": {
            "title": "📅 Latest list date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Keep only lists dated on or before this day, written as YYYY-MM-DD. Use it with the earliest list date to pin the run to a single hearing day."
          },
          "includeWelsh": {
            "title": "Include Welsh language editions",
            "type": "boolean",
            "description": "Welsh courts publish the same list twice, once in English and once in Welsh. They are excluded by default so the same hearing is not returned and billed twice.",
            "default": false
          },
          "caseNumberContains": {
            "title": "🔍 Case number contains",
            "type": "string",
            "description": "Keep only hearings whose case number contains this text, matched without case sensitivity. A prefix such as CR-2026 picks out this year's companies cases, and a full reference tracks one case."
          },
          "partyContains": {
            "title": "🔍 Party name contains",
            "type": "string",
            "description": "Keep only hearings naming this party, matched across the case name, applicant, respondent and prosecuting authority columns because each list type names the parties in a different place."
          },
          "hearingTypeContains": {
            "title": "🔍 Hearing type contains",
            "type": "string",
            "description": "Keep only hearings of this kind, for example \"winding up\", \"companies application\", \"sentence\" or \"trial\". Matched as a case insensitive substring of the hearing type column."
          },
          "judgeContains": {
            "title": "🔍 Judge name contains",
            "type": "string",
            "description": "Keep only hearings before a judge whose name contains this text. Useful for following one judge's list across a week, or for isolating a specialist judge within a large court."
          },
          "maxHearings": {
            "title": "Maximum hearings",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Hard cap on the number of hearings saved in one run. Each hearing saved is one billable result, so this is also the ceiling on what a single run can cost.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}