{
  "openapi": "3.0.1",
  "info": {
    "title": "Minnesota Contractor License Lookup & Export (DLI)",
    "description": "Verify a Minnesota residential contractor by license or name, or export the whole DLI roster filtered by subtype, status, city or ZIP — with phone, address & enforcement flag.",
    "version": "0.0",
    "x-build-id": "b4GRO4i3wBL3h6QX3"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapebench~minnesota-contractor-license-lookup/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapebench-minnesota-contractor-license-lookup",
        "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/scrapebench~minnesota-contractor-license-lookup/runs": {
      "post": {
        "operationId": "runs-sync-scrapebench-minnesota-contractor-license-lookup",
        "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/scrapebench~minnesota-contractor-license-lookup/run-sync": {
      "post": {
        "operationId": "run-sync-scrapebench-minnesota-contractor-license-lookup",
        "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": {
          "query": {
            "title": "Search query",
            "minLength": 1,
            "type": "string",
            "description": "A Minnesota DLI residential-contractor license number, business name, or person name to verify or search. Searches by exact license number and by business/DBA name substring. Leave this and 'Search query (batch)' empty to export the statewide roster instead, narrowed by the filters below."
          },
          "queries": {
            "title": "Search query (batch)",
            "type": "array",
            "description": "Look up many in ONE run instead of starting a run per lookup. Takes the same values as 'Search query'. Combined with 'Search query' if you fill both, and duplicates are removed. Billing is unchanged: you are charged per record returned, not per entry submitted.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "licenseSubtype": {
            "title": "Licence subtype",
            "type": "string",
            "description": "One DLI licence subtype: Qualifying Builder, Residential Building Contractor, Qualifying Remodeler, Residential Remodeler Contractor, Qualifying Roofer, Residential Roofer Contractor, Qualifying Installer, Manufactured Home Installer or Certificate of Exemption. Short words work too: 'builder', 'remodeler', 'roofer', 'installer' (each covers both its business licence and its qualifying-person licence), 'exemption'. Empty = every subtype. An unrecognised value is ignored with a log line; if nothing you gave is recognised, the run returns a free row saying so instead of the whole state."
          },
          "licenseSubtypes": {
            "title": "Licence subtypes (batch)",
            "type": "array",
            "description": "Several subtypes in ONE run. Combined with 'Licence subtype' if you fill both.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "status": {
            "title": "Licence status",
            "type": "string",
            "description": "active (DLI 'Issued'), expired, voluntary_termination, revoked, suspended, withdrawn, or all. Empty = active when exporting statewide, and every status when you give a search query (so existing lookups behave exactly as before)."
          },
          "statuses": {
            "title": "Licence statuses (batch)",
            "type": "array",
            "description": "Several statuses in ONE run, e.g. revoked and suspended. Combined with 'Licence status' if you fill both.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "city": {
            "title": "City",
            "type": "string",
            "description": "Business city, exact match ignoring case and punctuation; 'St Paul', 'St. Paul' and 'Saint Paul' are the same city (DLI spells it both ways)."
          },
          "cities": {
            "title": "Cities (batch)",
            "type": "array",
            "description": "Several cities in ONE run. Combined with 'City' if you fill both. The roster has no county column, so filter by city or ZIP.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "zip": {
            "title": "ZIP code",
            "type": "string",
            "description": "Business ZIP, 5 digits (a ZIP+4 is matched on its first 5)."
          },
          "zips": {
            "title": "ZIP codes (batch)",
            "type": "array",
            "description": "Several ZIPs in ONE run. Combined with 'ZIP code' if you fill both.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "With a search query: cap on matches PER QUERY (default 50), so a batch cannot silently return only the first rows overall and read as 'no match'. Statewide export: cap for the whole run (default 500, a spend control). The full roster is 59,302 licences (25,359 active, measured 2026-10-07), so 100000 returns everything that matches; the run log states how many matched when the cap cuts it short."
          },
          "enforcementOnly": {
            "title": "Enforcement monitor mode",
            "type": "boolean",
            "description": "When on, return only licensees with a DLI enforcement action on record (revocation, suspension, etc.). Works with a search query or statewide. Note: a statewide export defaults to active licences; set status to 'all' to include the revoked and expired licences most enforcement actions sit on.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. The Minnesota DLI roster CSV is reachable directly; a proxy is not needed.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}