{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Fleet & Transport Manager Leads (DVSA TC Register)",
    "description": "UK fleet & transport-manager leads from the official DVSA operator-licence register. Company-level B2B data: fleet size, licence type & status, address, company reg no, renewal date. Filter by region. Weekly refresh. No personal data; clean and GDPR-friendly.",
    "version": "0.1",
    "x-build-id": "4YKkFvEbicldnBtGu"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/dthen~uk-fleet-leads-dvsa/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-dthen-uk-fleet-leads-dvsa",
        "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/dthen~uk-fleet-leads-dvsa/runs": {
      "post": {
        "operationId": "runs-sync-dthen-uk-fleet-leads-dvsa",
        "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/dthen~uk-fleet-leads-dvsa/run-sync": {
      "post": {
        "operationId": "run-sync-dthen-uk-fleet-leads-dvsa",
        "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",
        "required": [
          "region"
        ],
        "properties": {
          "region": {
            "title": "Region",
            "enum": [
              "all",
              "england",
              "scotland",
              "wales"
            ],
            "type": "string",
            "description": "Which traffic-commissioner region's operators to include (england = all six English TC areas).",
            "default": "all"
          },
          "fullRefresh": {
            "title": "Full refresh",
            "type": "boolean",
            "description": "Re-download all CSVs. Off = only NEW licence numbers since the last run.",
            "default": true
          },
          "enrich": {
            "title": "Companies House enrichment",
            "type": "boolean",
            "description": "Enrich each operator with company-level Companies House data: companyStatus, incorporatedOn, sicCodes, companyName + the isDistressed flag (company dissolved / strike-off proposed / in administration / liquidation while the licence is still held). Rich data by default; the 7-day CH_CACHE keeps repeat runs cheap. Company-status data only — no director or PSC data is ever fetched.",
            "default": true
          },
          "isDistressed": {
            "title": "Distressed companies only",
            "type": "boolean",
            "description": "When true, only keep operators whose company is flagged distressed (dissolved / strike-off proposed / in administration / liquidation / receivership / voluntary arrangement / insolvency proceedings / removed). Requires enrichment (enrich=true). NOTE — PRICING: distressed-flagged rows are the enriched high-value output and carry a small premium: base rows are $5 per 1,000, distressed rows are $7 per 1,000 effective (+$2 per 1,000 custom distressed-result event). IMPORTANT: this is a FULL-SCAN mode — the whole deduped fleet must be enriched before the flag can be filtered. A cold full-UK scan (~55-65K CRNs) is a LONG, SCHEDULED operation: CH throttles sustained keyless scraping (real-world ~1 req/s effective, not the burst 12 req/s), so a single cold run will NOT complete in one 2h window. Run it on a schedule so the 7-day CH_CACHE accumulates across runs (each run warms more; periodic flush makes resume safe), and/or provide a chApiKey (official JSON API, no 403) for the full scan. Actor default timeout is 7200s.",
            "default": false
          },
          "fullEnrichScan": {
            "title": "Full-fleet enrichment scan",
            "type": "boolean",
            "description": "When true, enrich the ENTIRE deduped fleet (ignoring the maxRows pre-cap) before filtering/capping — e.g. to warm the Companies House cache for the whole UK. Implied automatically when isDistressed=true. Requires enrichment (enrich=true); the actor errors clearly if combined with enrich=false. WARNING: Full UK ~55-65K CRNs is a LONG, SCHEDULED operation. CH throttles sustained keyless scraping (real-world ~1 req/s effective, not the burst 12 req/s), so a cold full-UK scan will NOT complete in one 2h window — run it on a schedule so the 7-day CH_CACHE accumulates across runs, and/or provide a chApiKey (official JSON API, no 403) for the full scan, or narrow the region.",
            "default": false
          },
          "chApiKey": {
            "title": "Companies House API key (bring your own - optional)",
            "type": "string",
            "description": "OPTIONAL — bring your OWN free Companies House REST API key (register at companieshouse.gov.uk / developer site). When supplied, the official CH JSON API becomes the PRIMARY enrichment path (paced at ~2 req/s against YOUR key's quota, free tier 600 req/5min) — a keyed full-UK/full-region scan runs entirely through the legit JSON API, no keyless 403-throttling. Empty/blank = keyless public-page scraping (fine for small or warm/cached runs; sustained/full scans get 403-throttled to ~0.5–1 req/s). RECOMMENDED for full-UK / full-region enrichment scans (isDistressed / fullEnrichScan / maxRows=0). This is ALWAYS your own key — never a shared or our key — read only from this run's input and never logged or stored."
          },
          "chWorkers": {
            "title": "Enrichment workers",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Concurrent Companies House fetchers (each paced at ~1.5 req/s; 8 workers ~= 12 req/s aggregate, full UK ~1h).",
            "default": 8
          },
          "maxRows": {
            "title": "Max rows",
            "type": "integer",
            "description": "Cap on output rows (0 = unlimited; default 1000 keeps the run fast for the daily auto-test). WARNING: maxRows=0 combined with region=all and enrich=true triggers a FULL-UK enrichment scan (~55-65K CRNs). This is a LONG, SCHEDULED operation (CH throttles sustained keyless scraping — real-world ~1 req/s effective, not the burst 12 req/s), so a cold full-UK scan will NOT complete in one 2h window — run it on a schedule so the 7-day CH_CACHE accumulates across runs, and/or provide a chApiKey for the full scan.",
            "default": 1000
          },
          "licenceType": {
            "title": "Licence type",
            "enum": [
              "",
              "Standard National",
              "Standard International",
              "Restricted",
              "unknown"
            ],
            "type": "string",
            "description": "Only keep operators with this licence type (empty = no filter).",
            "default": ""
          },
          "licenceStatus": {
            "title": "Licence status",
            "enum": [
              "",
              "valid",
              "curtailed",
              "revoked",
              "suspended",
              "surrendered",
              "unknown"
            ],
            "type": "string",
            "description": "Only keep operators with this licence status (empty = no filter).",
            "default": ""
          },
          "minFleetSize": {
            "title": "Min fleet size",
            "type": "integer",
            "description": "Only keep operators with fleet size >= this value (0 = no filter).",
            "default": 0
          },
          "maxFleetSize": {
            "title": "Max fleet size",
            "type": "integer",
            "description": "Only keep operators with fleet size <= this value (0 = no upper bound).",
            "default": 0
          },
          "hasTransportManager": {
            "title": "Has named transport manager",
            "type": "boolean",
            "description": "When true, only keep operators with a named transport manager (false = no filter).",
            "default": false
          },
          "operatorType": {
            "title": "Operator type",
            "enum": [
              "",
              "Limited Company",
              "Sole Trader",
              "Partnership",
              "Limited Liability Partnership",
              "Other"
            ],
            "type": "string",
            "description": "Only keep operators of this legal-entity type (case-insensitive; 'Other' also matches DVSA's 'Other (e.g. public authority, charity, trust, university)'; empty = no filter). Note: sole traders and partnerships are excluded from the output entirely by the GDPR personal-data filter, so those two values always yield 0 rows (a warning is logged).",
            "default": ""
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}