{
  "openapi": "3.0.1",
  "info": {
    "title": "Building Permits & Code Violations: 10 US Cities",
    "description": "Get new building permits and code violations from Chicago, New York, Los Angeles, San Francisco, Austin, Seattle, Baton Rouge, New Orleans, Cincinnati, and Orlando open data in one clean format.  Filter by keyword, ZIP code, and project cost, and pay only for new records on repeat runs.",
    "version": "0.1",
    "x-build-id": "Bqdxkpv4DqzChzh0k"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/maniginam~city-building-permits-code-violations/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-maniginam-city-building-permits-code-violations",
        "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/maniginam~city-building-permits-code-violations/runs": {
      "post": {
        "operationId": "runs-sync-maniginam-city-building-permits-code-violations",
        "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/maniginam~city-building-permits-code-violations/run-sync": {
      "post": {
        "operationId": "run-sync-maniginam-city-building-permits-code-violations",
        "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",
            "uniqueItems": true,
            "type": "array",
            "description": "Read these cities.  Leave empty for all ten.  Baton Rouge publishes building permits only.",
            "items": {
              "type": "string",
              "enum": [
                "chicago",
                "new-york",
                "los-angeles",
                "san-francisco",
                "austin",
                "seattle",
                "baton-rouge",
                "new-orleans",
                "cincinnati",
                "orlando"
              ],
              "enumTitles": [
                "Chicago, IL",
                "New York, NY",
                "Los Angeles, CA",
                "San Francisco, CA",
                "Austin, TX",
                "Seattle, WA",
                "Baton Rouge, LA",
                "New Orleans, LA",
                "Cincinnati, OH",
                "Orlando, FL"
              ]
            },
            "default": []
          },
          "recordTypes": {
            "title": "Record types",
            "uniqueItems": true,
            "type": "array",
            "description": "Building permits issued, code violations or complaints opened, or both.  Leave empty for both.",
            "items": {
              "type": "string",
              "enum": [
                "permit",
                "violation"
              ],
              "enumTitles": [
                "Building permits",
                "Code violations"
              ]
            },
            "default": []
          },
          "daysBack": {
            "title": "Days to look back",
            "minimum": 1,
            "maximum": 90,
            "type": "integer",
            "description": "Read records dated within this many calendar days, today included, newest first.  Cities publish with a delay of one day to a few weeks, so a larger window finds more.",
            "default": 7
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Keep only records whose category or description contains one of these words, such as roof, solar, or demolition.  Case does not matter.  Leave empty for every record.",
            "items": {
              "type": "string",
              "maxLength": 100
            }
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "Keep only records in these 5-digit ZIP codes, such as 78701.  Leave empty for every ZIP code.",
            "items": {
              "type": "string",
              "maxLength": 10
            }
          },
          "minEstimatedCost": {
            "title": "Minimum project cost (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only permits whose estimated project cost is at least this many dollars, and drop permits with no cost.  Violations are not affected.  Use 0 for no minimum.",
            "default": 0
          },
          "onlyNewRecords": {
            "title": "New records only",
            "type": "boolean",
            "description": "Skip records an earlier run of this monitor already delivered, so a scheduled run is charged only for new ones.",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name",
            "maxLength": 60,
            "type": "string",
            "description": "Name of the history used by new records only.  Use a different name for each separate watch list.",
            "default": "default"
          },
          "maxResultsPerSource": {
            "title": "Max records per dataset",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Stop reading a city dataset after this many records, so one busy city cannot fill the run.",
            "default": 500
          },
          "maxResults": {
            "title": "Max records in total",
            "minimum": 1,
            "maximum": 200000,
            "type": "integer",
            "description": "Stop the run after this many records across every city.",
            "default": 5000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}