{
  "openapi": "3.0.1",
  "info": {
    "title": "Restaurant Health Inspections Scraper: Violations & Alerts",
    "description": "Get alerts for new restaurant health inspections, fails, closures and critical violations across NYC, Chicago, Austin, King County/Seattle, New York State, Delaware and Marin County. One normalized format. Filter by name, city, ZIP, outcome. 'Only new' mode. No API key.",
    "version": "0.1",
    "x-build-id": "w91RmIdZCKS97mec3"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/radiant_opuntia~restaurant-inspections-alerts/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-radiant_opuntia-restaurant-inspections-alerts",
        "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/radiant_opuntia~restaurant-inspections-alerts/runs": {
      "post": {
        "operationId": "runs-sync-radiant_opuntia-restaurant-inspections-alerts",
        "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/radiant_opuntia~restaurant-inspections-alerts/run-sync": {
      "post": {
        "operationId": "run-sync-radiant_opuntia-restaurant-inspections-alerts",
        "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": "Which city / county / state health department feeds to search. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "nyc",
                "chicago",
                "austin",
                "king",
                "ny_state",
                "delaware",
                "marin"
              ],
              "enumTitles": [
                "New York City",
                "Chicago",
                "Austin (TX)",
                "King County / Seattle (WA)",
                "New York State (outside NYC)",
                "Delaware",
                "Marin County (CA)"
              ]
            },
            "default": []
          },
          "keyword": {
            "title": "Business name contains",
            "type": "string",
            "description": "Part of the restaurant / business name, e.g. \"pizza\", \"mcdonald\". Leave empty for all."
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Only these cities / boroughs (NYC: Manhattan, Brooklyn, Queens, Bronx, Staten Island). Leave empty for all.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "Only these 5-digit ZIP codes. Leave empty for all.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "outcomes": {
            "title": "Outcomes",
            "type": "array",
            "description": "Only these normalized outcomes. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "pass",
                "conditional",
                "fail",
                "closed",
                "violations",
                "reopened",
                "other"
              ],
              "enumTitles": [
                "Pass / no violations",
                "Conditional pass / yellow",
                "Fail / unsatisfactory",
                "Closed by health department",
                "Violations cited (no pass/fail given)",
                "Reopened",
                "Other"
              ]
            },
            "default": []
          },
          "problemsOnly": {
            "title": "Problems only",
            "type": "boolean",
            "description": "Only failed or closed inspections, red placards, or inspections with critical violations.",
            "default": false
          },
          "inspectedWithinDays": {
            "title": "Inspected within last (days)",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Look back window. Some feeds lag by days or weeks (Austin about a month, New York State about a week), so use 14 or more for a weekly alert. Ignored if a start date is set.",
            "default": 7
          },
          "startDate": {
            "title": "Start date (optional)",
            "type": "string",
            "description": "YYYY-MM-DD. Overrides the look back."
          },
          "endDate": {
            "title": "End date (optional)",
            "type": "string",
            "description": "YYYY-MM-DD. Defaults to today."
          },
          "onlyNew": {
            "title": "Only new inspections",
            "type": "boolean",
            "description": "Skip inspections already returned by an earlier run with the same alert name. Use with a schedule for alerts.",
            "default": false
          },
          "stateKey": {
            "title": "Alert name",
            "type": "string",
            "description": "Name for this alert so several schedules do not share memory, e.g. \"nyc-pizza-fails\". Leave empty to derive it from the filters."
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Optional free token from the city / state data portal for higher rate limits. Not needed for normal use."
          },
          "maxResultsPerJurisdiction": {
            "title": "Max inspections per jurisdiction",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Cap per feed. With only new on, the next run returns the next batch.",
            "default": 500
          },
          "maxResults": {
            "title": "Max inspections in total",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Overall cap across feeds.",
            "default": 5000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}