{
  "openapi": "3.0.1",
  "info": {
    "title": "Yelp Reviews Scraper — Owner Replies & Monitor",
    "description": "Scrape Yelp reviews into JSON: star ratings, full text, photos, reactions, and owner replies. Filter unanswered reviews and monitor new reviews with webhooks. A Yelp API alternative for Python, Node.js, and MCP.",
    "version": "0.1",
    "x-build-id": "YHlyTsiBQObr2A7Xh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawloop~yelp-reviews-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawloop-yelp-reviews-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/crawloop~yelp-reviews-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawloop-yelp-reviews-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/crawloop~yelp-reviews-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawloop-yelp-reviews-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": [
              "reviews",
              "monitor"
            ],
            "type": "string",
            "description": "reviews = full/filtered scrape (optional business row); monitor = incremental new reviews + rating deltas with early-stop.",
            "default": "reviews"
          },
          "startUrls": {
            "title": "Business page URLs",
            "type": "array",
            "description": "Yelp business page URLs, e.g. https://www.yelp.com/biz/gary-danko-san-francisco.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "businessAliases": {
            "title": "Business aliases",
            "type": "array",
            "description": "Yelp URL slugs such as gary-danko-san-francisco.",
            "items": {
              "type": "string"
            }
          },
          "businessIds": {
            "title": "Encrypted business IDs",
            "type": "array",
            "description": "22-character Yelp encBizId values (e.g. cOcFMN_0nCqHHJ4KZhe5vA).",
            "items": {
              "type": "string"
            }
          },
          "searchTerm": {
            "title": "Search term",
            "type": "string",
            "description": "Optional Yelp search query (e.g. pizza). Requires searchLocation. Discovered businesses are then scraped for reviews."
          },
          "searchLocation": {
            "title": "Search location",
            "type": "string",
            "description": "City, neighborhood, or ZIP for searchTerm (e.g. San Francisco, CA)."
          },
          "maxBusinessesPerSearch": {
            "title": "Max businesses per search",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Cap businesses expanded from searchTerm + searchLocation.",
            "default": 10
          },
          "maxSearchPages": {
            "title": "Max search pages",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Safety cap on Yelp search result pages (10 businesses per page).",
            "default": 3
          },
          "includeSearchAds": {
            "title": "Include sponsored search results",
            "type": "boolean",
            "description": "Keep Yelp ads when expanding searchTerm results.",
            "default": false
          },
          "maxReviews": {
            "title": "Max reviews per business",
            "minimum": 0,
            "type": "integer",
            "description": "Cap reviews collected per business after filters. 0 = until pages run out (still bounded by maxPages).",
            "default": 100
          },
          "maxItems": {
            "title": "Max dataset items",
            "minimum": 0,
            "type": "integer",
            "description": "Hard cap on pushed dataset rows (all types). 0 = unlimited.",
            "default": 0
          },
          "maxPages": {
            "title": "Max review pages",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Safety cap on GraphQL review pages per business (10 reviews per page).",
            "default": 200
          },
          "sortOrder": {
            "title": "Review sort",
            "enum": [
              "newest",
              "oldest",
              "recommended",
              "highest",
              "lowest",
              "elites"
            ],
            "type": "string",
            "description": "Yelp review sort. newest is best for monitoring and publishedAfter.",
            "default": "newest"
          },
          "starRatings": {
            "title": "Star filter",
            "type": "array",
            "description": "Only keep these star ratings (1–5). Empty = all stars.",
            "items": {
              "type": "string",
              "enum": [
                "5",
                "4",
                "3",
                "2",
                "1"
              ],
              "enumTitles": [
                "5 stars",
                "4 stars",
                "3 stars",
                "2 stars",
                "1 star"
              ]
            }
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Keep reviews on/after this date (YYYY-MM-DD) or period (7 days, 2 weeks, 1 month). Newest-first pagination stops when older reviews appear."
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "Keep reviews on/before this date (YYYY-MM-DD)."
          },
          "reviewSearchQuery": {
            "title": "Search within reviews",
            "type": "string",
            "description": "Optional keyword passed to Yelp's review search (e.g. wait, parking, gluten)."
          },
          "language": {
            "title": "Review language",
            "type": "string",
            "description": "Language code for the Yelp review feed (e.g. en, de, fr, es, ja). Default en.",
            "default": "en"
          },
          "yelpDomain": {
            "title": "Yelp domain",
            "enum": [
              "www.yelp.com",
              "www.yelp.ca",
              "www.yelp.co.uk",
              "www.yelp.com.au",
              "www.yelp.de",
              "www.yelp.fr",
              "www.yelp.it",
              "www.yelp.es",
              "www.yelp.nl",
              "www.yelp.ie",
              "www.yelp.at",
              "www.yelp.ch",
              "www.yelp.be",
              "www.yelp.se",
              "www.yelp.no",
              "www.yelp.dk",
              "www.yelp.fi",
              "www.yelp.pl",
              "www.yelp.pt",
              "www.yelp.cz",
              "www.yelp.com.mx",
              "www.yelp.com.br",
              "www.yelp.co.jp",
              "www.yelp.com.sg",
              "www.yelp.com.hk",
              "www.yelp.com.tw",
              "www.yelp.com.ph",
              "www.yelp.com.tr",
              "www.yelp.com.ar",
              "www.yelp.co.nz",
              "www.yelp.cl"
            ],
            "type": "string",
            "description": "Regional Yelp host used when you pass aliases or IDs instead of full URLs.",
            "default": "www.yelp.com"
          },
          "includeOwnerReplies": {
            "title": "Parse owner replies",
            "type": "boolean",
            "description": "Always parse public owner responses when present. Kept for compatibility; replies are included in the review row.",
            "default": true
          },
          "onlyWithOwnerReply": {
            "title": "Only reviews with an owner reply",
            "type": "boolean",
            "description": "Keep reviews that have a public owner / manager response.",
            "default": false
          },
          "onlyUnanswered": {
            "title": "Only unanswered reviews",
            "type": "boolean",
            "description": "Keep reviews with no public owner reply. Overrides onlyWithOwnerReply when both are set.",
            "default": false
          },
          "includeReviewerProfile": {
            "title": "Include reviewer personal data",
            "type": "boolean",
            "description": "If off (default), reviewer name, location, counts, and photo are returned as null.",
            "default": false
          },
          "includeBusinessProfile": {
            "title": "Emit business profile row",
            "type": "boolean",
            "description": "In reviews mode, also push a business row (name, rating, review count, address).",
            "default": true
          },
          "includePhotos": {
            "title": "Include photo and video URLs",
            "type": "boolean",
            "description": "Keep photoUrls / videoUrls on review rows.",
            "default": true
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Parallel business workers. Keep moderate with residential proxies.",
            "default": 4
          },
          "requestDelaySecs": {
            "title": "Delay between requests (seconds)",
            "minimum": 0,
            "maximum": 5,
            "type": "number",
            "description": "Throttle between HTML/GraphQL calls on one worker.",
            "default": 0.6
          },
          "monitorStoreName": {
            "title": "Monitor KV store name",
            "type": "string",
            "description": "Named Key-Value Store for incremental state (per-business watermarks + seen review IDs).",
            "default": "yelp-monitor-store"
          },
          "monitorBaselineOnly": {
            "title": "Monitor baseline only",
            "type": "boolean",
            "description": "First run: seed KV fingerprints and review watermarks without emitting deltas / webhooks.",
            "default": false
          },
          "resetMonitorState": {
            "title": "Reset monitor state",
            "type": "boolean",
            "description": "Clear MONITOR_STATE in the named store before this run.",
            "default": false
          },
          "monitorFetchReviews": {
            "title": "Monitor: fetch new reviews",
            "type": "boolean",
            "description": "In monitor mode, paginate newest reviews until early-stop.",
            "default": true
          },
          "monitorMaxPages": {
            "title": "Monitor max pages",
            "minimum": 1,
            "maximum": 40,
            "type": "integer",
            "description": "Safety cap on review pages scanned per business in monitor mode.",
            "default": 5
          },
          "earlyStopAfterKnown": {
            "title": "Early-stop after N known reviews",
            "minimum": 1,
            "maximum": 40,
            "type": "integer",
            "description": "In monitor mode, stop pagination after this many consecutive already-seen or older reviews (newest-first).",
            "default": 5
          },
          "ratingDropThreshold": {
            "title": "Rating drop threshold",
            "minimum": 0,
            "type": "number",
            "description": "Emit rating_drop when the business star average falls by at least this amount.",
            "default": 0.1
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Slack / Discord / custom HTTPS endpoint for monitor alerts (JSON POST)."
          },
          "telegramToken": {
            "title": "Telegram Bot Token",
            "type": "string",
            "description": "Optional Telegram bot token for monitor alerts."
          },
          "telegramChatId": {
            "title": "Telegram Chat ID",
            "type": "string",
            "description": "Telegram chat/user ID for alerts (requires token)."
          },
          "notifyOnNewReviews": {
            "title": "Notify on new reviews",
            "type": "boolean",
            "description": "Send webhook/Telegram when a new review appears.",
            "default": true
          },
          "notifyOnNegativeReviewsOnly": {
            "title": "Negative reviews only (≤2★)",
            "type": "boolean",
            "description": "If enabled, new-review notifications fire only for 1–2 star reviews.",
            "default": false
          },
          "notifyOnUnansweredOnly": {
            "title": "Unanswered reviews only",
            "type": "boolean",
            "description": "If enabled, new-review notifications fire only when there is no owner reply.",
            "default": false
          },
          "notifyOnRatingChange": {
            "title": "Notify on rating change",
            "type": "boolean",
            "description": "Send webhook/Telegram when the business star average moves beyond the threshold.",
            "default": true
          },
          "notifyOnReviewCountChange": {
            "title": "Notify on review-count change",
            "type": "boolean",
            "description": "Send webhook/Telegram when the public review count changes.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Yelp blocks many datacenter IPs. Use Apify Residential proxies, preferably US.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "US"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}