{
  "openapi": "3.0.1",
  "info": {
    "title": "Building Permits Leads: US City Permits and Violations, $1.5/1k",
    "description": "Building permits leads from official city open-data portals (Chicago, NYC, LA, SF, Seattle, Austin, Baton Rouge, Montgomery Co. MD, Cincinnati). Type, status, dates, valuation, property address, contractor business if published, source link; code violations too. Delta mode. $0.0015 per record.",
    "version": "0.1",
    "x-build-id": "kUfxYn8NiYPzFQ3Qd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/transparent_meteorite~building-permits-leads/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-transparent_meteorite-building-permits-leads",
        "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/transparent_meteorite~building-permits-leads/runs": {
      "post": {
        "operationId": "runs-sync-transparent_meteorite-building-permits-leads",
        "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/transparent_meteorite~building-permits-leads/run-sync": {
      "post": {
        "operationId": "run-sync-transparent_meteorite-building-permits-leads",
        "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": "Which city portals to query. Permits: CHI, NYC, LAX, SFO, SEA, AUS, BTR, MOCO. Code violations: CHI, CIN. Empty = all nine.",
            "items": {
              "type": "string",
              "enum": [
                "CHI",
                "NYC",
                "LAX",
                "SFO",
                "SEA",
                "AUS",
                "BTR",
                "MOCO",
                "CIN"
              ],
              "enumTitles": [
                "Chicago, IL",
                "New York City, NY",
                "Los Angeles, CA",
                "San Francisco, CA",
                "Seattle, WA",
                "Austin, TX",
                "Baton Rouge, LA",
                "Montgomery County, MD",
                "Cincinnati, OH (violations only)"
              ]
            },
            "default": [
              "CHI",
              "SEA",
              "AUS"
            ]
          },
          "recordTypes": {
            "title": "Record types",
            "type": "array",
            "description": "permit = building permits; violation = code-enforcement / building violations (only CHI and CIN publish these here).",
            "items": {
              "type": "string",
              "enum": [
                "permit",
                "violation"
              ],
              "enumTitles": [
                "Building permits",
                "Code violations"
              ]
            },
            "default": [
              "permit"
            ]
          },
          "sinceDays": {
            "title": "Since days",
            "minimum": 1,
            "maximum": 180,
            "type": "integer",
            "description": "Return records whose issue date (filing date for San Francisco, violation date for violations) falls in the last N days (1 to 180).",
            "default": 7
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Cap on records delivered (and charged) this run, split evenly across the selected city sources.",
            "default": 30
          },
          "keywords": {
            "title": "Permit type / work keywords",
            "type": "array",
            "description": "Keep only records whose type, work class or description contains any of these words (case-insensitive), e.g. roof, solar, demolition, new construction, hvac.",
            "items": {
              "type": "string"
            }
          },
          "minValuation": {
            "title": "Minimum valuation (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only permits with a declared project value at or above this amount. 0 = no filter. Violations have no valuation and are not filtered by it.",
            "default": 0
          },
          "onlyNewSinceLastRun": {
            "title": "Only new since last run (delta)",
            "type": "boolean",
            "description": "Skip records already delivered in a previous run (tracked by city, record type and permit ID in a named key-value store). A repeat run on the same input delivers 0 rows and charges 0 record events.",
            "default": true
          },
          "stateStoreName": {
            "title": "Delta store name",
            "type": "string",
            "description": "Name of the named key-value store that remembers delivered records. Change it to keep separate feeds or to reset delta.",
            "default": "building-permits-leads-seen"
          },
          "monitorMode": {
            "title": "Monitor mode (only new or changed)",
            "type": "boolean",
            "description": "Recurring-run mode: return only permits that are new or whose status, valuation, issue date or contractor changed since the last monitor run. The first run is a baseline and returns everything in scope. Unchanged records are not returned and not charged. Schedule the actor (Schedules tab) to get a recurring feed. Each row gets a changeType of new or changed.",
            "default": false
          },
          "reportRemoved": {
            "title": "Also report removed (monitor mode)",
            "type": "boolean",
            "description": "With monitor mode on, also emit one row with changeType \"removed\" for permits/violations returned in an earlier run that the city feed no longer returns inside your sinceDays window, only for city sources read to the end. Removed rows are free: they are not charged and never count toward your charge limit or max results. Nothing is reported as removed on the baseline run, when the fetch was incomplete or hit a cap, or when your input filters changed since the baseline (the next run re-learns the baseline instead). Default off.",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Name of the saved baseline. Use a different name per watch list so schedules do not overwrite each other. Default is 'default'.",
            "default": "default"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}