{
  "openapi": "3.0.1",
  "info": {
    "title": "Retty Japan Restaurant Scraper",
    "description": "Scrape Tokyo and Japan restaurant data from Retty (レッティ), the real-name review site. Get names, cuisine, lunch and dinner budgets, match scores, nearest stations and photos. With detail pages on: address, GPS, booking phone, opening hours, cards, website links and ratings.",
    "version": "0.0",
    "x-build-id": "XuPr7SDgXdsDgQlb6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/piquno~retty-japan-restaurant-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-piquno-retty-japan-restaurant-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/piquno~retty-japan-restaurant-scraper/runs": {
      "post": {
        "operationId": "runs-sync-piquno-retty-japan-restaurant-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/piquno~retty-japan-restaurant-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-piquno-retty-japan-restaurant-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": [
          "prefecture"
        ],
        "properties": {
          "prefecture": {
            "title": "Prefecture",
            "enum": [
              "1",
              "2",
              "3",
              "4",
              "5",
              "6",
              "7",
              "8",
              "9",
              "10",
              "11",
              "12",
              "13",
              "14",
              "15",
              "16",
              "17",
              "18",
              "19",
              "20",
              "21",
              "22",
              "23",
              "24",
              "25",
              "26",
              "27",
              "28",
              "29",
              "30",
              "31",
              "32",
              "33",
              "34",
              "35",
              "36",
              "37",
              "38",
              "39",
              "40",
              "41",
              "42",
              "43",
              "44",
              "45",
              "46",
              "47"
            ],
            "type": "string",
            "description": "Japanese prefecture to scrape. All 47 supported.",
            "default": "13"
          },
          "area": {
            "title": "Area (optional)",
            "type": "string",
            "description": "Narrow to one area within the prefecture. Accepts an area name substring as shown on Retty (e.g. 新宿, 渋谷, 銀座) or an ARE code (e.g. ARE1). Leave blank for the whole prefecture."
          },
          "subArea": {
            "title": "Sub-area (optional)",
            "type": "string",
            "description": "Narrow further to one sub-area by name substring (e.g. 歌舞伎町) or SUB code (e.g. SUB101)."
          },
          "genre": {
            "title": "Genre / cuisine",
            "enum": [
              "",
              "LCAT1/CAT350",
              "LCAT1/CAT410",
              "LCAT1/CAT415",
              "LCAT1/CAT512",
              "LCAT1/CAT102",
              "LCAT2/CAT30",
              "LCAT2/CAT41",
              "LCAT2/CAT42",
              "LCAT2/CAT70",
              "LCAT3/CAT310",
              "LCAT3/CAT220",
              "LCAT3/CAT320",
              "LCAT3/CAT33",
              "LCAT4/CAT110",
              "LCAT4/CAT23",
              "LCAT5/CAT290",
              "LCAT5/CAT295",
              "LCAT5/CAT50",
              "LCAT5/CAT60",
              "LCAT6/CAT200",
              "LCAT6/CAT210",
              "LCAT7/CAT270",
              "LCAT7/CAT280",
              "LCAT8/CAT16",
              "LCAT8/CAT90",
              "LCAT9/CAT370",
              "LCAT9/CAT163",
              "LCAT9/CAT380",
              "LCAT9/CAT390",
              "LCAT11/CAT340",
              "LCAT12/CAT80",
              "LCAT12/CAT62",
              "LCAT13/CAT120",
              "LCAT14/CAT260",
              "LCAT15/CAT300",
              "LCAT15/CAT230",
              "LCAT15/CAT240",
              "LCAT15/CAT160",
              "LCAT18/CAT81",
              "LCAT18/CAT140",
              "LCAT19/CAT131",
              "LCAT21/CAT360"
            ],
            "type": "string",
            "description": "Read only this genre's list in each sub-area, plus the sub-area's own top list (all genres). 'Areas only' depth ignores this field. Leave as 'Any' to crawl every genre list for each sub-area (Sub-areas + genres or Full depth).",
            "default": ""
          },
          "categoryCode": {
            "title": "Custom category code (advanced)",
            "type": "string",
            "description": "Any Retty category path not in the Genre list, in the form LCAT1/CAT350. Used only when Genre is 'Any'."
          },
          "crawlMode": {
            "title": "Crawl depth",
            "enum": [
              "areas-only",
              "subareas",
              "genres",
              "full"
            ],
            "type": "string",
            "description": "Retty publishes curated 'top 20' lists rather than paginated results. 'Sub-areas' reads one list per sub-area (fast, ~20 per sub-area). 'Sub-areas + genres' also reads every genre list per sub-area (much wider coverage). 'Full' adds occasion and themed lists as well. With a Genre or Custom category code set, 'Sub-areas', 'Sub-areas + genres' and 'Full' all read each sub-area's own top list and that genre's list only.",
            "default": "genres"
          },
          "startUrls": {
            "title": "Start URLs (advanced, optional)",
            "type": "array",
            "description": "Paste retty.me list URLs (area, sub-area, genre, purpose or collection pages) to scrape directly. Overrides prefecture/area/genre when set.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Stop after this many unique restaurants.",
            "default": 100
          },
          "includeDetails": {
            "title": "Include detail pages",
            "type": "boolean",
            "description": "Fetch each restaurant's page for address, coordinates, phone, hours, closed days, seats, private rooms, smoking, cards, rating and review count. One extra request per restaurant.",
            "default": false
          },
          "requestDelaySecs": {
            "title": "Delay between requests (seconds)",
            "minimum": 0,
            "maximum": 30,
            "type": "integer",
            "description": "Polite pause after each request, per worker.",
            "default": 1
          },
          "maxConcurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Parallel requests. Keep low to stay polite.",
            "default": 3
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Retty only serves listing pages to residential IP addresses and answers 406 to datacenter ranges, so Apify residential proxies are required. Japanese IPs work best.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "JP"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}