{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Legislation Search: Acts, SIs, In-Force Status & Changes",
    "description": "UK Acts, statutory instruments and other legislation with type, number, dates, extent, revised version date, whole-item repeal, outstanding changes, contents and amendment history, from legislation.gov.uk (The National Archives). Search by title or full text, or look up by ID.",
    "version": "0.1",
    "x-build-id": "zlohgxHNZa6FdHo7d"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/zaiqltd~uk-legislation-search/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-zaiqltd-uk-legislation-search",
        "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/zaiqltd~uk-legislation-search/runs": {
      "post": {
        "operationId": "runs-sync-zaiqltd-uk-legislation-search",
        "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/zaiqltd~uk-legislation-search/run-sync": {
      "post": {
        "operationId": "run-sync-zaiqltd-uk-legislation-search",
        "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": {
          "searches": {
            "title": "Searches",
            "type": "array",
            "description": "1-20 searches, e.g. data protection, \"Online Safety Act\" or employment rights. Matched in titles, or in the full text with Search in = full text.",
            "items": {
              "type": "string"
            },
            "default": [
              "data protection"
            ]
          },
          "searchIn": {
            "title": "Search in",
            "enum": [
              "title",
              "text"
            ],
            "type": "string",
            "description": "Titles (fast) or the full text of the legislation (legislation.gov.uk takes 10-30 seconds a page).",
            "default": "title"
          },
          "legislation": {
            "title": "Look up legislation",
            "type": "array",
            "description": "Identifiers or links, e.g. ukpga/2018/12 or https://www.legislation.gov.uk/uksi/2026/386. Up to 100.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "types": {
            "title": "Types",
            "type": "array",
            "description": "Leave empty for all UK legislation (excluding legislation originating from the EU).",
            "items": {
              "type": "string",
              "enum": [
                "ukpga",
                "uksi",
                "asp",
                "ssi",
                "asc",
                "anaw",
                "wsi",
                "nia",
                "nisr",
                "ukla",
                "ukppa",
                "ukcm",
                "ukmo",
                "nisi",
                "eur",
                "eudr",
                "eudn",
                "ukdsi",
                "primary",
                "secondary",
                "eu-origin",
                "draft"
              ],
              "enumTitles": [
                "UK Public General Acts",
                "UK Statutory Instruments",
                "Acts of the Scottish Parliament",
                "Scottish Statutory Instruments",
                "Acts of Senedd Cymru",
                "Acts of the National Assembly for Wales",
                "Welsh Statutory Instruments",
                "Acts of the Northern Ireland Assembly",
                "Northern Ireland Statutory Rules",
                "UK Local Acts",
                "UK Private and Personal Acts",
                "Church Measures",
                "UK Ministerial Orders",
                "Northern Ireland Orders in Council",
                "Regulations originating from the EU",
                "Directives originating from the EU",
                "Decisions originating from the EU",
                "UK Draft Statutory Instruments",
                "All primary legislation",
                "All secondary legislation",
                "All legislation originating from the EU",
                "All draft legislation"
              ]
            },
            "default": []
          },
          "startYear": {
            "title": "From year",
            "minimum": 1200,
            "maximum": 2100,
            "type": "integer",
            "description": "Only legislation from this year on."
          },
          "endYear": {
            "title": "To year",
            "minimum": 1200,
            "maximum": 2100,
            "type": "integer",
            "description": "Only legislation up to this year."
          },
          "maxResultsPerSearch": {
            "title": "Maximum items per search",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "A cap on paid legislation rows per search. The free summary still gives the total number of matches.",
            "default": 10
          },
          "includeDetails": {
            "title": "Details and in-force status",
            "type": "boolean",
            "description": "Extent, revised-version date, provision count, made dates and outstanding changes for each item: one more request per item (5 seconds each, as the site asks).",
            "default": true
          },
          "includeSections": {
            "title": "Table of contents",
            "type": "boolean",
            "description": "Adds every section, regulation and schedule with its link, extent and repealed or prospective status (same request as the details).",
            "default": false
          },
          "includeChanges": {
            "title": "Changes (amendment history)",
            "type": "boolean",
            "description": "Adds the newest changes affecting each item as paid change rows: amendments, repeals and commencements, applied or not, with in-force dates.",
            "default": false
          },
          "maxChangesPerItem": {
            "title": "Maximum changes per item",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Newest first. Big Acts have thousands of recorded changes.",
            "default": 20
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}