{
  "openapi": "3.0.1",
  "info": {
    "title": "Sentiment Analysis — Reviews, Comments & Any Dataset",
    "description": "Positive, neutral or negative for every review, comment or post: paste texts, upload a CSV/Excel or chain any scraper dataset (Google Maps, Amazon, Trustpilot, YouTube…). 16+ languages, mixed opinions, star-rating mismatches and a summary report. Own model, no third-party API.",
    "version": "1.0",
    "x-build-id": "4VQc7qJKcla90i3Yf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tidydata~sentiment-analysis/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tidydata-sentiment-analysis",
        "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/tidydata~sentiment-analysis/runs": {
      "post": {
        "operationId": "runs-sync-tidydata-sentiment-analysis",
        "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/tidydata~sentiment-analysis/run-sync": {
      "post": {
        "operationId": "run-sync-tidydata-sentiment-analysis",
        "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": "Texts",
            "type": "array",
            "description": "One text per line: reviews, comments, posts, survey answers, tickets, emails… From the API, n8n, Make, Zapier or an AI agent you can also send objects: [{\"id\": \"R-1\", \"text\": \"…\", \"rating\": 4}].",
            "items": {
              "type": "string"
            }
          },
          "fileUrls": {
            "title": "Or: CSV, Excel, JSON or TXT files (links)",
            "type": "array",
            "description": "Links to CSV / TSV, Excel (.xlsx), JSON / JSON Lines or TXT files (one text per line). The text column is found automatically (or set it below). Google Drive, Dropbox and OneDrive share links work.",
            "items": {
              "type": "string"
            }
          },
          "uploadedFiles": {
            "title": "Or: upload files",
            "type": "array",
            "description": "Upload CSV, Excel, JSON or TXT files from your computer: exports from Trustpilot, App Store Connect, Google Play Console, surveys (Typeform, Google Forms), help desks…"
          },
          "datasetId": {
            "title": "Or: dataset of another Actor (chain it)",
            "type": "string",
            "description": "Add sentiment to the results of a reviews or comments scraper (Google Maps, Amazon, Trustpilot, Booking, TripAdvisor, App Store, Google Play, YouTube, TikTok, Instagram, X, Reddit…). Pick the dataset or pass its ID from an integration / webhook."
          },
          "textField": {
            "title": "Field with the text",
            "type": "string",
            "description": "Column or field with the text, e.g. text, reviewText, comment or a nested path like review.body. Two or more fields are joined: title,text. Empty = found automatically."
          },
          "ratingField": {
            "title": "Field with the star rating",
            "type": "string",
            "description": "Optional: e.g. stars, rating, score. Empty = found automatically (stars, rating, ratingScore…). 1-5 stars, 1-10 scores and 0-100 are understood. Used for the star-rating breakdown and to flag ratings that do not match the text."
          },
          "idField": {
            "title": "Field to copy as ID",
            "type": "string",
            "description": "Optional: a field copied to each result as 'id' (e.g. reviewId, url, sku). Empty = reviewId / commentId / id if present."
          },
          "groupByField": {
            "title": "Group the report by",
            "type": "string",
            "description": "Optional: a field to compare in the report, e.g. title (place name), asin (product), app, brand, location or channel."
          },
          "includeInputFields": {
            "title": "Keep all the original fields",
            "type": "boolean",
            "description": "For files and datasets: each result keeps all the columns of the original row plus the sentiment columns, so you can export one enriched table. Off = only the sentiment columns, the text and the ID.",
            "default": true
          },
          "sentenceAnalysis": {
            "title": "Analyse each sentence too",
            "type": "boolean",
            "description": "Scores every sentence of a text to find mixed opinions (\"great battery, terrible camera\") and return the best and the worst sentence. Off = faster on long reviews.",
            "default": true
          },
          "includeSentences": {
            "title": "Include the score of every sentence",
            "type": "boolean",
            "description": "Adds the list of sentences with their sentiment to each result (bigger output).",
            "default": false
          },
          "maxTexts": {
            "title": "Max texts",
            "minimum": 1,
            "maximum": 200000,
            "type": "integer",
            "description": "Upper limit of texts analysed in one run.",
            "default": 10000
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Bigger files are not downloaded (free).",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}