{
  "openapi": "3.0.1",
  "info": {
    "title": "Comment & Review Sentiment Analysis",
    "description": "Add sentiment, language, complaint signals and NEW/CHANGED/UNCHANGED monitoring to comments from any Apify Dataset or pasted text. Local models in 6 languages, no AI API, hash-only monitoring memory.",
    "version": "0.1",
    "x-build-id": "z9iYoNeQjhlp80TDx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kazkn~social-media-sentiment-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kazkn-social-media-sentiment-monitor",
        "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/kazkn~social-media-sentiment-monitor/runs": {
      "post": {
        "operationId": "runs-sync-kazkn-social-media-sentiment-monitor",
        "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/kazkn~social-media-sentiment-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-kazkn-social-media-sentiment-monitor",
        "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": {
          "texts": {
            "title": "Inline comments",
            "type": "array",
            "description": "Paste your comments as a JSON list, one object per comment with an id and a text. Ignored when an Apify Dataset ID is filled in.",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "datasetId": {
            "title": "Apify Dataset ID",
            "type": "string",
            "description": "To analyze the results of a comments or reviews scraper, paste the ID of its run's dataset (Storage tab of the run). When filled in, the inline comments are ignored."
          },
          "textField": {
            "title": "Text field",
            "type": "string",
            "description": "Name of the field that holds each comment, such as text, comment, or review.body for a nested field.",
            "default": "text"
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "analyze",
              "monitor"
            ],
            "type": "string",
            "description": "Analyze: score these comments once. Monitor changes: also mark each comment NEW, CHANGED, or UNCHANGED since the previous run with the same state key.",
            "default": "analyze"
          },
          "stateKey": {
            "title": "Monitoring state key",
            "type": "string",
            "description": "Only for Monitor changes. Use the same name every run, such as brand-weekly, so the Actor compares with the right previous run."
          },
          "includeText": {
            "title": "Include source text in output",
            "type": "boolean",
            "description": "Show each comment's text next to its sentiment. Uncheck to keep raw text out of the output. The monitoring memory never stores raw text.",
            "default": true
          },
          "idField": {
            "title": "ID field",
            "type": "string",
            "description": "Field path containing a stable comment identifier. A text hash is used when absent.",
            "default": "id"
          },
          "includeSourceIdentifiers": {
            "title": "Include source identifiers in output",
            "type": "boolean",
            "description": "Show your own comment IDs, such as en-1, in the output. Uncheck to replace them with SHA-256 hashes. The monitoring memory always stores only hashes.",
            "default": true
          },
          "languageField": {
            "title": "Trusted source language field",
            "type": "string",
            "description": "Optional field path for a reliable per-comment language code, such as es, it-IT or pt-BR. Leave unset if the source only gives a page or account locale."
          },
          "languages": {
            "title": "Expected languages",
            "type": "array",
            "description": "Languages allowed for detection in this locally validated MVP scope.",
            "items": {
              "type": "string"
            },
            "default": [
              "en",
              "fr",
              "de",
              "es",
              "it",
              "pt"
            ]
          },
          "metadataFields": {
            "title": "Metadata mapping",
            "type": "object",
            "description": "Optional allowlisted mapping for source, observedAt, platform, and sourceRef. Author data is never copied automatically.",
            "default": {},
            "additionalProperties": true
          },
          "maxItems": {
            "title": "Maximum comments",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap read from inline input or the source Dataset.",
            "default": 1000
          },
          "maxTextChars": {
            "title": "Maximum characters per comment",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Comments above this safety limit become explicit error rows.",
            "default": 4000
          },
          "batchSize": {
            "title": "Inference batch size",
            "minimum": 1,
            "maximum": 32,
            "type": "integer",
            "description": "Comments processed per local ONNX inference batch. Reduce if memory is constrained.",
            "default": 8
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}