{
  "openapi": "3.0.1",
  "info": {
    "title": "UK HGV Operator Licence Search: Haulage Companies & Fleet Leads",
    "description": "Every UK HGV (goods vehicle) and PSV operator licence from the Traffic Commissioners: haulage companies, coach and bus operators, fleet size, operating centres, postcodes and Companies House numbers. Filter by area and fleet size; track new licences.",
    "version": "0.1",
    "x-build-id": "JyRAx1bRxCIWUykzM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datatoolsuk~uk-hgv-operator-licences/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datatoolsuk-uk-hgv-operator-licences",
        "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/datatoolsuk~uk-hgv-operator-licences/runs": {
      "post": {
        "operationId": "runs-sync-datatoolsuk-uk-hgv-operator-licences",
        "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/datatoolsuk~uk-hgv-operator-licences/run-sync": {
      "post": {
        "operationId": "run-sync-datatoolsuk-uk-hgv-operator-licences",
        "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": {
          "trafficAreas": {
            "title": "Traffic areas",
            "type": "array",
            "description": "Leave empty for all of Great Britain (about 69,000 licences). Choosing fewer areas makes runs faster and cheaper.",
            "items": {
              "type": "string",
              "enum": [
                "East of England",
                "North East of England",
                "North West of England",
                "Scotland",
                "London and the South East of England",
                "Wales",
                "West Midlands",
                "West of England"
              ]
            }
          },
          "licenceCategories": {
            "title": "Licence category",
            "type": "array",
            "description": "Goods or PSV.",
            "items": {
              "type": "string",
              "enum": [
                "Goods",
                "PSV"
              ],
              "enumTitles": [
                "Goods vehicles (HGV/LGV, O-licence)",
                "Public service vehicles (buses/coaches)"
              ]
            }
          },
          "licenceTypes": {
            "title": "Licence type",
            "type": "array",
            "description": "Standard licences are for hire-and-reward hauliers; Restricted licences are firms carrying their own goods.",
            "items": {
              "type": "string",
              "enum": [
                "Standard National",
                "Standard International",
                "Restricted"
              ]
            }
          },
          "statuses": {
            "title": "Licence status",
            "type": "array",
            "description": "The register lists current licences only (valid, curtailed or suspended).",
            "items": {
              "type": "string",
              "enum": [
                "Valid",
                "Curtailed",
                "Suspended"
              ]
            }
          },
          "minVehicles": {
            "title": "Minimum vehicles authorised",
            "minimum": 0,
            "type": "integer",
            "description": "Only fleets authorised for at least this many vehicles."
          },
          "operatorName": {
            "title": "Operator name contains",
            "type": "string",
            "description": "Case-insensitive, e.g. 'haulage', 'coaches', 'logistics'."
          },
          "postcodePrefixes": {
            "title": "Postcode prefixes",
            "type": "array",
            "description": "Match operating centre or correspondence postcodes, e.g. 'CF', 'B', 'M1', 'SW1A'. 'B' matches Birmingham postcodes but not BS/BD.",
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "all",
              "newOnly",
              "changes"
            ],
            "type": "string",
            "description": "Change modes compare the latest monthly file with the previous snapshot stored in the named key-value store 'uk-hgv-operator-licences-state'. The first run saves the baseline.",
            "default": "all"
          },
          "includeIndividuals": {
            "title": "Include sole traders and partnerships",
            "type": "boolean",
            "description": "Off by default: licences held by sole traders or partnerships of individuals are left out, because their names and addresses are personal data under UK GDPR. If you turn this on, make sure you have a lawful basis to use them.",
            "default": false
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 0,
            "type": "integer",
            "description": "0 = no limit. Results are sorted by fleet size, largest first.",
            "default": 1000
          },
          "companiesHouseApiKey": {
            "title": "Companies House API key (optional)",
            "type": "string",
            "description": "Free key from developer.company-information.service.gov.uk. Adds company status, SIC codes, incorporation date and registered postcode for licences with a company number."
          },
          "maxEnrich": {
            "title": "Max rows to enrich",
            "minimum": 0,
            "type": "integer",
            "description": "Companies House allows 600 requests per 5 minutes.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}