{
  "openapi": "3.0.1",
  "info": {
    "title": "App Reviews & Sentiment — Google Play + App Store",
    "description": "Structured app metadata, reviews and an optional AI summary (top complaints, feature requests, sentiment) from the Apple App Store via Apple's public endpoints (Google Play phase 2). Use for competitive intelligence or a sentiment read without pulling raw reviews into your context.",
    "version": "0.1",
    "x-build-id": "aj8ggbi0ejBKlVbap"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/teamkamkod~app-store-intel/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-teamkamkod-app-store-intel",
        "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/teamkamkod~app-store-intel/runs": {
      "post": {
        "operationId": "runs-sync-teamkamkod-app-store-intel",
        "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/teamkamkod~app-store-intel/run-sync": {
      "post": {
        "operationId": "run-sync-teamkamkod-app-store-intel",
        "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"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "direct",
              "search"
            ],
            "type": "string",
            "description": "direct = you already know the app ids. search = discover apps by keyword first (App Store), then fetch their reviews."
          },
          "apps": {
            "title": "Apps (mode direct)",
            "type": "array",
            "description": "Apps to analyze. Each entry: {\"platform\":\"app_store\",\"appId\":\"324684580\",\"country\":\"fr\"}. platform google_play is accepted but returns a 'beta' status row until phase 2.",
            "items": {
              "type": "object",
              "properties": {
                "platform": {
                  "title": "Platform",
                  "description": "Store to query",
                  "type": "string",
                  "editor": "select",
                  "enum": [
                    "google_play",
                    "app_store"
                  ]
                },
                "appId": {
                  "title": "App id",
                  "description": "App Store numeric id (e.g. 324684580)",
                  "type": "string",
                  "editor": "textfield"
                },
                "country": {
                  "title": "Country store",
                  "description": "ISO 3166-1 alpha-2",
                  "type": "string",
                  "editor": "textfield",
                  "default": "fr"
                },
                "language": {
                  "title": "Language",
                  "description": "Review language when available",
                  "type": "string",
                  "editor": "textfield",
                  "default": "fr"
                }
              },
              "required": [
                "platform",
                "appId"
              ]
            }
          },
          "country": {
            "title": "Country store (default)",
            "type": "string",
            "description": "App Store country (ISO 3166-1 alpha-2), used for search and as default for apps without country. Supported at launch: fr, us, uk, de, es."
          },
          "searchTerm": {
            "title": "Search term (mode search)",
            "type": "string",
            "description": "Keyword to discover apps, e.g. \"CRM mobile app\". Returns the top apps from the App Store before fetching their reviews."
          },
          "searchPlatforms": {
            "title": "Stores to search (mode search)",
            "type": "array",
            "description": "Values: app_store (live) or google_play (beta — returns a status row until phase 2).",
            "items": {
              "type": "string"
            }
          },
          "maxAppsFromSearch": {
            "title": "Max apps from search",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many top results to take per store in search mode (1-20).",
            "default": 5
          },
          "maxReviewsPerApp": {
            "title": "Max reviews per app",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "0 = metadata only. Apple's public RSS caps at ~500 reviews per app.",
            "default": 200
          },
          "reviewsSort": {
            "title": "Review sort",
            "enum": [
              "newest",
              "most_relevant",
              "rating_low",
              "rating_high"
            ],
            "type": "string",
            "description": "newest/most_relevant come from Apple RSS; rating sorts are applied client-side to fetched reviews."
          },
          "reviewsSince": {
            "title": "Only reviews since (optional)",
            "type": "string",
            "description": "ISO 8601 date (YYYY-MM-DD). Reviews posted after this date only."
          },
          "includeSummary": {
            "title": "Generate AI summary (extra)",
            "type": "boolean",
            "description": "Adds a structured per-app summary (recurring complaints, feature requests, sentiment score). Requires ANTHROPIC_API_KEY secret. Charged separately.",
            "default": false
          },
          "summaryFocus": {
            "title": "Summary focus",
            "enum": [
              "all",
              "bugs_and_complaints",
              "feature_requests",
              "sentiment_only"
            ],
            "type": "string",
            "description": "Which sections to extract: all, complaints only, feature requests only, or sentiment score only (reduces LLM cost)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}