{
  "openapi": "3.0.1",
  "info": {
    "title": "App Review Intelligence",
    "description": "Turn App Store and Google Play reviews into product insight: complaint topics, feature requests, release regressions, rating trends, developer reply stats and gaps vs competitors. Alerts on rating drops and crash spikes, optional AI summaries.",
    "version": "1.0",
    "x-build-id": "NmLu5SUO9OaZuGmwU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/codepal~app-review-intelligence/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-codepal-app-review-intelligence",
        "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/codepal~app-review-intelligence/runs": {
      "post": {
        "operationId": "runs-sync-codepal-app-review-intelligence",
        "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/codepal~app-review-intelligence/run-sync": {
      "post": {
        "operationId": "run-sync-codepal-app-review-intelligence",
        "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": {
          "apps": {
            "title": "Your apps",
            "type": "array",
            "description": "App Store or Google Play URLs, App Store ids (id389801252) or Play package names (com.whatsapp). Add both store versions of the same app as separate lines. Optional label: 'My App (Android) = com.example.app'.",
            "items": {
              "type": "string"
            }
          },
          "competitorApps": {
            "title": "Competitor apps",
            "type": "array",
            "description": "Same formats. Used for the side-by-side comparison and topic gaps.",
            "items": {
              "type": "string"
            }
          },
          "appStoreCountries": {
            "title": "App Store countries",
            "type": "array",
            "description": "Two-letter country codes (us, gb, ke, ng, za…). App Store reviews are per country; the latest ~500 per country are available.",
            "default": [
              "us"
            ],
            "items": {
              "type": "string"
            }
          },
          "playCountry": {
            "title": "Google Play country",
            "type": "string",
            "description": "Two-letter country code (used when the URL has no gl= parameter).",
            "default": "us"
          },
          "playLanguage": {
            "title": "Google Play review language",
            "type": "string",
            "description": "Two-letter language code (en, fr, sw, pt…). Google Play returns reviews written in this language.",
            "default": "en"
          },
          "maxReviewsPerApp": {
            "title": "Max reviews per app",
            "minimum": 10,
            "maximum": 20000,
            "type": "integer",
            "description": "Newest reviews first.",
            "default": 500
          },
          "daysBack": {
            "title": "Days back",
            "minimum": 0,
            "type": "integer",
            "description": "Only reviews from the last N days. 0 = no limit.",
            "default": 90
          },
          "recentDays": {
            "title": "'Recent' window (days)",
            "minimum": 3,
            "maximum": 90,
            "type": "integer",
            "description": "Recent reviews are compared with older ones to spot rating drops and complaint spikes.",
            "default": 14
          },
          "outputReviews": {
            "title": "Save individual reviews",
            "type": "boolean",
            "description": "Add every classified review to the dataset (in addition to app summaries).",
            "default": true
          },
          "onlyNewReviews": {
            "title": "Only new reviews in dataset",
            "type": "boolean",
            "description": "For scheduled runs: save only reviews not seen by this monitor before. Analysis still uses the whole window.",
            "default": false
          },
          "includeReviewerNames": {
            "title": "Include reviewer names",
            "type": "boolean",
            "description": "Off by default (personal data). Turn on only if you need it, e.g. to match support tickets.",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Runs with the same name remember seen reviews and previous ratings (alerts, new-review counts, and you are only charged once per review).",
            "default": "default"
          },
          "alertRatingDrop": {
            "title": "Alert: rating drop (stars)",
            "minimum": 0.05,
            "type": "number",
            "description": "Alert when the recent average falls this much below the earlier average.",
            "default": 0.3
          },
          "alertTopicSpikePts": {
            "title": "Alert: complaint spike (points)",
            "minimum": 2,
            "type": "integer",
            "description": "Alert when a complaint topic's share of recent reviews rises this many percentage points.",
            "default": 10
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "HTTPS URL that receives alerts (Slack and Discord formatted automatically; JSON for Zapier, Make, n8n)."
          },
          "webhookSecret": {
            "title": "Webhook secret",
            "type": "string",
            "description": "Optional. Adds an x-signature-256 HMAC header."
          },
          "enableAi": {
            "title": "AI insights",
            "type": "boolean",
            "description": "Per-app summary, issues with likely causes and fixes, feature priorities and a reply template, plus a competitor positioning summary. Uses your own API key; reviewer names are never sent.",
            "default": false
          },
          "aiBaseUrl": {
            "title": "AI API base URL",
            "type": "string",
            "description": "Any OpenAI-compatible API: OpenAI, OpenRouter (https://openrouter.ai/api/v1), Groq, Together, DeepSeek, a local Ollama…",
            "default": "https://api.openai.com/v1"
          },
          "aiModel": {
            "title": "AI model",
            "type": "string",
            "description": "Model name at your provider.",
            "default": "gpt-4o-mini"
          },
          "aiApiKey": {
            "title": "AI API key",
            "type": "string",
            "description": "Stored encrypted. You pay your provider directly for tokens."
          },
          "productContext": {
            "title": "Product context",
            "type": "string",
            "description": "Optional: what the app does, recent releases, known issues. Helps the AI give better causes and fixes."
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Turn on Apify Proxy if Google Play starts refusing requests (large or frequent runs).",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}