{
  "openapi": "3.0.1",
  "info": {
    "title": "Tennessee Contractor License Lookup & Verify (TN DOCI)",
    "description": "Look up a Tennessee contractor by TN DOCI license number or name, or export the roster by county, license type and status: returns license number, name, type, status, expiry, city, county, ZIP. $0.004 per record, +$0.002 when a missing business phone is added (optional); a no-match is free.",
    "version": "0.0",
    "x-build-id": "n4O0rPP7mZbi5aMV8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapebench~tennessee-contractor-license-lookup/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapebench-tennessee-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~tennessee-contractor-license-lookup/runs": {
      "post": {
        "operationId": "runs-sync-scrapebench-tennessee-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~tennessee-contractor-license-lookup/run-sync": {
      "post": {
        "operationId": "run-sync-scrapebench-tennessee-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 TN contractor license number (numeric, e.g. '56787') OR a business/person name. A numeric query is looked up by license number; anything else is searched against the licensee/business name index. Leave this and 'Search query (batch)' empty to export the statewide roster instead, narrowed by the status / licence type / county / city filters below."
          },
          "queries": {
            "title": "Search query (batch)",
            "type": "array",
            "description": "Prefer this over `query`: look up many in ONE run instead of starting a run per lookup. Each entry is a TN license number or a business/person name. Combined with `query` if you fill both, and duplicates are removed. You are charged per record returned, not per entry submitted.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "board": {
            "title": "Board / program filter",
            "type": "string",
            "description": "The TN DOCI board to search. Defaults to 'Contractors, Ltd Licensed Plumbers and PreLic Course Providers' (the main contractor board), which is also used when this is left blank.",
            "default": "Contractors, Ltd Licensed Plumbers and PreLic Course Providers"
          },
          "status": {
            "title": "Licence status (statewide mode)",
            "type": "string",
            "description": "Used only when no search query is given (statewide export). One of TN DOCI's statuses: Active, Expired, Applicant, Application Expired, Application Denied, Application Withdrawn, Closed, Retired, Revoked, Failure to Renew, Suspended — or 'all'. Defaults to active. 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.",
            "default": "active"
          },
          "statuses": {
            "title": "Licence statuses (batch)",
            "type": "array",
            "description": "Several statuses in ONE statewide run, e.g. Active and Expired. Combined with 'Licence status' if you fill both.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "licenseType": {
            "title": "Licence type (statewide mode)",
            "type": "string",
            "description": "Used only in statewide mode: Contractor, Limited Licensed Plumbers (or 'plumber'), or Pre-Licensing Course Provider. Leave empty for all types."
          },
          "licenseTypes": {
            "title": "Licence types (batch)",
            "type": "array",
            "description": "Several licence types in ONE statewide run. Combined with 'Licence type' if you fill both.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "county": {
            "title": "County (statewide mode)",
            "type": "string",
            "description": "Used only in statewide mode: a Tennessee county, e.g. 'Davidson' or 'Knox County' (any of the 95). Sent to TN DOCI as its own county filter, limited to Tennessee holders."
          },
          "counties": {
            "title": "Counties (batch)",
            "type": "array",
            "description": "Several Tennessee counties in ONE statewide run. Combined with 'County' if you fill both.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "city": {
            "title": "City (statewide mode)",
            "type": "string",
            "description": "Used only in statewide mode: the licensee's city, exact match ignoring case and punctuation, e.g. 'Nashville' (does not also match 'Johnson City' for 'City')."
          },
          "cities": {
            "title": "Cities (batch)",
            "type": "array",
            "description": "Several cities in ONE statewide run. Combined with 'City' if you fill both.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeContacts": {
            "title": "Include contact details",
            "type": "boolean",
            "description": "Where the board publishes no phone for a business, add one (with its website and street address when found), looked up by business name. Charged as a separate 'Contact details found' event only on a row that gets a phone; a row without one costs only the row price. Turn off for the licence list alone.",
            "default": true
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Every record returned is billed. With a search query: cap PER ENTRY, not per run (empty = 50), so a batch cannot silently return only the first rows overall. In statewide mode (no query): cap for the WHOLE run, a spend control (empty = 500); the active contractor board is about 24,000 records and the whole board 70,000+, so 100000 returns everything that matches. The run log states how many matched when the cap cuts it short."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. The TN portal is usually reachable directly, but its edge returns 403 to some datacenter IPs. If a run returns a 'TN portal unavailable' row, enable Apify Proxy with the RESIDENTIAL group.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}