{
  "openapi": "3.0.1",
  "info": {
    "title": "Alameda County Restaurant Inspection Scraper",
    "description": "Scrape restaurant health inspection records for Alameda County, CA (Oakland, Berkeley, Fremont, Hayward + 15 more) - name, address, placard grade, violations, geolocation. Search by name, city, facility ID, or location.",
    "version": "1.0",
    "x-build-id": "0i5HCEtM3OTt3rqB3"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~alameda-county-restaurant-inspection-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-alameda-county-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~alameda-county-restaurant-inspection-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-alameda-county-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~alameda-county-restaurant-inspection-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-alameda-county-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",
              "byCity",
              "byFacilityId",
              "byZip",
              "nearby"
            ],
            "type": "string",
            "description": "What to fetch.",
            "default": "search"
          },
          "searchQuery": {
            "title": "Restaurant / facility name (mode=search)",
            "type": "string",
            "description": "Free-text keyword matched against the facility name (case-insensitive, partial match).",
            "default": "pizza"
          },
          "cities": {
            "title": "Cities (mode=byCity)",
            "type": "array",
            "description": "One or more Alameda County cities/unincorporated areas to browse. Also usable as an extra filter on other modes.",
            "items": {
              "type": "string",
              "enum": [
                "AKRON",
                "ALAMEDA",
                "ALBANY",
                "ASHLAND",
                "BERKELEY",
                "CASTRO VALLEY",
                "DUBLIN",
                "EMERYVILLE",
                "FREMONT",
                "HAYWARD",
                "LIVERMORE",
                "NEWARK",
                "OAKLAND",
                "PIEDMONT",
                "PLEASANTON",
                "SAN LEANDRO",
                "SAN LORENZO",
                "SUNOL",
                "UNION CITY"
              ],
              "enumTitles": [
                "Akron",
                "Alameda",
                "Albany",
                "Ashland",
                "Berkeley",
                "Castro Valley",
                "Dublin",
                "Emeryville",
                "Fremont",
                "Hayward",
                "Livermore",
                "Newark",
                "Oakland",
                "Piedmont",
                "Pleasanton",
                "San Leandro",
                "San Lorenzo",
                "Sunol",
                "Union City"
              ]
            },
            "default": []
          },
          "facilityIds": {
            "title": "Facility IDs (mode=byFacilityId)",
            "type": "array",
            "description": "Exact Alameda County facility IDs, e.g. `FA0000154`. Returns the full inspection/violation history for each facility.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "latitude": {
            "title": "Latitude (mode=nearby)",
            "minimum": -90,
            "maximum": 90,
            "type": "number",
            "description": "Center point latitude in decimal degrees, e.g. `37.8044` (Oakland).",
            "default": 37.8044
          },
          "longitude": {
            "title": "Longitude (mode=nearby)",
            "minimum": -180,
            "maximum": 180,
            "type": "number",
            "description": "Center point longitude in decimal degrees, e.g. `-122.2712` (Oakland).",
            "default": -122.2712
          },
          "radiusKm": {
            "title": "Search radius in km (mode=nearby)",
            "minimum": 0.1,
            "maximum": 50,
            "type": "number",
            "description": "Distance from the center point to search within.",
            "default": 2
          },
          "grades": {
            "title": "Filter by placard grade",
            "type": "array",
            "description": "Restrict to one or more posted placard grades. Green = Pass, Yellow = Conditional Pass, Red = Closed/failed. C and M are rarer county-specific categories (e.g. cottage-food/home-kitchen operations).",
            "items": {
              "type": "string",
              "enum": [
                "G",
                "Y",
                "R",
                "C",
                "M"
              ],
              "enumTitles": [
                "G - Green (Pass)",
                "Y - Yellow (Conditional Pass)",
                "R - Red (Closed / Failed)",
                "C - Other county category",
                "M - Other county category"
              ]
            },
            "default": []
          },
          "inspectionServiceCodes": {
            "title": "Filter by inspection service code",
            "type": "array",
            "description": "Restrict to one or more internal county service/activity codes recorded against the inspection.",
            "items": {
              "type": "string",
              "enum": [
                "111",
                "131"
              ],
              "enumTitles": [
                "Service code 111",
                "Service code 131"
              ]
            },
            "default": []
          },
          "zipCodes": {
            "title": "ZIP code(s) (mode=byZip)",
            "type": "array",
            "description": "One or more 5-digit ZIP codes to browse (mode=byZip). Also usable as an extra filter on other modes.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "dateFrom": {
            "title": "Inspection date from (YYYY-MM-DD)",
            "type": "string",
            "description": "Only include inspections on or after this date."
          },
          "dateTo": {
            "title": "Inspection date to (YYYY-MM-DD)",
            "type": "string",
            "description": "Only include inspections on or before this date."
          },
          "sortBy": {
            "title": "Sort order",
            "enum": [
              "newest",
              "oldest"
            ],
            "type": "string",
            "description": "Order inspection records by activity date.",
            "default": "newest"
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Hard cap on emitted records.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}