{
  "openapi": "3.0.1",
  "info": {
    "title": "G2 Reviews Scraper — SaaS Ratings, Switching & Monitor",
    "description": "Scrape G2 product reviews into JSON: star ratings, pros/cons, switching, reviewer role and company size. Monitor new reviews with webhooks. A G2 API alternative for Python, Node.js, and MCP.",
    "version": "1.0",
    "x-build-id": "D6maWaQkRVzo7tDDA"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawloop~g2-reviews-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawloop-g2-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~g2-reviews-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawloop-g2-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~g2-reviews-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawloop-g2-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",
              "products",
              "monitor"
            ],
            "type": "string",
            "description": "reviews = product reviews (and optional product row); products = search/category catalog; monitor = incremental new reviews + rating deltas.",
            "default": "reviews"
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "G2 product, reviews, seller, category, or search URLs. Bare slugs such as slack are also accepted.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "productSlugs": {
            "title": "Product slugs or URLs",
            "type": "array",
            "description": "G2 product slugs (slack) or full product/review URLs. Used in reviews and monitor modes.",
            "items": {
              "type": "string"
            }
          },
          "searchQuery": {
            "title": "Product search query",
            "type": "string",
            "description": "Keyword for G2 product search (products mode). Example: CRM, project management."
          },
          "categorySlug": {
            "title": "Category slug",
            "type": "string",
            "description": "G2 category slug (e.g. crm, project-management). Used in products mode."
          },
          "maxReviews": {
            "title": "Max reviews per product",
            "minimum": 0,
            "type": "integer",
            "description": "Cap reviews collected per product. 0 = until pages run out (still bounded by maxPages).",
            "default": 100
          },
          "maxProducts": {
            "title": "Max products",
            "minimum": 0,
            "type": "integer",
            "description": "Cap product catalog rows in products/search/category mode.",
            "default": 25
          },
          "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 pages",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Safety cap on review or catalog pages per target.",
            "default": 50
          },
          "sortOrder": {
            "title": "Review sort",
            "enum": [
              "newest",
              "helpful",
              "highest",
              "lowest"
            ],
            "type": "string",
            "description": "G2 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"
            }
          },
          "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."
          },
          "reviewSearchQuery": {
            "title": "Search within review text",
            "type": "string",
            "description": "Keep reviews whose title/body/pros/cons contain all of these words (AND)."
          },
          "verifiedOnly": {
            "title": "Verified reviewers only",
            "type": "boolean",
            "description": "Keep reviews tagged Validated Reviewer or Verified Current User.",
            "default": false
          },
          "includeProductProfile": {
            "title": "Emit product profile row",
            "type": "boolean",
            "description": "In reviews mode, also push a product row (rating, review count, categories).",
            "default": true
          },
          "includeAlternatives": {
            "title": "Include G2 alternatives",
            "type": "boolean",
            "description": "Also scrape the product alternatives / competitors listing.",
            "default": false
          },
          "compact": {
            "title": "Compact rows",
            "type": "boolean",
            "description": "Drop markdownContent and long optional fields (token-efficient for MCP / LLM pipelines).",
            "default": false
          },
          "monitorStoreName": {
            "title": "Monitor KV store name",
            "type": "string",
            "description": "Named Key-Value Store for incremental watermarks (per-product seen review IDs).",
            "default": "g2-reviews-monitor"
          },
          "monitorBaselineOnly": {
            "title": "Monitor baseline only",
            "type": "boolean",
            "description": "First run: seed KV fingerprints and review IDs 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
          },
          "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 reviews (newest-first).",
            "default": 5
          },
          "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 (monitor mode).",
            "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
          },
          "notifyOnRatingChange": {
            "title": "Notify on rating / count change",
            "type": "boolean",
            "description": "Send webhook/Telegram when the product fingerprint (stars or review count) changes.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "DataDome blocks datacenter IPs. Use Apify Residential proxies (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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}