{
  "openapi": "3.0.1",
  "info": {
    "title": "NYC Restaurant Inspections",
    "description": "Search New York City restaurant health inspection results by date, borough, grade, cuisine, name and zip code. One clean row per violation, paid per row.",
    "version": "0.1",
    "x-build-id": "zdPPIsrBEGnvFKrhs"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/zeiphr~nyc-restaurant-inspections/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-zeiphr-nyc-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/zeiphr~nyc-restaurant-inspections/runs": {
      "post": {
        "operationId": "runs-sync-zeiphr-nyc-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/zeiphr~nyc-restaurant-inspections/run-sync": {
      "post": {
        "operationId": "run-sync-zeiphr-nyc-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": {
          "days": {
            "title": "Days to look back",
            "minimum": 1,
            "maximum": 36500,
            "type": "integer",
            "description": "How many days back from today to look, based on the date of the inspection. Ignored if you fill in 'From date'. If you set no borough, grade, cuisine, name or zip code, this must be 31 or less so the run stays a sensible size.",
            "default": 7
          },
          "dateFrom": {
            "title": "From date (optional)",
            "type": "string",
            "description": "Earliest inspection date to include, written YYYY-MM-DD (for example 2026-10-01). If you set this, 'Days to look back' is ignored."
          },
          "dateTo": {
            "title": "To date (optional)",
            "type": "string",
            "description": "Latest inspection date to include, written YYYY-MM-DD (for example 2026-10-31). Leave empty to mean today."
          },
          "borough": {
            "title": "Borough",
            "enum": [
              "any",
              "Manhattan",
              "Brooklyn",
              "Queens",
              "Bronx",
              "Staten Island"
            ],
            "type": "string",
            "description": "Only return restaurants in one of the five boroughs (the five main areas of New York City). Choose 'any' for all of them.",
            "default": "any"
          },
          "grade": {
            "title": "Grade",
            "enum": [
              "any",
              "A",
              "B",
              "C",
              "N",
              "Z",
              "P"
            ],
            "type": "string",
            "description": "Only return rows with this grade. A, B and C are the letter grades a restaurant posts in its window (A is best). N means not yet graded. Z means the grade is pending. P means the grade is pending after the restaurant reopened following a closure. Many rows have no grade at all, because a grade is only given at certain inspections. Choose 'any' for all rows.",
            "default": "any"
          },
          "criticalOnly": {
            "title": "Critical violations only",
            "type": "boolean",
            "description": "Tick this to return only violations the health department flags as critical, meaning the kind most likely to make people ill, such as food kept at unsafe temperatures.",
            "default": false
          },
          "cuisine": {
            "title": "Cuisine (optional)",
            "type": "string",
            "description": "Only return restaurants whose cuisine description contains these words, ignoring capital letters. For example Pizza or Chinese."
          },
          "restaurantName": {
            "title": "Restaurant name (optional)",
            "type": "string",
            "description": "Only return restaurants whose name contains these words, ignoring capital letters. For example Joe. Only letters, numbers, spaces and the characters ' - & . , are allowed."
          },
          "zipCode": {
            "title": "Zip code (optional)",
            "type": "string",
            "description": "Only return restaurants in one zip code, written as 5 digits, for example 10034."
          },
          "maxResults": {
            "title": "Maximum rows to return",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "The most rows you want back. You are charged per row returned, so this also caps your cost. Remember one row is one violation, not one restaurant.",
            "default": 200
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}