{
  "openapi": "3.0.1",
  "info": {
    "title": "🗂️ Review Theme Clusterer - Themes From Reviews & Tickets",
    "description": "⚡ Turn thousands of reviews, support tickets or survey answers into RANKED THEMES, not just a sentiment score. ✅ TF-IDF phrase weighting, blocking-based similarity clustering with no fixed k, top-distinguishing-term labels, volume/share/rating per theme, and rising/falling trend flags over time.",
    "version": "1.0",
    "x-build-id": "8v5mGg6KDbVKYz9fB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/that_red_bird~review-theme-clusterer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-that_red_bird-review-theme-clusterer",
        "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/that_red_bird~review-theme-clusterer/runs": {
      "post": {
        "operationId": "runs-sync-that_red_bird-review-theme-clusterer",
        "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/that_red_bird~review-theme-clusterer/run-sync": {
      "post": {
        "operationId": "run-sync-that_red_bird-review-theme-clusterer",
        "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": {
          "reviews": {
            "title": "Reviews",
            "type": "array",
            "description": "The reviews/tickets/answers to cluster, as an array of flat objects. Combine freely with sourceDatasetIds.",
            "default": [
              {
                "text": "The battery life is terrible, it drains within a few hours.",
                "rating": 1,
                "date": "2026-01-05"
              },
              {
                "text": "Battery life is really bad, doesn't last the whole day.",
                "rating": 2,
                "date": "2026-02-10"
              },
              {
                "text": "Customer service was unhelpful and rude when I called support.",
                "rating": 2,
                "date": "2026-01-12"
              },
              {
                "text": "Support staff were dismissive during my call, never resolved it.",
                "rating": 1,
                "date": "2026-03-02"
              },
              {
                "text": "Great value for the price, very happy with this purchase.",
                "rating": 5,
                "date": "2026-02-20"
              }
            ]
          },
          "sourceDatasetIds": {
            "title": "Source dataset IDs",
            "type": "array",
            "description": "Apify dataset IDs to pull reviews from. Rows are merged with any inline reviews before clustering.",
            "items": {
              "type": "string"
            }
          },
          "textField": {
            "title": "Review text field",
            "type": "string",
            "description": "Field holding the free text to cluster. Leave empty to auto-detect from common names (text, review, comment, feedback, body, description) or, failing that, the longest string field."
          },
          "ratingField": {
            "title": "Rating field",
            "type": "string",
            "description": "Field holding a numeric rating/score. Leave empty to auto-detect (rating, score, stars). Used to compute average rating per theme; omitted entirely if none is found."
          },
          "dateField": {
            "title": "Date field",
            "type": "string",
            "description": "Field holding the review/ticket date. Leave empty to auto-detect (date, created, timestamp, posted). Enables per-period volume and the rising/falling trend flag; skipped entirely if none is found."
          },
          "ngramSize": {
            "title": "Max phrase length (n-gram)",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Longest candidate phrase to consider, in words. 1 = single words only, 3 = up to trigrams like \"battery life drains\". Phrases never cross a stopword boundary.",
            "default": 3
          },
          "minTermDocFrequency": {
            "title": "Minimum term document frequency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "A candidate phrase must appear in at least this many reviews to enter the vocabulary. Higher = less noise from one-off phrasing, but risks losing small real themes. Auto-lowered for small inputs.",
            "default": 2
          },
          "similarityThreshold": {
            "title": "Similarity threshold (0-100)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Minimum cosine similarity (on TF-IDF vectors) for two reviews to end up in the same theme, and for two themes to merge. Higher = tighter, more numerous themes; lower = broader, fewer themes. Expressed 0-100; 30 means 0.30.",
            "default": 30
          },
          "blockingTermsPerReview": {
            "title": "Blocking terms per review",
            "minimum": 2,
            "maximum": 30,
            "type": "integer",
            "description": "How many of a review's own highest-weight terms are used as inverted-index bucket keys during candidate generation. Higher finds more true matches but compares more pairs; this is what keeps clustering off O(n^2).",
            "default": 8
          },
          "maxBucketSize": {
            "title": "Max bucket size",
            "minimum": 10,
            "maximum": 20000,
            "type": "integer",
            "description": "Blocking buckets larger than this are skipped, so a near-universal term (e.g. \"product\" in a product-review corpus) can't reintroduce an O(n^2) comparison.",
            "default": 500
          },
          "minThemeSize": {
            "title": "Minimum theme size",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Clusters smaller than this are not reported as their own theme; they are rolled into a single \"other\" summary row instead of being silently dropped.",
            "default": 2
          },
          "labelTermCount": {
            "title": "Label term count",
            "minimum": 1,
            "maximum": 15,
            "type": "integer",
            "description": "How many top distinguishing terms (by TF-IDF weight, not raw frequency) to include in each theme's label.",
            "default": 5
          },
          "exampleQuoteCount": {
            "title": "Example quote count",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "How many representative example reviews (closest to the theme's centroid) to include per theme.",
            "default": 3
          },
          "period": {
            "title": "Trend period",
            "enum": [
              "week",
              "month"
            ],
            "type": "string",
            "description": "Bucket size used for the per-period volume timeline and the rising/falling trend flag, when a date field is available.",
            "default": "month"
          },
          "includeReviewAssignments": {
            "title": "Include per-review theme assignments",
            "type": "boolean",
            "description": "Emit one extra row per input review naming the theme it was assigned to (or \"other\"). Useful for auditing but roughly doubles output size on large inputs.",
            "default": false
          },
          "includeOtherTheme": {
            "title": "Include the \"other\" summary row",
            "type": "boolean",
            "description": "Emit one aggregate row summarising reviews that fell into clusters smaller than minThemeSize, instead of silently omitting them from the output entirely.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}