{
  "openapi": "3.0.1",
  "info": {
    "title": "US Restaurant Inspections & New Restaurant Leads",
    "description": "Health inspections of restaurants and food businesses in New York City, Chicago, Seattle & King County, Montgomery County MD, Cincinnati and Austin: results, grades, violations, closures, phone numbers. Find new restaurants before they open and get only new inspections on a schedule.",
    "version": "1.0",
    "x-build-id": "ZkPFresvCVdBOnNeM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/digital_influx~us-restaurant-inspections/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-digital_influx-us-restaurant-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/digital_influx~us-restaurant-inspections/runs": {
      "post": {
        "operationId": "runs-sync-digital_influx-us-restaurant-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/digital_influx~us-restaurant-inspections/run-sync": {
      "post": {
        "operationId": "run-sync-digital_influx-us-restaurant-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": {
          "sources": {
            "title": "Cities and counties",
            "type": "array",
            "description": "Health department portals to read. Empty = all six.",
            "items": {
              "type": "string",
              "enum": [
                "new-york-city",
                "chicago",
                "king-county-wa",
                "montgomery-county-md",
                "cincinnati",
                "austin"
              ],
              "enumTitles": [
                "New York City, NY",
                "Chicago, IL",
                "Seattle & King County, WA",
                "Montgomery County, MD",
                "Cincinnati, OH",
                "Austin, TX"
              ]
            }
          },
          "onlyNewEstablishments": {
            "title": "Only new restaurants and food businesses",
            "type": "boolean",
            "description": "Inspections made before a business opens or gets its license: pre-permit in New York City, license inspections in Chicago, pre-opening and change of ownership in Montgomery County. The other portals do not mark them and are skipped.",
            "default": false
          },
          "inspectedWithinDays": {
            "title": "Inspected within (days)",
            "minimum": 1,
            "maximum": 730,
            "type": "integer",
            "description": "Inspections of the last N days. Portals publish with a delay: New York City and Chicago about a day, Austin about three weeks.",
            "default": 30
          },
          "outcomes": {
            "title": "Results",
            "type": "array",
            "description": "Keep only these results. New York City grades instead of passing or failing, so it only has \"pass\" (no violations), \"closed\" and \"reopened\"; Austin gives scores only. Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "pass",
                "conditional",
                "fail",
                "closed",
                "reopened",
                "no-entry",
                "out-of-business"
              ],
              "enumTitles": [
                "Pass",
                "Pass with conditions",
                "Fail",
                "Closed by the health department",
                "Reopened",
                "No entry / not ready",
                "Out of business"
              ]
            }
          },
          "onlyWithCriticalViolations": {
            "title": "Only inspections with critical violations",
            "type": "boolean",
            "description": "New York City (critical) and King County (red) mark them; the other portals do not, so their inspections are left out when this is on.",
            "default": false
          },
          "businessNames": {
            "title": "Business names",
            "type": "array",
            "description": "Keep businesses whose name contains one of these, e.g. Starbucks, McDonald's.",
            "items": {
              "type": "string"
            }
          },
          "categoryKeywords": {
            "title": "Cuisine or business type",
            "type": "array",
            "description": "Words in the cuisine or business type, e.g. Pizza, Chinese, Bakery, Grocery, Mobile. Cincinnati and Austin do not give a type and are skipped.",
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "5-digit ZIP codes, or their first 3 digits for a wider area (e.g. 606 for most of Chicago).",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Newest inspections first, across all portals. You also never pay more than the spending limit you set for the run.",
            "default": 1000
          },
          "onlyNew": {
            "title": "Only new or updated inspections (for scheduled runs)",
            "type": "boolean",
            "description": "Save only inspections that earlier runs of this same search did not save, or whose result changed since (New York City adds grades days later; each row says which). Schedule it daily or weekly. The memory lives in a key-value store named \"us-restaurant-inspections-state\" in your account.",
            "default": false
          },
          "memoryName": {
            "title": "Memory name (optional)",
            "type": "string",
            "description": "By default each search has its own memory. Give a name to share one memory between tasks, or a new name to start over."
          },
          "appToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Without a token, the portals share a request limit per IP address. A free app token from any Socrata portal gives you your own limit. Only needed if a run reports a refused request."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}