{
  "openapi": "3.0.1",
  "info": {
    "title": "UK HGV Operator Licence Applications & Decisions",
    "description": "From $3.00 per 1,000 rows, no start fee. Every HGV operator-licence application, variation, grant, refusal, surrender and revocation the UK Traffic Commissioners publish weekly: licence number and class, operator, directors, address, operating centre, vehicles and trailers, objection deadline.",
    "version": "0.1",
    "x-build-id": "MgemqcPD7PnjJ1pnK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapersdelight~traffic-commissioner-applications-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapersdelight-traffic-commissioner-applications-scraper",
        "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/scrapersdelight~traffic-commissioner-applications-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapersdelight-traffic-commissioner-applications-scraper",
        "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/scrapersdelight~traffic-commissioner-applications-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapersdelight-traffic-commissioner-applications-scraper",
        "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": {
          "regions": {
            "title": "Traffic areas",
            "type": "array",
            "description": "Leave empty for all eight. The Actor reads the live gov.uk collection page to confirm the list before it runs.",
            "items": {
              "type": "string",
              "enum": [
                "the-east-of-england",
                "london-and-the-south-east-of-england",
                "the-north-east-of-england",
                "the-north-west-of-england",
                "the-west-midlands",
                "the-west-of-england",
                "scotland",
                "wales"
              ],
              "enumTitles": [
                "East of England",
                "London and the South East of England",
                "North East of England",
                "North West of England",
                "West Midlands",
                "West of England",
                "Scotland",
                "Wales"
              ]
            },
            "default": []
          },
          "maxEditionsPerRegion": {
            "title": "Weekly editions per traffic area",
            "minimum": 0,
            "type": "integer",
            "description": "How many of the most recent weekly editions to read per area. 1 (the default) gives you this week across the areas you chose - measured mean 72.5 licence entries per edition, so all eight areas is about 580 rows. 0 means every edition still addressable, which is 37 per area.",
            "default": 1
          },
          "publishedFrom": {
            "title": "Published on or after",
            "type": "string",
            "description": "Optional ISO date, e.g. 2026-09-01. Filters editions by their publication date BEFORE anything is downloaded, so a narrow window costs nothing to skip. Measured oldest addressable edition on 2026-09-17: 2026-01-01."
          },
          "publishedTo": {
            "title": "Published on or before",
            "type": "string",
            "description": "Optional ISO date, e.g. 2026-09-16."
          },
          "sectionGroups": {
            "title": "Section groups",
            "type": "array",
            "description": "Leave empty for every section. The default keeps the two application groups, which is what a dealer, broker or compliance consultancy is buying.",
            "items": {
              "type": "string",
              "enum": [
                "applications-received",
                "applications-decided",
                "withdrawn-and-public-inquiries",
                "surrendered-revoked-terminated"
              ],
              "enumTitles": [
                "Applications received - new + variation (sections 1.1, 1.2)",
                "Applications decided - granted, refused, Schedule 4 (sections 2, 3)",
                "Withdrawn, not taken up, public inquiries, centre reviews (sections 4, 5, 6)",
                "Surrendered, terminated, revoked, corrections (sections 7, 8, 9)"
              ]
            },
            "default": [
              "applications-received",
              "applications-decided"
            ]
          },
          "entryTypes": {
            "title": "Entry types",
            "type": "array",
            "description": "A finer filter than section groups, applied on top of them. Leave empty to keep whatever the section groups let through.",
            "items": {
              "type": "string",
              "enum": [
                "new-application",
                "variation-application",
                "new-application-granted",
                "new-application-refused",
                "variation-application-granted",
                "variation-application-refused",
                "schedule-4-new-application",
                "schedule-4-variation-application",
                "schedule-4-other-approval",
                "application-withdrawn",
                "grant-not-taken-up",
                "public-inquiry-notice",
                "public-inquiry-decision",
                "transport-manager-inquiry-notice",
                "transport-manager-inquiry-decision",
                "operating-centre-review-decision",
                "licence-surrendered",
                "licence-terminated",
                "licence-revoked",
                "correction"
              ],
              "enumTitles": [
                "New applications received  (293 of 1,741 measured)",
                "Variation applications received  (363)",
                "New applications granted  (217)",
                "New applications refused  (30)",
                "Variation applications granted  (292)",
                "Variation applications refused  (7)",
                "Schedule 4 new applications  (8)",
                "Schedule 4 variation applications  (1)",
                "Other Schedule 4 approvals  (3)",
                "Applications withdrawn  (46)",
                "Grants not taken up, fee not paid  (2)",
                "Public inquiry notices  (79)",
                "Public inquiry decisions  (48)",
                "Transport manager public inquiry notices  (0 in the sample - see README)",
                "Transport manager public inquiry decisions  (0 in the sample - see README)",
                "Operating centre review decisions  (3)",
                "Licences surrendered  (36)",
                "Licences terminated  (252)",
                "Licences revoked without public inquiry  (61)",
                "Corrections  (0 in the sample)"
              ]
            },
            "default": []
          },
          "licenceClasses": {
            "title": "Licence class",
            "type": "array",
            "description": "Measured: 98.7% of entries carry a class. The 1.3% that do not are public-inquiry entries where the booklet omits it; selecting any class here excludes them.",
            "items": {
              "type": "string",
              "enum": [
                "R",
                "SN",
                "SI"
              ],
              "enumTitles": [
                "R - Restricted (own goods only)",
                "SN - Standard National (hire or reward, GB only)",
                "SI - Standard International (hire or reward, incl. abroad)"
              ]
            },
            "default": []
          },
          "postcodePrefixes": {
            "title": "Postcode prefixes",
            "type": "array",
            "description": "Match the operator's correspondence postcode OR any operating-centre postcode. \"G\" = Glasgow, \"EH\" = Edinburgh, \"ML4\" = one district. Spaces and case are ignored; multiple entries are OR-ed. Measured: 96.4% of entries carry a postcode.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "minVehicles": {
            "title": "Minimum vehicles authorised",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only entries whose vehicle authorisation is at least this. Measured: 59.0% of entries state a vehicle count - a missing count is reported as null, never as 0, so setting this filter excludes the entries where the booklet does not say."
          },
          "keyword": {
            "title": "Free-text search",
            "type": "string",
            "description": "Case-insensitive substring match across operator name, directors, correspondence address, operating centres and transport managers."
          },
          "requireAddress": {
            "title": "Only entries with a postal address",
            "type": "boolean",
            "description": "Filter out the 3.6% of entries the booklet prints without a full address (mostly refusals and withdrawals that list the operator and its directors only), so you never pay for a row you cannot post to.",
            "default": false
          },
          "oneRowPerLicence": {
            "title": "One row per licence",
            "type": "boolean",
            "description": "OFF (default): one row per published entry, which is the source's own grain - measured 1.2% of entries within one edition repeat a licence number because it appears in two sections. ON: the first entry for each licence number in each traffic area, everything after it dropped and not charged.",
            "default": false
          },
          "maxApplications": {
            "title": "Max rows",
            "minimum": 0,
            "type": "integer",
            "description": "Hard cap on rows delivered, and therefore on rows charged, counted against rows PRODUCED rather than rows flushed. Editions are read newest first in batches, so a small cap also stops the download early. 0 means no cap.",
            "default": 1000
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. Measured 2026-09-17: gov.uk and assets.publishing.service.gov.uk have no anti-bot, no user-agent gate and no rate limit on this path - 16 PDFs fetched in parallel returned 16x HTTP 200 in 1.36 s with no truncation - so the default datacenter proxy is plenty. Every PDF's byte count is checked against the size gov.uk declares and re-fetched on a fresh session if it falls short, so a half-delivered download can never be parsed as a short week.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}