{
  "openapi": "3.0.1",
  "info": {
    "title": "Los Angeles Building Permits Scraper",
    "description": "Scrape LA Dept. of Building & Safety permits. Search/filter by permit type, sub-type, category, status, office, zip, street, valuation, or issue date; lookup by permit number, address, or contractor. Free Socrata API, no login.",
    "version": "1.0",
    "x-build-id": "WDP9tXW2ylC4YY4oG"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~los-angeles-building-permits-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-los-angeles-building-permits-scraper",
        "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/crawlerbros~los-angeles-building-permits-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-los-angeles-building-permits-scraper",
        "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/crawlerbros~los-angeles-building-permits-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-los-angeles-building-permits-scraper",
        "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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "byPermitNumbers",
              "byAddress",
              "byContractor",
              "byAssessorParcel"
            ],
            "type": "string",
            "description": "What to fetch.",
            "default": "search"
          },
          "permitNumbers": {
            "title": "Permit numbers (mode=byPermitNumbers)",
            "type": "array",
            "description": "Exact PCIS permit numbers to fetch. Example: `20010-30000-00390`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "streetNumber": {
            "title": "Street number (mode=byAddress)",
            "type": "string",
            "description": "Building street number. Example: `6500`."
          },
          "streetName": {
            "title": "Street name",
            "type": "string",
            "description": "Street name, without direction/suffix. Example: `HARVARD`. Exact match in mode=byAddress; substring match as a filter in mode=search."
          },
          "streetDirection": {
            "title": "Street direction",
            "enum": [
              "",
              "N",
              "S",
              "E",
              "W"
            ],
            "type": "string",
            "description": "Filter to a single street direction prefix.",
            "default": ""
          },
          "streetSuffix": {
            "title": "Street suffix",
            "enum": [
              "",
              "AVE",
              "ST",
              "BLVD",
              "DR",
              "PL",
              "ROAD",
              "WAY",
              "LANE",
              "CT",
              "TER",
              "CIR",
              "PARK",
              "WALK",
              "HWY",
              "HILL",
              "TR",
              "RD",
              "CL",
              "MALL",
              "PKWY",
              "LN",
              "GRN",
              "TERR",
              "CK",
              "PASS",
              "PZ",
              "COVE",
              "VIEW",
              "CYN",
              "ROW",
              "SQ",
              "RDG",
              "VIS",
              "AL",
              "PT",
              "GLEN"
            ],
            "type": "string",
            "description": "Filter to a single street-suffix abbreviation.",
            "default": ""
          },
          "assessorBook": {
            "title": "Assessor book (mode=byAssessorParcel)",
            "type": "string",
            "description": "LA County Assessor's Identification Number (AIN) \"Book\" component. Example: `2405`."
          },
          "assessorPage": {
            "title": "Assessor page (mode=byAssessorParcel)",
            "type": "string",
            "description": "LA County Assessor's Identification Number (AIN) \"Page\" component. Example: `003`."
          },
          "assessorParcel": {
            "title": "Assessor parcel (mode=byAssessorParcel)",
            "type": "string",
            "description": "LA County Assessor's Identification Number (AIN) \"Parcel\" component. Example: `032`."
          },
          "contractorName": {
            "title": "Contractor business name",
            "type": "string",
            "description": "Exact contractor business name in mode=byContractor (e.g. `OWNER-BUILDER`); substring filter in mode=search."
          },
          "workDescriptionKeyword": {
            "title": "Work description contains",
            "type": "string",
            "description": "Case-insensitive substring match on the permit's work description. Example: `swimming pool`."
          },
          "permitType": {
            "title": "Permit type",
            "enum": [
              "",
              "Bldg-New",
              "Bldg-Addition",
              "Bldg-Alter/Repair"
            ],
            "type": "string",
            "description": "Filter to a single top-level permit type.",
            "default": ""
          },
          "permitSubType": {
            "title": "Permit sub-type",
            "enum": [
              "",
              "1 or 2 Family Dwelling",
              "Apartment",
              "Commercial"
            ],
            "type": "string",
            "description": "Filter to a single building-use sub-type.",
            "default": ""
          },
          "permitCategory": {
            "title": "Permit category",
            "enum": [
              "",
              "Plan Check",
              "No Plan Check"
            ],
            "type": "string",
            "description": "Filter to a single review category.",
            "default": ""
          },
          "status": {
            "title": "Status",
            "enum": [
              "",
              "CofC Corrected",
              "CofC Issued",
              "CofO Corrected",
              "CofO in Progress",
              "CofO Issued",
              "CofO Reactivated",
              "CofO Revoked",
              "CofO Superseded",
              "Conditional Approval",
              "Intent to Correct CofC",
              "Intent to Revoke",
              "Intent to Revoke CofC",
              "Issued",
              "No Progress",
              "Not Required",
              "OK for CofC",
              "OK to Issue CofC",
              "Permit Closed",
              "Permit Expired",
              "Permit Extended",
              "Permit Finaled",
              "Permit Revoked",
              "Permit Withdrawn",
              "Re-Activate Permit",
              "Ready to Issue",
              "Refund Completed",
              "Refund in Progress"
            ],
            "type": "string",
            "description": "Filter to a single current permit status.",
            "default": ""
          },
          "initiatingOffice": {
            "title": "Initiating office",
            "enum": [
              "",
              "METRO",
              "VAN NUYS",
              "INTERNET",
              "WEST LA",
              "SOUTH LA",
              "SANPEDRO"
            ],
            "type": "string",
            "description": "Filter to a single LADBS district office that issued the permit.",
            "default": ""
          },
          "occupancy": {
            "title": "Occupancy group",
            "enum": [
              "",
              "A1 Occ. Group",
              "A2 Occ. Group",
              "A3 Occ. Group",
              "A5 Occ. Group",
              "B Occ. Group",
              "E Occ. Group",
              "E1 Occ. Group",
              "E3 Occ. Group",
              "F1 Occ. Group",
              "F2 Occ. Group",
              "H4 Occ. Group",
              "I2 Occ. Group",
              "M Occ. Group",
              "Misc. Occ. Group",
              "R1 Occ. Group",
              "R2 Occ. Group",
              "R2.1 Occ. Group",
              "R3 Occ. Group",
              "R4 Occ. Group",
              "S1 Occ. Group",
              "S2 Occ. Group",
              "S3 Occ. Group",
              "U Occ. Group",
              "U1 Occ. Group",
              "U2 Occ. Group"
            ],
            "type": "string",
            "description": "Filter to a single building-code occupancy classification. Only populated on a minority of permits (mostly new construction / major alterations) -- most permits omit this field entirely.",
            "default": ""
          },
          "zipCodes": {
            "title": "Zip codes",
            "type": "array",
            "description": "Restrict results to one or more 5-digit LA zip codes. Example: `90047`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "issueDateFrom": {
            "title": "Issue date from (YYYY-MM-DD)",
            "type": "string",
            "description": "Drop permits issued before this date."
          },
          "issueDateTo": {
            "title": "Issue date to (YYYY-MM-DD)",
            "type": "string",
            "description": "Drop permits issued after this date."
          },
          "statusDateFrom": {
            "title": "Status date from (YYYY-MM-DD)",
            "type": "string",
            "description": "Drop permits whose latest status change is before this date."
          },
          "statusDateTo": {
            "title": "Status date to (YYYY-MM-DD)",
            "type": "string",
            "description": "Drop permits whose latest status change is after this date."
          },
          "minValuation": {
            "title": "Min valuation (USD)",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "number",
            "description": "Drop permits with a lower declared construction valuation than this."
          },
          "maxValuation": {
            "title": "Max valuation (USD)",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "number",
            "description": "Drop permits with a higher declared construction valuation than this."
          },
          "minStories": {
            "title": "Min number of stories",
            "minimum": 0,
            "maximum": 200,
            "type": "integer",
            "description": "Drop permits with fewer stories than this."
          },
          "maxStories": {
            "title": "Max number of stories",
            "minimum": 0,
            "maximum": 200,
            "type": "integer",
            "description": "Drop permits with more stories than this."
          },
          "minResidentialUnits": {
            "title": "Min residential dwelling units",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Drop permits with fewer residential dwelling units than this."
          },
          "nearLatitude": {
            "title": "Near latitude (geo-radius search)",
            "minimum": -90,
            "maximum": 90,
            "type": "number",
            "description": "Latitude of a center point. Combine with `nearLongitude` (and optionally `radiusMeters`) to return only permits within a radius of this point. Example: `34.0522` (downtown LA). Both nearLatitude and nearLongitude must be set for this filter to apply."
          },
          "nearLongitude": {
            "title": "Near longitude (geo-radius search)",
            "minimum": -180,
            "maximum": 180,
            "type": "number",
            "description": "Longitude of a center point. Combine with `nearLatitude` (and optionally `radiusMeters`) to return only permits within a radius of this point. Example: `-118.2437` (downtown LA)."
          },
          "radiusMeters": {
            "title": "Radius (meters)",
            "minimum": 1,
            "maximum": 50000,
            "type": "number",
            "description": "Search radius around `nearLatitude`/`nearLongitude`, in meters. Only used when both are set. Defaults to 500m.",
            "default": 500
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "issueDateDesc",
              "issueDateAsc",
              "statusDateDesc",
              "statusDateAsc",
              "valuationDesc",
              "valuationAsc",
              "storiesDesc",
              "storiesAsc",
              "residentialUnitsDesc",
              "residentialUnitsAsc"
            ],
            "type": "string",
            "description": "Sort order for results.",
            "default": "issueDateDesc"
          },
          "appToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Optional free Socrata app token to raise API rate limits. Get one at https://data.lacity.org/profile/app_tokens. Not required — the actor works without it."
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap on emitted records.",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}