{
  "openapi": "3.0.1",
  "info": {
    "title": "Building Permit Lead Finder & Scorer",
    "description": "Turns raw building permits from 8 US cities into scored, trade-classified contractor leads. Filter by trade (roofing, HVAC, plumbing, electrical, solar, remodel...), get A/B/C tiered leads with valuation, recency and contact signals.",
    "version": "0.1",
    "x-build-id": "nsbPWCxv7CfdRQmdH"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/orkanaltinsoy~permit-contractor-lead-enricher/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-orkanaltinsoy-permit-contractor-lead-enricher",
        "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/orkanaltinsoy~permit-contractor-lead-enricher/runs": {
      "post": {
        "operationId": "runs-sync-orkanaltinsoy-permit-contractor-lead-enricher",
        "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/orkanaltinsoy~permit-contractor-lead-enricher/run-sync": {
      "post": {
        "operationId": "run-sync-orkanaltinsoy-permit-contractor-lead-enricher",
        "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": {
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Cities to scan for leads.",
            "items": {
              "type": "string",
              "enum": [
                "chicago",
                "austin",
                "seattle",
                "nyc_bis",
                "nyc_dobnow",
                "sf",
                "la",
                "denver_res",
                "fortworth"
              ],
              "enumTitles": [
                "Chicago, IL",
                "Austin, TX",
                "Seattle, WA",
                "New York City (BIS)",
                "New York City (DOB NOW)",
                "San Francisco, CA",
                "Los Angeles, CA",
                "Denver, CO (residential)",
                "Fort Worth, TX"
              ]
            },
            "default": [
              "austin",
              "seattle",
              "denver_res",
              "chicago"
            ]
          },
          "trades": {
            "title": "Trades",
            "type": "array",
            "description": "Which trades to find leads for.",
            "items": {
              "type": "string",
              "enum": [
                "roofing",
                "hvac",
                "plumbing",
                "electrical",
                "solar",
                "remodel",
                "pool",
                "demolition",
                "new_construction",
                "fence_deck"
              ],
              "enumTitles": [
                "Roofing",
                "HVAC / Mechanical",
                "Plumbing",
                "Electrical",
                "Solar / Battery",
                "Remodel / Addition",
                "Pool / Spa",
                "Demolition",
                "New construction",
                "Fence / Deck"
              ]
            },
            "default": [
              "roofing",
              "hvac",
              "plumbing",
              "electrical",
              "remodel"
            ]
          },
          "mode": {
            "title": "Lead mode",
            "enum": [
              "supplier",
              "contractor"
            ],
            "type": "string",
            "description": "supplier: you sell products/services TO contractors (leads with contractor name+phone score higher). contractor: you ARE a contractor looking for jobs (permits without an assigned contractor score higher).",
            "default": "supplier"
          },
          "daysBack": {
            "title": "Days back",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Scan permits issued in the last N days.",
            "default": 14
          },
          "minValuation": {
            "title": "Minimum valuation (USD)",
            "type": "integer",
            "description": "Skip permits below this project value (records with missing valuation are kept).",
            "default": 0
          },
          "minScore": {
            "title": "Minimum lead score (0-100)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Only deliver leads at/above this score. 70+=A, 50+=B, 30+=C.",
            "default": 30
          },
          "maxLeads": {
            "title": "Max leads to deliver",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Best-scoring leads are delivered first.",
            "default": 1000
          },
          "maxPermitsPerCity": {
            "title": "Max permits scanned per city",
            "minimum": 100,
            "maximum": 100000,
            "type": "integer",
            "description": "Safety cap on how many raw permits are scanned per city before filtering. Scanning is free — you only pay for delivered leads.",
            "default": 3000
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Free token raises rate limits for heavy runs."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}