{
  "openapi": "3.0.1",
  "info": {
    "title": "US Restaurant Health Inspections (6 Cities)",
    "description": "Restaurant health inspections from NYC, Chicago, San Francisco, Austin, Seattle and Cincinnati open data: scores, grades, pass/fail and violations.",
    "version": "0.1",
    "x-build-id": "kx4ml4uWt7jZIBBBS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/huffworks~restaurant-health-inspections/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-huffworks-restaurant-health-inspections",
        "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/huffworks~restaurant-health-inspections/runs": {
      "post": {
        "operationId": "runs-sync-huffworks-restaurant-health-inspections",
        "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/huffworks~restaurant-health-inspections/run-sync": {
      "post": {
        "operationId": "run-sync-huffworks-restaurant-health-inspections",
        "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": {
          "jurisdictions": {
            "title": "Jurisdictions",
            "type": "array",
            "description": "Health departments to query. Each one is an official Socrata open-data API.",
            "items": {
              "type": "string",
              "enum": [
                "nyc",
                "chicago",
                "san-francisco",
                "austin",
                "king-county",
                "cincinnati"
              ],
              "enumTitles": [
                "New York City, NY (DOHMH)",
                "Chicago, IL (CDPH)",
                "San Francisco, CA (DPH)",
                "Austin, TX (Austin Public Health, scores only)",
                "King County / Seattle, WA",
                "Cincinnati, OH"
              ]
            },
            "default": [
              "nyc",
              "chicago",
              "san-francisco",
              "austin",
              "king-county",
              "cincinnati"
            ]
          },
          "nameContains": {
            "title": "Business name contains",
            "type": "string",
            "description": "Case-insensitive text that must appear in the business (DBA) name, e.g. \"starbucks\" or \"taco\"."
          },
          "addressContains": {
            "title": "Street address contains",
            "type": "string",
            "description": "Case-insensitive text that must appear in the street address, e.g. \"broadway\"."
          },
          "zip": {
            "title": "ZIP code (or prefix)",
            "type": "string",
            "description": "Full ZIP (\"10012\") or a prefix (\"606\" for most of Chicago). San Francisco publishes no ZIP column and is skipped when this is set."
          },
          "dateFrom": {
            "title": "Inspected from",
            "type": "string",
            "description": "Earliest inspection date: YYYY-MM-DD or relative, like \"90 days\" or \"1 year\". Empty means no lower limit."
          },
          "dateTo": {
            "title": "Inspected to",
            "type": "string",
            "description": "Latest inspection date (YYYY-MM-DD or relative). Empty means today. Future-dated rows are always dropped."
          },
          "minSeverity": {
            "title": "Minimum violation severity",
            "enum": [
              "all",
              "violations",
              "critical"
            ],
            "type": "string",
            "description": "\"All inspections\" includes clean ones. \"At least one violation\" skips Austin (no violation detail). \"At least one critical violation\" uses the critical flag as each department publishes it, which only NYC (Critical) and King County (RED) do.",
            "default": "all"
          },
          "results": {
            "title": "Normalized result",
            "type": "array",
            "description": "Keep only these normalized outcomes. Empty keeps all, including inspections with no assessable result (e.g. \"Out of Business\"). The README lists how each department's wording maps to pass, conditional and fail.",
            "items": {
              "type": "string",
              "enum": [
                "pass",
                "conditional",
                "fail"
              ],
              "enumTitles": [
                "Pass",
                "Conditional",
                "Fail"
              ]
            },
            "default": []
          },
          "onlyLatestPerEstablishment": {
            "title": "Only the latest inspection per establishment",
            "type": "boolean",
            "description": "Return one record per establishment: its most recent inspection within the date range and name/address/ZIP filters. The severity and result filters are applied to that latest inspection, so \"fail\" plus this option means \"places whose latest inspection failed\".",
            "default": false
          },
          "maxItems": {
            "title": "Maximum inspections",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many inspection records in total, shared evenly across the jurisdictions (left-over capacity rolls over to the next one). You pay per record, so this also caps the cost.",
            "default": 100
          },
          "maxRowsPerJurisdiction": {
            "title": "Maximum source rows to scan per jurisdiction",
            "minimum": 1000,
            "maximum": 2000000,
            "type": "integer",
            "description": "Safety limit on raw rows read from each API (several rows make one inspection in NYC, King County and Cincinnati). Raise it for very selective filters over long date ranges.",
            "default": 50000
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Not needed. Socrata serves these APIs without a token at lower rate limits; a free app token from any Socrata portal raises them for very large runs. Sent only as the X-App-Token header."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}