{
  "openapi": "3.0.1",
  "info": {
    "title": "G2 & Capterra Buying-Intent & Reviews Scraper (Clay + Dedup)",
    "description": "Unified G2 + Capterra B2B Buying-Intent & Review Scraper in 128 MB RAM (zero Chromium). Includes live Capterra auto-resolution, cross-platform G2/Capterra/GetApp dedup, deterministic churnIntentScore (0-100), pain tags, competitor battlecards, incremental deltas & Clay hooks.",
    "version": "1.0",
    "x-build-id": "zonEOLQAt6etaZbcD"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/galhali~g2-capterra-buying-intent-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-galhali-g2-capterra-buying-intent-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/galhali~g2-capterra-buying-intent-scraper/runs": {
      "post": {
        "operationId": "runs-sync-galhali-g2-capterra-buying-intent-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/galhali~g2-capterra-buying-intent-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-galhali-g2-capterra-buying-intent-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": {
          "products": {
            "title": "Products (Names, Slugs, or URLs)",
            "type": "array",
            "description": "List of SaaS names (automatically resolved to both G2 & Capterra review URLs — works even for unlisted tools via live Capterra search fallback) or direct review URLs.",
            "default": [
              "Slack"
            ],
            "items": {
              "type": "string"
            }
          },
          "productUrls": {
            "title": "Direct G2 / Capterra URLs",
            "type": "array",
            "description": "Explicit G2 (https://www.g2.com/products/.../reviews) or Capterra (https://www.capterra.com/p/.../reviews/) URLs.",
            "items": {
              "type": "string"
            }
          },
          "platforms": {
            "title": "Platforms",
            "type": "array",
            "description": "Which review platforms to query when product names are supplied.",
            "items": {
              "type": "string",
              "enum": [
                "g2",
                "capterra"
              ],
              "enumTitles": [
                "G2.com",
                "Capterra.com"
              ]
            },
            "default": [
              "g2",
              "capterra"
            ]
          },
          "maxReviewsPerProduct": {
            "title": "Max Reviews Per Product / Platform",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum reviews returned per product per platform (set to 10-500).",
            "default": 10
          },
          "sortBy": {
            "title": "Sort Order",
            "enum": [
              "MOST_RECENT",
              "MOST_HELPFUL",
              "HIGHEST_RATED",
              "LOWEST_RATED"
            ],
            "type": "string",
            "description": "Sort reviews chronologically or by helpfulness/rating.",
            "default": "MOST_RECENT"
          },
          "minRating": {
            "title": "Minimum Star Rating (1-5)",
            "minimum": 1,
            "maximum": 5,
            "type": "number",
            "description": "Keep only reviews with overall rating >= minRating.",
            "default": 1
          },
          "maxRating": {
            "title": "Maximum Star Rating (1-5)",
            "minimum": 1,
            "maximum": 5,
            "type": "number",
            "description": "Keep only reviews with overall rating <= maxRating (set to 3 to capture dissatisfied buyers & switching intent).",
            "default": 5
          },
          "lookbackDays": {
            "title": "Lookback Window (Days)",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Only return reviews published within the last N days (e.g. 30 or 90). Stops pagination automatically once older reviews are reached."
          },
          "fromDate": {
            "title": "Published After (YYYY-MM-DD)",
            "type": "string",
            "description": "Explicit ISO start date (YYYY-MM-DD). Overrides lookbackDays if provided."
          },
          "companySegments": {
            "title": "Company Segments Filter",
            "type": "array",
            "description": "Filter by reviewer company size tier (Small-Business, Mid-Market, Enterprise). On G2, automatically applies native segment filters.",
            "items": {
              "type": "string"
            }
          },
          "includeKeywords": {
            "title": "Intent Keywords (Include)",
            "type": "array",
            "description": "Keep only reviews containing any of these terms (e.g. ['pricing', 'support', 'slow', 'cancel', 'alternative']).",
            "items": {
              "type": "string"
            }
          },
          "deduplicateSyndicatedReviews": {
            "title": "Deduplicate G2 / Gartner Syndicated Reviews",
            "type": "boolean",
            "description": "Detects and drops duplicate reviews mirrored across G2, Capterra, GetApp, and Software Advice.",
            "default": true
          },
          "emitBattlecardSummary": {
            "title": "Include Battlecard & Churn Velocity Summary Rows",
            "type": "boolean",
            "description": "Appends a BATTLECARD_SUMMARY record per product with top pain tags, detractor ratio, 30d vs 90d churn spike velocity, and competitor migration graph.",
            "default": true
          },
          "onlyNewReviews": {
            "title": "Incremental Monitoring (Only New Since Last Run)",
            "type": "boolean",
            "description": "Persists seen review IDs per product in named Key-Value Store 'g2-capterra-intent-state' so scheduled runs return strictly new reviews.",
            "default": false
          },
          "cloudflareCacheWorkerUrl": {
            "title": "Optional External Delta Cache Worker URL",
            "type": "string",
            "description": "Optional Cloudflare Worker endpoint for shared cross-run delta time-series review caching."
          },
          "maxConcurrency": {
            "title": "Max Parallel Requests",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Concurrent UNBLOCKER pagination requests (1-8 recommended to protect 128 MB heap).",
            "default": 4
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Defaults to Apify UNBLOCKER group (handles DataDome on G2 & Cloudflare on Capterra automatically without launching Chrome).",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "UNBLOCKER"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}