{
  "openapi": "3.0.1",
  "info": {
    "title": "Contractor License Data: New, Suspended (WA/OR)",
    "description": "Washington and Oregon contractor businesses that are newly licensed, just suspended, or whose insurance or bond expires within N days, from official L&I and CCB open data. One row per change. Businesses only. JSON, CSV, Excel. More states on request.",
    "version": "0.1",
    "x-build-id": "D2J6Zd0dlBPGe4f3o"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sullivan-ventures~contractor-license-signals/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sullivan-ventures-contractor-license-signals",
        "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/sullivan-ventures~contractor-license-signals/runs": {
      "post": {
        "operationId": "runs-sync-sullivan-ventures-contractor-license-signals",
        "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/sullivan-ventures~contractor-license-signals/run-sync": {
      "post": {
        "operationId": "run-sync-sullivan-ventures-contractor-license-signals",
        "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": {
          "states": {
            "title": "States",
            "type": "array",
            "description": "Official state contractor-license datasets to read.",
            "items": {
              "type": "string",
              "enum": [
                "wa",
                "or"
              ],
              "enumTitles": [
                "Washington (L&I)",
                "Oregon (CCB)"
              ]
            },
            "default": [
              "wa",
              "or"
            ]
          },
          "signals": {
            "title": "Signals",
            "type": "array",
            "description": "Which signals to output. Order sets output priority when the record cap is hit.",
            "items": {
              "type": "string",
              "enum": [
                "new_license",
                "suspended",
                "insurance_expiring",
                "bond_expiring",
                "left_active_list"
              ],
              "enumTitles": [
                "New license (newly licensed contractor)",
                "Suspended (WA)",
                "Insurance expiring in N days",
                "Bond expiring in N days (OR)",
                "Dropped off the active list since last run (OR)"
              ]
            },
            "default": [
              "new_license",
              "suspended",
              "insurance_expiring",
              "bond_expiring",
              "left_active_list"
            ]
          },
          "newWithinDays": {
            "title": "New licenses: last N days",
            "minimum": 1,
            "maximum": 92,
            "type": "integer",
            "description": "License effective (WA) or first registered (OR) within the last N days.",
            "default": 7
          },
          "suspendedWithinDays": {
            "title": "Suspensions: last N days",
            "minimum": 1,
            "maximum": 92,
            "type": "integer",
            "description": "WA suspensions dated within the last N days.",
            "default": 7
          },
          "expiringWithinDays": {
            "title": "Insurance/bond expiring within N days",
            "minimum": 1,
            "maximum": 120,
            "type": "integer",
            "description": "Latest insurance policy (WA, OR) or bond (OR) on file expires between today and today + N days.",
            "default": 30
          },
          "cities": {
            "title": "Cities (optional)",
            "type": "array",
            "description": "Only contractors whose business address is in these cities, e.g. SEATTLE, PORTLAND. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "counties": {
            "title": "Oregon counties (optional)",
            "type": "array",
            "description": "Oregon only, e.g. Multnomah, Washington, Lane. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "onlyNewSinceLastRun": {
            "title": "Only signals not seen in my earlier runs",
            "type": "boolean",
            "description": "Skip signals already output by your previous runs (state kept in a named key-value store in your account).",
            "default": false
          },
          "maxRecords": {
            "title": "Max records",
            "minimum": 1,
            "type": "integer",
            "description": "Hard cap on dataset rows (you pay per row). A full WA+OR run with all signals is about 6,000 rows.",
            "default": 1000
          },
          "updateState": {
            "title": "Remember this run",
            "type": "boolean",
            "description": "Save seen signals and the Oregon active list for 'new since last run' and 'left active list'.",
            "default": true
          },
          "stateStoreName": {
            "title": "State store name",
            "type": "string",
            "description": "Named key-value store used for run-to-run state.",
            "default": "contractor-license-state"
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Free token from data.wa.gov / data.oregon.gov to raise rate limits. Not needed for normal use."
          },
          "requestDelayMs": {
            "title": "Delay between API calls (ms)",
            "minimum": 150,
            "type": "integer",
            "description": "Politeness delay between requests.",
            "default": 250
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}