{
  "openapi": "3.0.1",
  "info": {
    "title": "Social Comment Classifier — buying intent & questions · $0.5/1k",
    "description": "Classify Instagram, TikTok, Facebook, YouTube comments: buying intent, sentiment — Instagram comments sentiment and TikTok comments analyzer. Use for comments; for reviews use leoworks/korean-review-classifier. datasetId (text auto-detected) or texts. ~100 comments/4 s, pay per comment.",
    "version": "0.2",
    "x-build-id": "Zm8xY22BiR0uFuZqU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/leoworks~social-comment-classifier/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-leoworks-social-comment-classifier",
        "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/leoworks~social-comment-classifier/runs": {
      "post": {
        "operationId": "runs-sync-leoworks-social-comment-classifier",
        "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/leoworks~social-comment-classifier/run-sync": {
      "post": {
        "operationId": "run-sync-leoworks-social-comment-classifier",
        "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": {
          "datasetId": {
            "title": "Comments dataset",
            "type": "string",
            "description": "An Apify dataset containing comments — for example the output of an Instagram, TikTok, Facebook or YouTube comment scraper. Use this OR “Comment texts”."
          },
          "texts": {
            "title": "Comment texts",
            "type": "array",
            "description": "Paste comment texts directly (one per line). Use this OR “Comments dataset”.",
            "items": {
              "type": "string"
            }
          },
          "customLabels": {
            "title": "Custom labels",
            "type": "array",
            "description": "Up to 10 extra yes/no labels (each up to 200 characters) written in plain language, e.g. “mentions shipping to Canada”, “asks about a discount code”. Each gets a probability.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "commentsNewerThan": {
            "title": "Only comments newer than",
            "type": "string",
            "description": "Classify only comments posted after this date — a date like `2026-10-01` or a period like `7 days`, `4 weeks`, `3 months`. Relative dates such as \"3 days ago\" (YouTube) are counted back from the run time. Leave empty for all."
          },
          "minLikes": {
            "title": "Only comments with at least N likes",
            "minimum": 0,
            "type": "integer",
            "description": "0 = all. Comments without a like count are kept.",
            "default": 0
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 0,
            "type": "integer",
            "description": "Classify at most this many comments per post or video, in dataset order. 0 = no limit.",
            "default": 0
          },
          "skipReplies": {
            "title": "Skip replies",
            "type": "boolean",
            "description": "Classify only top-level comments, not replies to other comments.",
            "default": false
          },
          "skipOwnerReplies": {
            "title": "Skip the post owner's own comments",
            "type": "boolean",
            "description": "Skip comments flagged by the scraper as written by the channel owner or creator (e.g. YouTube `authorIsChannelOwner`), plus any account listed in **Exclude accounts**.",
            "default": true
          },
          "excludeAuthors": {
            "title": "Exclude accounts",
            "type": "array",
            "description": "Usernames whose comments are skipped — usually your own brand or support accounts (with or without @).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "skipEmojiOnly": {
            "title": "Skip emoji-only comments",
            "type": "boolean",
            "description": "Skip comments with no letters or digits (\"🔥🔥\", \"❤️\"). They are mostly praise; skipping them saves cost.",
            "default": false
          },
          "maxItems": {
            "title": "Max comments",
            "minimum": 0,
            "type": "integer",
            "description": "Classify at most this many comments (0 = all).",
            "default": 0
          },
          "includeAuthor": {
            "title": "Include commenter usernames",
            "type": "boolean",
            "description": "Add the commenter's public username to each row and save BUYERS.csv (one row per commenter with purchase intent). Off by default. Usernames are only copied from your dataset, never sent for classification. Use them in line with the platform's terms and privacy law.",
            "default": false
          },
          "expandNestedReplies": {
            "title": "Classify nested replies",
            "type": "boolean",
            "description": "Datasets that keep replies inside a comment (Instagram `replies`, Facebook `comments`) or comments inside a post (Instagram Scraper `latestComments`) are flattened to one row per comment.",
            "default": true
          },
          "textField": {
            "title": "Text field",
            "type": "string",
            "description": "Field holding the comment text. Leave empty to auto-detect (text, comment, content, body, …)."
          },
          "contextField": {
            "title": "Post title field",
            "type": "string",
            "description": "Field holding the title or caption of the post the comment was written under (helps with short comments like “link?”). Leave empty to auto-detect (postTitle, title, …)."
          },
          "idFields": {
            "title": "ID fields to keep",
            "type": "array",
            "description": "Fields copied unchanged from each input item to the output so you can join results back (e.g. id, cid, postUrl). Leave empty to auto-pick the comment ID and post URL.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "labelThreshold": {
            "title": "Label threshold",
            "minimum": 0.05,
            "maximum": 0.95,
            "type": "number",
            "description": "Minimum probability (0–1) for the needs-reply flag and custom labels to be marked as matched. Raise it for fewer, surer matches.",
            "default": 0.5
          },
          "outputMode": {
            "title": "Output mode",
            "enum": [
              "full",
              "minimal"
            ],
            "type": "string",
            "description": "Minimal mode returns only label keys — smaller and easier to aggregate.",
            "default": "full"
          },
          "summaryGroupField": {
            "title": "Summary: group by field",
            "type": "string",
            "description": "Field in your dataset that identifies the post (e.g. `postUrl`, `videoWebUrl`, `videoId`). The run then saves a REPORT record with, per post: comment type mix, sentiment shares, share needing a reply and example purchase-intent, question, complaint and request comments. Leave empty to detect it automatically (overall summary only if none is found). No extra charge."
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 40,
            "type": "integer",
            "description": "Comments classified in parallel.",
            "default": 10
          },
          "healthCheck": {
            "title": "Health check mode (internal)",
            "type": "boolean",
            "description": "Internal: fail the run when results look degraded (used by the developer's scheduled checks).",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}