{
  "openapi": "3.0.1",
  "info": {
    "title": "Los Angeles Building Permits API — New LADBS Feed",
    "description": "Los Angeles building permit API — every new LADBS permit since your last run, filtered by type, ZIP, value or keyword. $2 per 1,000 permits.",
    "version": "0.1",
    "x-build-id": "tOCEl9A5einn7oGCd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/themartygriffin~los-angeles-building-permits-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-themartygriffin-los-angeles-building-permits-feed",
        "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/themartygriffin~los-angeles-building-permits-feed/runs": {
      "post": {
        "operationId": "runs-sync-themartygriffin-los-angeles-building-permits-feed",
        "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/themartygriffin~los-angeles-building-permits-feed/run-sync": {
      "post": {
        "operationId": "run-sync-themartygriffin-los-angeles-building-permits-feed",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "backfill",
              "new"
            ],
            "type": "string",
            "description": "'backfill' returns permits issued in the last N days and saves the state; it is the default, so a first run returns real results. 'new' returns only permits not reported by an earlier run and needs saved state - it exits with an empty dataset if you have never run 'backfill'.",
            "default": "backfill"
          },
          "lookback_days": {
            "title": "Lookback days (backfill)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Backfill only. Return permits issued in the last this many days (1 to 365, the same span the Actor remembers reported permits for). The city updates the dataset about weekly, so the newest few days are often missing.",
            "default": 30
          },
          "include_already_reported": {
            "title": "Re-report permits already reported (backfill only)",
            "type": "boolean",
            "description": "Backfill only. Controls whether permits an earlier run already reported appear in the dataset again. Off (the default): they are left out. On: they are returned again. It never changes what you are charged: a permit is billed once, the first time it is reported, and re-reported permits are free. Permits are remembered for 365 days of issue dates, which covers the longest lookback.",
            "default": false
          },
          "permit_types": {
            "title": "Permit types",
            "type": "array",
            "description": "Exact dataset values, e.g. Bldg-New, Bldg-Addition, Bldg-Alter/Repair, Bldg-Demolition, Nonbldg-New, Grading, Sign, Swimming-Pool/Spa. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "permit_sub_types": {
            "title": "Permit sub-types",
            "type": "array",
            "description": "Exact dataset values: '1 or 2 Family Dwelling', 'Apartment', 'Commercial', 'Onsite', 'Offsite'. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "min_valuation": {
            "title": "Minimum valuation (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip permits with a stated valuation below this. Permits with no valuation are excluded when this or the maximum is set."
          },
          "max_valuation": {
            "title": "Maximum valuation (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip permits with a stated valuation above this. Permits with no valuation are excluded when this or the minimum is set."
          },
          "zip_codes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "5-digit ZIP codes, e.g. 90210. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "council_districts": {
            "title": "City council districts",
            "type": "array",
            "description": "Council district numbers 1-15. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "neighborhood_council": {
            "title": "Neighborhood council contains",
            "type": "string",
            "description": "Case-insensitive text that must appear in the neighborhood council name, e.g. 'VENICE'."
          },
          "keywords": {
            "title": "Description keywords",
            "type": "array",
            "description": "Return a permit if its work description contains ANY of these text fragments (case-insensitive), e.g. solar, ADU, pool. This is a substring match, so 'ADU' also matches longer words that contain it.",
            "items": {
              "type": "string"
            }
          },
          "max_results": {
            "title": "Maximum permits per run",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Safety cap on charged permits (never reported before) per run. Permits returned again for free do not count. Default 1000. Oldest first. The rest are picked up on the next 'new' run.",
            "default": 1000
          },
          "state_key": {
            "title": "State name",
            "type": "string",
            "description": "Name of the saved watermark. Use a different name for each filter set you schedule, because 'already reported' is tracked per name, not per filter set.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}