{
  "openapi": "3.0.1",
  "info": {
    "title": "OpenRice Restaurant Scraper (Hong Kong)",
    "description": "Scrape Hong Kong restaurant detail, reviews, and menu photos from OpenRice into a structured dataset. Scheduled batch data feed — polite, reliable crawling over residential proxy.",
    "version": "0.0",
    "x-build-id": "cyJwDg225gvNZJf3D"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/precious_nucleus~openrice-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-precious_nucleus-openrice-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/precious_nucleus~openrice-scraper/runs": {
      "post": {
        "operationId": "runs-sync-precious_nucleus-openrice-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/precious_nucleus~openrice-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-precious_nucleus-openrice-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",
        "properties": {
          "district": {
            "title": "District",
            "enum": [
              "",
              "2008",
              "1019",
              "2010",
              "1022",
              "2026",
              "1003",
              "3018",
              "2001",
              "2029",
              "2028",
              "3003",
              "3007",
              "1001",
              "3020",
              "1004",
              "2013",
              "2019",
              "2016",
              "3012",
              "2004",
              "2005",
              "2011",
              "2015",
              "2022",
              "3005",
              "1008",
              "1026",
              "2003",
              "3002",
              "3015",
              "1014",
              "1017",
              "1018",
              "1009",
              "2027",
              "3006",
              "3014",
              "4009",
              "1011",
              "1020",
              "1023",
              "1025",
              "2002",
              "2006",
              "2020",
              "2030",
              "3004",
              "3017",
              "3019"
            ],
            "type": "string",
            "description": "Crawl restaurants in a specific Hong Kong district. Covers the main dining areas; for an area not listed, use Keyword or Restaurant IDs.",
            "default": ""
          },
          "keyword": {
            "title": "Keyword",
            "type": "string",
            "description": "Free-text search (restaurant name, cuisine, dish, area). Combine with District to narrow further. Leave empty to skip."
          },
          "cuisineId": {
            "title": "Cuisine ID (advanced)",
            "type": "integer",
            "description": "Filter by OpenRice cuisine/category id (e.g. 2004). Advanced: there is no public name list, so this takes a raw numeric id. Leave empty to skip."
          },
          "newlyOpenedOnly": {
            "title": "Newly opened only",
            "type": "boolean",
            "description": "Restrict to newly-opened restaurants (~900). Combines with District/Keyword/Cuisine.",
            "default": false
          },
          "crawlAll": {
            "title": "Crawl all of Hong Kong",
            "type": "boolean",
            "description": "Crawl across all of HK (~33,000) when no District/Keyword/Cuisine filter is set, bounded by Max restaurants. Takes many hours — keep the cap modest and run on a schedule.",
            "default": false
          },
          "restaurantIds": {
            "title": "Restaurant IDs",
            "type": "array",
            "description": "Specific OpenRice POI ids — the number after -r in a restaurant URL (e.g. 600214). Takes priority over the filters above.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Specific OpenRice restaurant detail page URLs. Takes priority over the filters above.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxRestaurants": {
            "title": "Max restaurants",
            "minimum": 1,
            "type": "integer",
            "description": "Hard cap on how many restaurants to crawl this run (applies to every mode).",
            "default": 500
          },
          "reviewsPerRestaurant": {
            "title": "Reviews per restaurant",
            "minimum": 0,
            "type": "integer",
            "description": "How many of the most relevant + recent reviews to collect per restaurant. 0 skips reviews.",
            "default": 50
          },
          "includeMenuPhotos": {
            "title": "Include menu photos",
            "type": "boolean",
            "description": "Also collect user-uploaded menu / price-list photos. Turn off to reduce runtime and proxy usage.",
            "default": true
          },
          "language": {
            "title": "Language",
            "enum": [
              "zh",
              "en"
            ],
            "type": "string",
            "description": "Content language for OpenRice.",
            "default": "zh"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}