{
  "openapi": "3.0.1",
  "info": {
    "title": "ReviewForge — Google Maps Reviews & Reputation Monitor",
    "description": "Monitoring-first Google Maps reviews actor: tells you what changed since last run — new reviews, rating drops, negative reviews, and unanswered reviews — instead of a one-shot bulk dump. Cross-run state + alerts. PAY_PER_EVENT.",
    "version": "0.1",
    "x-build-id": "SBiCM4NSg8zFb48zM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/actorify~reviewforge/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-actorify-reviewforge",
        "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/actorify~reviewforge/runs": {
      "post": {
        "operationId": "runs-sync-actorify-reviewforge",
        "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/actorify~reviewforge/run-sync": {
      "post": {
        "operationId": "run-sync-actorify-reviewforge",
        "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": {
          "startUrls": {
            "title": "Start URLs / place IDs",
            "type": "array",
            "description": "Google Maps place URLs or place_id values (e.g. ChIJN1t_tDeuEmsRU...). Required unless searchQueries is given.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "e.g. 'dentists in Bandung'. Resolved to places (capped by maxPlaces). Alternative entry to startUrls.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "maxPlaces": {
            "title": "Maximum places per run",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum distinct places processed per run.",
            "default": 10
          },
          "reviewsPerPlace": {
            "title": "Reviews per place",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Reviews fetched per place per run (newest-first).",
            "default": 100
          },
          "lookbackDays": {
            "title": "First-run lookback (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "P1 backfill guard (§6.4 / §11A·P1). On a place's FIRST run every fetched review is 'new'; this bounds the blast radius. Native fetch support = reviewsStartDate = now − lookbackDays. Default 30.",
            "default": 30
          },
          "enableDelta": {
            "title": "Enable cross-run delta",
            "type": "boolean",
            "description": "Compare fetched reviews against the last run's stored state (the monitoring core).",
            "default": true
          },
          "alertOnNewReviews": {
            "title": "Alert on new reviews",
            "type": "boolean",
            "description": "Emit an alert for every review new since the last run.",
            "default": true
          },
          "negativeReviewMaxRating": {
            "title": "Negative-review max rating",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Alert when a new review's rating is at or below this (1–5).",
            "default": 3
          },
          "ratingDropThreshold": {
            "title": "Rating-drop threshold",
            "minimum": 0,
            "maximum": 5,
            "type": "number",
            "description": "Alert if a place's rating drops by at least this vs the last snapshot.",
            "default": 0.3
          },
          "trackUnanswered": {
            "title": "Track unanswered reviews",
            "type": "boolean",
            "description": "Flag new reviews that have no owner response.",
            "default": true
          },
          "languages": {
            "title": "Language filter",
            "type": "array",
            "description": "Optional — only keep reviews in these languages (e.g. ['en','id']). Empty = all.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "sentiment": {
            "title": "Sentiment method",
            "enum": [
              "none",
              "keyword",
              "api"
            ],
            "type": "string",
            "description": "MVP ships the bilingual keyword lexicon; 'api' is a v2 stub.",
            "default": "keyword"
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "POST each emitted alert to this URL if set (email/SMS deferred to v2 — wire Make/Zapier).",
            "default": ""
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Residential proxies are recommended for Google (§4, §9). Standing default pre-fills the Apify residential pool."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}