{
  "openapi": "3.0.1",
  "info": {
    "title": "NYC Restaurant Inspection Scraper",
    "description": "Scrape the official NYC DOHMH Restaurant Inspection Results open dataset. Search or filter by borough, cuisine, grade, inspection type, critical flag, ZIP code, or date range; look up a restaurant's full inspection history by CAMIS ID. Free public Socrata API, no login required.",
    "version": "1.0",
    "x-build-id": "MTmOiNt1dLo7lLKqc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~nyc-restaurant-inspection-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-nyc-restaurant-inspection-scraper",
        "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/crawlerbros~nyc-restaurant-inspection-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-nyc-restaurant-inspection-scraper",
        "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/crawlerbros~nyc-restaurant-inspection-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-nyc-restaurant-inspection-scraper",
        "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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "byCamis"
            ],
            "type": "string",
            "description": "What to fetch.",
            "default": "search"
          },
          "searchQuery": {
            "title": "Full-text search",
            "type": "string",
            "description": "Free-text search across restaurant name, cuisine, and other text fields (mode=search). Leave blank to browse without a text query."
          },
          "dbaKeyword": {
            "title": "Restaurant name contains",
            "type": "string",
            "description": "Case-insensitive substring match on the restaurant's DBA (\"doing business as\") name (mode=search). Example: `starbucks`."
          },
          "camisIds": {
            "title": "CAMIS IDs (mode=byCamis)",
            "type": "array",
            "description": "Unique restaurant identifiers (CAMIS numbers) to fetch full inspection history for. Example: `41235305`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "borough": {
            "title": "Borough",
            "enum": [
              "",
              "Manhattan",
              "Brooklyn",
              "Queens",
              "Bronx",
              "Staten Island",
              "0"
            ],
            "type": "string",
            "description": "Filter to a single NYC borough.",
            "default": ""
          },
          "cuisineDescription": {
            "title": "Cuisine",
            "enum": [
              "",
              "Afghan",
              "African",
              "American",
              "Armenian",
              "Asian/Asian Fusion",
              "Australian",
              "Bagels/Pretzels",
              "Bakery Products/Desserts",
              "Bangladeshi",
              "Barbecue",
              "Basque",
              "Bottled Beverages",
              "Brazilian",
              "Cajun",
              "Californian",
              "Caribbean",
              "Chicken",
              "Chilean",
              "Chimichurri",
              "Chinese",
              "Chinese/Cuban",
              "Chinese/Japanese",
              "Coffee/Tea",
              "Continental",
              "Creole",
              "Creole/Cajun",
              "Czech",
              "Donuts",
              "Eastern European",
              "Egyptian",
              "English",
              "Ethiopian",
              "Filipino",
              "French",
              "Frozen Desserts",
              "Fruits/Vegetables",
              "Fusion",
              "German",
              "Greek",
              "Hamburgers",
              "Haute Cuisine",
              "Hawaiian",
              "Hotdogs",
              "Hotdogs/Pretzels",
              "Indian",
              "Indonesian",
              "Iranian",
              "Irish",
              "Italian",
              "Japanese",
              "Jewish/Kosher",
              "Juice, Smoothies, Fruit Salads",
              "Korean",
              "Latin American",
              "Lebanese",
              "Mediterranean",
              "Mexican",
              "Middle Eastern",
              "Moroccan",
              "New American",
              "New French",
              "Not Listed/Not Applicable",
              "Nuts/Confectionary",
              "Other",
              "Pakistani",
              "Pancakes/Waffles",
              "Peruvian",
              "Pizza",
              "Polish",
              "Polynesian",
              "Portuguese",
              "Russian",
              "Salads",
              "Sandwiches",
              "Sandwiches/Salads/Mixed Buffet",
              "Scandinavian",
              "Seafood",
              "Soul Food",
              "Soups",
              "Soups/Salads/Sandwiches",
              "Southeast Asian",
              "Southwestern",
              "Spanish",
              "Steakhouse",
              "Tapas",
              "Tex-Mex",
              "Thai",
              "Turkish",
              "Vegan",
              "Vegetarian"
            ],
            "type": "string",
            "description": "Filter to a single cuisine type, as classified by DOHMH.",
            "default": ""
          },
          "grade": {
            "title": "Grade",
            "enum": [
              "",
              "A",
              "B",
              "C",
              "N",
              "P",
              "Z"
            ],
            "type": "string",
            "description": "Filter to a single official inspection grade.",
            "default": ""
          },
          "criticalFlag": {
            "title": "Critical violation flag",
            "enum": [
              "",
              "Critical",
              "Not Critical",
              "Not Applicable"
            ],
            "type": "string",
            "description": "Filter by whether the cited violation was flagged as critical.",
            "default": ""
          },
          "actionType": {
            "title": "Inspection action",
            "enum": [
              "",
              "Violations were cited in the following area(s).",
              "Establishment Closed by DOHMH. Violations were cited in the following area(s) and those requiring immediate action were addressed.",
              "No violations were recorded at the time of this inspection.",
              "Establishment re-opened by DOHMH.",
              "Establishment re-closed by DOHMH."
            ],
            "type": "string",
            "description": "Filter by the outcome/action recorded for the inspection.",
            "default": ""
          },
          "inspectionType": {
            "title": "Inspection type",
            "enum": [
              "",
              "Accelerated Inspection Program / Initial Inspection",
              "Accelerated Inspection Program / Reopening Inspection",
              "Accelerated Inspection Program / Second Compliance Inspection",
              "Administrative Miscellaneous / Compliance Inspection",
              "Administrative Miscellaneous / Initial Inspection",
              "Administrative Miscellaneous / Re-inspection",
              "Administrative Miscellaneous / Reopening Inspection",
              "Administrative Miscellaneous / Second Compliance Inspection",
              "Calorie Posting / Compliance Inspection",
              "Calorie Posting / Initial Inspection",
              "Calorie Posting / Re-inspection",
              "Cycle Inspection / Compliance Inspection",
              "Cycle Inspection / Initial Inspection",
              "Cycle Inspection / Re-inspection",
              "Cycle Inspection / Reopening Inspection",
              "Cycle Inspection / Second Compliance Inspection",
              "Inter-Agency Task Force / Initial Inspection",
              "Inter-Agency Task Force / Re-inspection",
              "Pre-permit (Non-operational) / Compliance Inspection",
              "Pre-permit (Non-operational) / Initial Inspection",
              "Pre-permit (Non-operational) / Re-inspection",
              "Pre-permit (Non-operational) / Second Compliance Inspection",
              "Pre-permit (Operational) / Compliance Inspection",
              "Pre-permit (Operational) / Initial Inspection",
              "Pre-permit (Operational) / Re-inspection",
              "Pre-permit (Operational) / Reopening Inspection",
              "Pre-permit (Operational) / Second Compliance Inspection",
              "Smoke-Free Air Act / Compliance Inspection",
              "Smoke-Free Air Act / Initial Inspection",
              "Smoke-Free Air Act / Re-inspection",
              "Sodium Warning / Initial Inspection",
              "Sodium Warning / Re-inspection",
              "Trans Fat / Compliance Inspection",
              "Trans Fat / Initial Inspection",
              "Trans Fat / Re-inspection",
              "Trans Fat / Second Compliance Inspection"
            ],
            "type": "string",
            "description": "Filter by the DOHMH inspection program and phase.",
            "default": ""
          },
          "inspectionDateFrom": {
            "title": "Inspection date from (YYYY-MM-DD)",
            "type": "string",
            "description": "Drop inspections before this date."
          },
          "inspectionDateTo": {
            "title": "Inspection date to (YYYY-MM-DD)",
            "type": "string",
            "description": "Drop inspections after this date."
          },
          "zipcode": {
            "title": "ZIP code",
            "type": "string",
            "description": "Filter to a single 5-digit NYC ZIP code, e.g. `10013`."
          },
          "minScore": {
            "title": "Min inspection score",
            "minimum": 0,
            "maximum": 200,
            "type": "integer",
            "description": "Drop inspections scoring below this (higher score = more violation points)."
          },
          "maxScore": {
            "title": "Max inspection score",
            "minimum": 0,
            "maximum": 200,
            "type": "integer",
            "description": "Drop inspections scoring above this."
          },
          "nearLatitude": {
            "title": "Near latitude",
            "minimum": -90,
            "maximum": 90,
            "type": "number",
            "description": "Latitude of a point to search near (mode=search). Must be combined with `nearLongitude` — both are required together to activate the radius filter. Example: `40.7580` (Times Square)."
          },
          "nearLongitude": {
            "title": "Near longitude",
            "minimum": -180,
            "maximum": 180,
            "type": "number",
            "description": "Longitude of a point to search near (mode=search). Must be combined with `nearLatitude`. Example: `-73.9855` (Times Square)."
          },
          "nearRadiusMeters": {
            "title": "Near radius (meters)",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Radius in meters around the `nearLatitude`/`nearLongitude` point. Only applied when both coordinates are set.",
            "default": 500
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "inspectionDateDesc",
              "inspectionDateAsc",
              "scoreDesc",
              "scoreAsc",
              "dbaAsc",
              "boroAsc",
              "zipcodeAsc",
              "cuisineAsc"
            ],
            "type": "string",
            "description": "Sort order for results.",
            "default": "inspectionDateDesc"
          },
          "appToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Optional free Socrata app token to raise API rate limits. Get one at https://data.cityofnewyork.us/profile/app_tokens. Not required — the actor works without it."
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap on emitted records.",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}