{
  "openapi": "3.0.1",
  "info": {
    "title": "Restaurant Health Inspection Scraper - NYC, Chicago, Austin",
    "description": "Scrape restaurant health inspections from NYC, Chicago and Austin in one run: inspection results, scores, each individual violation and restaurant profiles, normalized into one dataset. Search by name. No login or API key. Export CSV, Excel, JSON. 3 record types, from $0.01.",
    "version": "0.2",
    "x-build-id": "KoAIpecebXlP48Npq"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/recordsdata~restaurant-health-inspection-aggregator/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-recordsdata-restaurant-health-inspection-aggregator",
        "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/recordsdata~restaurant-health-inspection-aggregator/runs": {
      "post": {
        "operationId": "runs-sync-recordsdata-restaurant-health-inspection-aggregator",
        "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/recordsdata~restaurant-health-inspection-aggregator/run-sync": {
      "post": {
        "operationId": "run-sync-recordsdata-restaurant-health-inspection-aggregator",
        "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": "Health department open-data portals to search: nyc (New York City), chicago, austin, king-county (Seattle area), ny-state (New York State outside NYC), san-francisco, boston. Each is an independent official source; results are normalized into one schema. Defaults to nyc, chicago and austin. A city whose portal does not publish the data a filter needs (for example a score range in Chicago) is skipped and the run status says so.",
            "items": {
              "type": "string",
              "enum": [
                "nyc",
                "chicago",
                "austin",
                "king-county",
                "ny-state",
                "san-francisco",
                "boston"
              ],
              "enumTitles": [
                "New York City",
                "Chicago",
                "Austin",
                "King County (Seattle)",
                "New York State (outside NYC)",
                "San Francisco",
                "Boston"
              ]
            },
            "default": [
              "nyc",
              "chicago",
              "austin"
            ]
          },
          "restaurantName": {
            "title": "Restaurant Name",
            "type": "string",
            "description": "Restaurant or business name to search in inspection records, for example \"pizza\" or \"McDonald's\". Leave blank to return the most recent inspections for the selected cities."
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "Only inspections at addresses in these 5-digit ZIP codes, for example 10001 or 60614. San Francisco does not publish a ZIP code, so it is skipped when this is used.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "restaurantIds": {
            "title": "Restaurant IDs",
            "type": "array",
            "description": "Only these restaurants, by the restaurantId shown in earlier results (NYC CAMIS number, Chicago license number, King County business id and so on). Each portal has its own id format, so an id only matches in its own city.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "inspectedSince": {
            "title": "Inspected since",
            "type": "string",
            "description": "Only inspections on or after this date (YYYY-MM-DD). Inspections dated in the future or before the year 2000 are never returned."
          },
          "inspectedUntil": {
            "title": "Inspected until",
            "type": "string",
            "description": "Only inspections on or before this date (YYYY-MM-DD)."
          },
          "resultContains": {
            "title": "Result contains",
            "type": "string",
            "description": "Keep inspections whose result contains this text, not case sensitive: for example \"fail\", \"pass\", \"closed\" or \"conditions\". In New York City a single letter such as \"A\" matches that grade exactly. New York State publishes no inspection result, so it is skipped when this is used."
          },
          "minScore": {
            "title": "Minimum score",
            "type": "integer",
            "description": "Only inspections with a score of at least this number. Scores are not comparable across cities (see the scoreMeaning field): New York City and King County count violation points where lower is better, Austin scores out of 100 where higher is better. Cities without a numeric score are skipped when a score filter is used."
          },
          "maxScore": {
            "title": "Maximum score",
            "type": "integer",
            "description": "Only inspections with a score of at most this number. Example: in New York City, a maximum of 13 keeps grade A inspections."
          },
          "criticalOnly": {
            "title": "Critical violations only",
            "type": "boolean",
            "description": "Return only inspections that cited a critical violation (New York City, King County red violations, New York State), and only those critical violations. The violation count and critical count then cover the critical violations only. Other cities are skipped when this is on.",
            "default": false
          },
          "violationKeyword": {
            "title": "Violation keyword",
            "type": "string",
            "description": "Keep inspections where a violation description mentions this text, for example \"rodent\", \"temperature\" or \"hand wash\". Only the matching violations are returned and counted. San Francisco matches against the violation summary of each inspection and returns whole inspections. Austin publishes no violation text and is skipped."
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum number of records to return, counting inspection, violation and restaurant profile records together across all cities. Default 10. Free users are limited to 10. Skipped (already seen) inspections do not count.",
            "default": 10
          },
          "maxRowsPerCity": {
            "title": "Max source rows per city",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "Optional safety cap on how many rows are read from each city portal. In New York City, King County, New York State and Boston one source row is one violation, so an inspection takes several rows. 0 (default) means no cap: Max Items alone ends the run. Rows read are free, only delivered records are charged.",
            "default": 0
          },
          "onlyNew": {
            "title": "Only new inspections",
            "type": "boolean",
            "description": "Skip inspections already delivered by earlier runs with Only new inspections on for the same search (same cities, name and filters). Skipped inspections are not charged and do not count towards Max Items. A restaurant profile is delivered only once. Pair it with Inspected since for fast daily runs: without it, a run with nothing new reads recent history for up to 45 seconds before it stops.",
            "default": false
          },
          "stateKey": {
            "title": "Monitor name",
            "type": "string",
            "description": "Optional label that keeps separate memories (for example \"nyc-pizza\" and \"chicago-all\"). Leave empty to share one memory per search.",
            "default": ""
          },
          "resetSeen": {
            "title": "Reset monitor memory",
            "type": "boolean",
            "description": "Forget which inspections were already delivered for this search and start over. Turn it off again after one run.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}