{
  "openapi": "3.0.1",
  "info": {
    "title": "Yelp Reviews Scraper - Sentiment, Topics, Competitor Delta",
    "description": "Bulk Yelp review scraper with per-review sentiment, topic clusters (food, service, wait, value, parking), responder tracking, 12-month trend and competitor delta. LLM-ready JSON for reputation, local SEO and chain ops teams.",
    "version": "0.1",
    "x-build-id": "RniBGkOpzy6zBPkCJ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/seibs.co~yelp-reviews-pro/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-seibs.co-yelp-reviews-pro",
        "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/seibs.co~yelp-reviews-pro/runs": {
      "post": {
        "operationId": "runs-sync-seibs.co-yelp-reviews-pro",
        "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/seibs.co~yelp-reviews-pro/run-sync": {
      "post": {
        "operationId": "run-sync-seibs.co-yelp-reviews-pro",
        "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",
          "business_inputs"
        ],
        "properties": {
          "mode": {
            "title": "Run mode",
            "enum": [
              "batch_analysis",
              "competitor_delta",
              "single_business_deep"
            ],
            "type": "string",
            "description": "batch_analysis = analyze N businesses independently. competitor_delta = pairwise side-by-side comparison of 2-5 businesses. single_business_deep = max-depth on one business (largest review pull, full per-review enrichment).",
            "default": "batch_analysis"
          },
          "business_inputs": {
            "title": "Businesses (Yelp URLs or business IDs)",
            "maxItems": 50,
            "type": "array",
            "description": "Up to 50 Yelp business URLs (https://www.yelp.com/biz/<slug>) or business IDs (the slug after /biz/). Mixed types accepted.",
            "items": {
              "type": "string"
            }
          },
          "max_reviews_per_business": {
            "title": "Max reviews per business",
            "minimum": 10,
            "maximum": 500,
            "type": "integer",
            "description": "Cap on how many reviews to pull per business from the upstream scraper. Higher = better stats but slower and more expensive upstream cost. Hard cap of 500 to prevent runaway cost.",
            "default": 100
          },
          "review_sort": {
            "title": "Review sort order",
            "enum": [
              "newest",
              "oldest",
              "rating_high_low",
              "rating_low_high",
              "elites_first",
              "yelp_default"
            ],
            "type": "string",
            "description": "How the upstream actor should sort reviews before we take the first N. 'newest' is best for trend analysis; 'rating_low_high' is best for surfacing complaints fast; 'elites_first' prioritizes high-credibility reviewers.",
            "default": "newest"
          },
          "language": {
            "title": "Review language",
            "enum": [
              "en",
              "es",
              "fr",
              "de",
              "it",
              "pt",
              "ja",
              "ko",
              "zh"
            ],
            "type": "string",
            "description": "Language code for reviews. Sentiment and topic lexicons currently work best for English; other languages still return raw reviews but may have lower analysis accuracy.",
            "default": "en"
          },
          "include_owner_responses": {
            "title": "Include owner responses",
            "type": "boolean",
            "description": "When true, captures business-owner replies on each review and computes responder metrics (response rate, time-to-response, owner reply sentiment). Strong reputation-management signal.",
            "default": true
          },
          "include_sentiment": {
            "title": "Per-review sentiment analysis",
            "type": "boolean",
            "description": "Lexicon-based sentiment scoring (positive / neutral / negative) with negation handling. No API key needed - runs entirely in-actor.",
            "default": true
          },
          "include_topic_clustering": {
            "title": "Topic clustering per review",
            "type": "boolean",
            "description": "Detects topics in each review using keyword sets: food_quality, service, wait_time, cleanliness, value_pricing, ambience, staff_friendliness, parking, accessibility.",
            "default": true
          },
          "include_time_series": {
            "title": "Time-series breakdown",
            "type": "boolean",
            "description": "Monthly review count + average rating for the last 12 months. Determines trend (improving / flat / declining).",
            "default": true
          },
          "output_format": {
            "title": "Output format",
            "enum": [
              "json",
              "llm_ready",
              "csv_friendly"
            ],
            "type": "string",
            "description": "json = full structured business + reviews records. llm_ready = adds a markdown summary block per business optimized for LLM prompt injection. csv_friendly = flat one-row-per-review (no nested arrays).",
            "default": "json"
          },
          "competitor_delta_max_pairs": {
            "title": "Competitor delta max pairs",
            "minimum": 2,
            "maximum": 10,
            "type": "integer",
            "description": "Only used in competitor_delta mode. Caps the number of pairwise comparisons emitted. With 5 businesses there are 10 pairs; this caps that to the most-divergent N.",
            "default": 5
          },
          "apify_proxy_groups": {
            "title": "Proxy groups (forwarded to upstream)",
            "type": "array",
            "description": "Proxy groups passed through to the upstream agents/yelp-reviews actor. RESIDENTIAL is mandatory for Yelp - their anti-bot blocks datacenter IPs aggressively.",
            "default": [
              "RESIDENTIAL"
            ],
            "items": {
              "type": "string"
            }
          },
          "concurrency": {
            "title": "Per-business concurrency",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Number of businesses processed in parallel. Each business triggers one upstream actor call; raise carefully.",
            "default": 4
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}