{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Police Crime Data: Street Crime, Stop & Search, Outcomes",
    "description": "Street-level crimes with category, street, map point and latest outcome, plus stop and search records and neighbourhood policing priorities, from data.police.uk, the official UK police open data API. Search by GB postcode or coordinates and month; free counts by crime type per area.",
    "version": "0.1",
    "x-build-id": "MVGlRAZTxhaBBYlte"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/zaiqltd~uk-crime-data/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-zaiqltd-uk-crime-data",
        "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-crime-data/runs": {
      "post": {
        "operationId": "runs-sync-zaiqltd-uk-crime-data",
        "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-crime-data/run-sync": {
      "post": {
        "operationId": "run-sync-zaiqltd-uk-crime-data",
        "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": {
          "locations": {
            "title": "Postcodes or coordinates",
            "type": "array",
            "description": "1-50 places: GB postcodes (SW1A 2AA), outward codes (M1) or latitude,longitude (53.4808,-2.2426). Each is searched in the one-mile radius data.police.uk uses. Northern Ireland: use coordinates.",
            "items": {
              "type": "string"
            },
            "default": [
              "SW1A 2AA"
            ]
          },
          "months": {
            "title": "Months (YYYY-MM)",
            "type": "array",
            "description": "Up to 12 months, e.g. 2026-09. Leave empty for the latest month published. data.police.uk keeps the last 36 months and publishes each month about 6-8 weeks after it ends.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "dataTypes": {
            "title": "Data to fetch",
            "type": "array",
            "description": "Crimes (street-level crimes and anti-social behaviour with the latest outcome), stop and search records, and the neighbourhood policing team with its current priorities.",
            "items": {
              "type": "string",
              "enum": [
                "crimes",
                "stopAndSearch",
                "neighbourhood"
              ],
              "enumTitles": [
                "Street-level crimes and anti-social behaviour",
                "Stop and search",
                "Neighbourhood team and priorities"
              ]
            },
            "default": [
              "crimes"
            ]
          },
          "crimeCategories": {
            "title": "Crime types",
            "type": "array",
            "description": "Only these crime types (crimes data only). Leave empty for every type. Free summaries count only the chosen types.",
            "items": {
              "type": "string",
              "enum": [
                "anti-social-behaviour",
                "bicycle-theft",
                "burglary",
                "criminal-damage-arson",
                "drugs",
                "other-theft",
                "possession-of-weapons",
                "public-order",
                "robbery",
                "shoplifting",
                "theft-from-the-person",
                "vehicle-crime",
                "violent-crime",
                "other-crime"
              ],
              "enumTitles": [
                "Anti-social behaviour",
                "Bicycle theft",
                "Burglary",
                "Criminal damage and arson",
                "Drugs",
                "Other theft",
                "Possession of weapons",
                "Public order",
                "Robbery",
                "Shoplifting",
                "Theft from the person",
                "Vehicle crime",
                "Violence and sexual offences",
                "Other crime"
              ]
            },
            "default": []
          },
          "maxRecordsPerLocation": {
            "title": "Maximum records per place, month and data type",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "A cap on paid rows for each place, month and data type (1-10000). The free summary still counts every record found. A busy city-centre square mile can have 2,000+ crimes a month.",
            "default": 100
          },
          "includeOutcomeHistory": {
            "title": "Full outcome history per crime",
            "type": "boolean",
            "description": "Adds every outcome the police and courts recorded for each crime (one extra request per crime, so slower). Off: the latest outcome only.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}