{
  "openapi": "3.0.1",
  "info": {
    "title": "Contractor Lead Finder — Live Building Permits",
    "description": "Find contractors pulling building permits right now. Ranked leads from official city open data: businesses, not raw permit rows. Phones in Austin.",
    "version": "0.2",
    "x-build-id": "PwCBIMsnY1cfcIPXk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/michaeljames~contractor-lead-finder/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-michaeljames-contractor-lead-finder",
        "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/michaeljames~contractor-lead-finder/runs": {
      "post": {
        "operationId": "runs-sync-michaeljames-contractor-lead-finder",
        "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/michaeljames~contractor-lead-finder/run-sync": {
      "post": {
        "operationId": "run-sync-michaeljames-contractor-lead-finder",
        "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": [
          "cities"
        ],
        "properties": {
          "cities": {
            "title": "Cities",
            "minItems": 1,
            "type": "array",
            "description": "Which city permit feeds to search. Every source is an official municipal open-data API whose published terms permit redistribution (public domain, U.S. Government Works, CC BY 3.0, or city open-data terms read on 2026-09-08). Attribution is attached to every result.",
            "items": {
              "type": "string",
              "enum": [
                "austin",
                "nyc",
                "louisville",
                "sacramento",
                "phoenix",
                "seattle",
                "denver"
              ],
              "enumTitles": [
                "Austin, TX — contractor name + PHONE",
                "New York City, NY — applicant business + address",
                "Louisville, KY — contractor name",
                "Sacramento, CA — contractor name (current year)",
                "Phoenix, AZ — contractor name",
                "Seattle, WA — contractor name (sparse, ~9% of permits)",
                "Denver, CO — contractor name (multi-month lag; CC BY credit attached)"
              ]
            },
            "default": [
              "austin"
            ]
          },
          "outputMode": {
            "title": "What do you want back?",
            "enum": [
              "contractors",
              "permits"
            ],
            "type": "string",
            "description": "Contractor profiles roll many permits up into one ranked business record — this is the lead list. Permit rows gives you the raw individual permits instead.",
            "default": "contractors"
          },
          "trades": {
            "title": "Trades",
            "type": "array",
            "description": "Only return work in these trades. Leave empty for all trades. Trade keywords are pushed into the city API query, so filtering here also makes the run faster.",
            "items": {
              "type": "string",
              "enum": [
                "roofing",
                "solar",
                "hvac",
                "plumbing",
                "electrical",
                "pool",
                "remodel",
                "addition",
                "newConstruction",
                "demolition",
                "windowsDoors",
                "fenceDeck",
                "foundation",
                "siding",
                "signage",
                "fireSprinkler"
              ],
              "enumTitles": [
                "Roofing",
                "Solar / PV",
                "HVAC / Mechanical",
                "Plumbing",
                "Electrical",
                "Pool / Spa",
                "Remodel / Renovation",
                "Addition",
                "New Construction",
                "Demolition",
                "Windows & Doors",
                "Fence / Deck / Patio",
                "Foundation / Structural",
                "Siding / Stucco",
                "Signage",
                "Fire / Sprinkler"
              ]
            },
            "default": []
          },
          "daysBack": {
            "title": "Days back",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "How far back to search from today. Fresh permits make better leads; 7-30 days is the useful range for outreach.",
            "default": 14
          },
          "minJobValue": {
            "title": "Minimum job value (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip permits below this declared job value. Set 0 for no minimum. Note: Phoenix does not publish job values, so this filter removes all of its rows if set above 0.",
            "default": 0
          },
          "requireContractor": {
            "title": "Only permits that name a contractor",
            "type": "boolean",
            "description": "Strongly recommended. Permits without a named contractor cannot become a lead.",
            "default": true
          },
          "requirePhone": {
            "title": "Only results with a phone number",
            "type": "boolean",
            "description": "Austin is currently the only source that publishes contractor phone numbers, so turning this on effectively limits results to Austin.",
            "default": false
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "Optional. Restrict to these 5-digit job-site ZIP codes.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Hard cap on results returned — and therefore on what you are charged. You are billed per result delivered, never per permit scanned. The default of 50 keeps a first run at $2 or less; raise it once you like the results.",
            "default": 50
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Optional free token from any Socrata portal. Raises rate limits on Austin, NYC and Seattle. Leave blank to use the shared anonymous pool."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}