{
  "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": "jziseJVRagTQVVaKg"
  },
  "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 to search",
            "type": "array",
            "description": "Official health department portals to read. Example: New York City, Chicago, Austin. Each city is an independent official source and results are normalized to one format.",
            "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 (optional)",
            "type": "string",
            "description": "Name or part of a name to search in inspection records. Example: \"pizza\" or \"McDonald's\". Leave blank to get the most recent inspections of the chosen cities."
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum records to return, counting inspection, violation and restaurant profile records together. Free Apify plans are capped at 10 per run.",
            "default": 10
          },
          "inspectedSince": {
            "title": "Inspected since (date)",
            "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 (date)",
            "type": "string",
            "description": "Only inspections on or before this date (YYYY-MM-DD)."
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "Only inspections at these 5-digit ZIP codes. Example: 10001, 60614. San Francisco publishes no ZIP code and is skipped when this is used.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "restaurantIds": {
            "title": "Restaurant IDs",
            "type": "array",
            "description": "Only these restaurants, using the restaurantId from earlier results (NYC CAMIS number, Chicago license number, and so on). An id only matches in its own city.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "resultContains": {
            "title": "Result contains (text)",
            "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": "Min score (points)",
            "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": "Max score (points)",
            "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": "Only critical violations",
            "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 mentions (text)",
            "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."
          },
          "onlyNew": {
            "title": "Only new inspections",
            "type": "boolean",
            "description": "Skip inspections already delivered by earlier runs of the same search (same cities, name and filters). Skipped inspections are not charged and do not count toward Max results.",
            "default": false
          },
          "stateKey": {
            "title": "Monitor name (optional)",
            "type": "string",
            "description": "Label that keeps separate memories, for example \"nyc-pizza\" and \"chicago-all\". Leave empty to share one memory per search.",
            "default": ""
          },
          "resetSeen": {
            "title": "Forget what was already delivered",
            "type": "boolean",
            "description": "Start the monitor from zero for this search. Turn it off again after one run.",
            "default": false
          },
          "maxRowsPerCity": {
            "title": "Max source rows per city (0 = no cap)",
            "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
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}