{
  "openapi": "3.0.1",
  "info": {
    "title": "Yelp Scraper - Businesses, Phones, Ratings & Reviews by City",
    "description": "Scrape Yelp businesses by keyword and city: name, phone, website, rating, review count, address, categories, price, claimed and open-now flags. Optional details (hours, amenities, coordinates) and reviews with owner responses, plus an only-new-reviews monitor.",
    "version": "0.1",
    "x-build-id": "qk1MVkKc3317zn0ya"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rjmacarthy~yelp-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rjmacarthy-yelp-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/rjmacarthy~yelp-scraper/runs": {
      "post": {
        "operationId": "runs-sync-rjmacarthy-yelp-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/rjmacarthy~yelp-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-rjmacarthy-yelp-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "reviews"
            ],
            "type": "string",
            "description": "\"search\": one row per business from Yelp search results. \"reviews\": one row per review of the businesses in \"Business URLs\".",
            "default": "search"
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "What to search for, as on yelp.com: \"pizza\", \"plumbers\", \"dentist\", \"coffee\". Each term is searched in each location.",
            "items": {
              "type": "string"
            }
          },
          "locations": {
            "title": "Locations",
            "type": "array",
            "description": "Where to search: a city (\"Austin, TX\"), a ZIP code, a neighborhood (\"Brooklyn, NY\") or any place Yelp understands.",
            "items": {
              "type": "string"
            }
          },
          "searchUrls": {
            "title": "Yelp search URLs",
            "type": "array",
            "description": "Optional: Yelp search URLs copied from your browser (https://www.yelp.com/search?find_desc=...&find_loc=...). Filters in the URL (price, open now, sort) are kept.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max businesses per search",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Stop each search after this many businesses. Yelp shows 10 per page and at most 24 pages (240 businesses). The default 10 (page 1) is fast and reliable; more than 10 per search is slower (deeper pages take 60-100 s) and Yelp often refuses them. 0 = everything Yelp shows.",
            "default": 10
          },
          "skipAds": {
            "title": "Skip sponsored results",
            "type": "boolean",
            "description": "Leave out Yelp's sponsored (ad) listings and keep only the organic ranking. Turn off to include ads (flagged with isAd).",
            "default": true
          },
          "includeDetails": {
            "title": "Include business details",
            "type": "boolean",
            "description": "Also open each business page for opening hours, amenities, coordinates, menu link, year established, photo count and full address. One extra Yelp page per business, charged as the \"business-details\" event.",
            "default": false
          },
          "businessUrls": {
            "title": "Business URLs",
            "type": "array",
            "description": "Yelp business pages to scrape reviews from, e.g. https://www.yelp.com/biz/pedrosos-pizza-austin-6 (a bare alias or Yelp business id also works).",
            "items": {
              "type": "string"
            }
          },
          "maxReviews": {
            "title": "Max reviews per business",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many reviews per business. 0 = all reviews (capped by the page request cap).",
            "default": 50
          },
          "sortBy": {
            "title": "Sort reviews by",
            "enum": [
              "newest",
              "oldest",
              "highest",
              "lowest",
              "relevance",
              "elites"
            ],
            "type": "string",
            "description": "Order in which reviews are read. Monitor mode always uses newest first.",
            "default": "newest"
          },
          "language": {
            "title": "Review language",
            "type": "string",
            "description": "Two-letter language code of the reviews to fetch (Yelp filters by language). Default \"en\".",
            "default": "en"
          },
          "monitorMode": {
            "title": "Monitor mode",
            "enum": [
              "all",
              "new"
            ],
            "type": "string",
            "description": "\"all\": every review up to the limit. \"new\": only reviews not output by an earlier run with the same monitor name (schedule the Actor to get new reviews only). The first run outputs everything and becomes the baseline. In this mode every review page read is charged as a \"monitor-check\" event ($0.0015), even when nothing new is found.",
            "default": "all"
          },
          "stateKey": {
            "title": "Monitor name",
            "type": "string",
            "description": "Name of the monitor whose seen reviews are remembered (named key-value store \"yelp-scraper-state\"). Use different names for independent schedules.",
            "default": "default"
          },
          "maxConcurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Yelp pages fetched at the same time (each page takes 2-30 s).",
            "default": 8
          },
          "maxZyteRequests": {
            "title": "Max pages per run",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "Safety cap on Yelp page requests per run. 0 = automatic (the pages your limits need plus 20%, never more than 2,000). On the free Apify plan runs are limited to 5 pages.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}