{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Audience & Competitor Intelligence",
    "description": "Analyze public YouTube comments through the official YouTube Data API: sentiment, complaints, feature requests, questions, competitor mentions, switching signals, and change monitoring.",
    "version": "0.1",
    "x-build-id": "X35la5AAbbmv0BEBq"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datahunter_labs~youtube-audience-competitor-intelligence/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datahunter_labs-youtube-audience-competitor-intelligence",
        "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/datahunter_labs~youtube-audience-competitor-intelligence/runs": {
      "post": {
        "operationId": "runs-sync-datahunter_labs-youtube-audience-competitor-intelligence",
        "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/datahunter_labs~youtube-audience-competitor-intelligence/run-sync": {
      "post": {
        "operationId": "run-sync-datahunter_labs-youtube-audience-competitor-intelligence",
        "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": [
          "videoUrls"
        ],
        "properties": {
          "youtubeApiKey": {
            "title": "YouTube Data API key",
            "type": "string",
            "description": "Google Cloud YouTube Data API v3 key. Stored encrypted by Apify. The Actor uses only Google's official public API endpoints."
          },
          "videoUrls": {
            "title": "YouTube videos",
            "minItems": 1,
            "maxItems": 50,
            "type": "array",
            "description": "Video URLs, Shorts URLs, youtu.be links, Live URLs, embed URLs, or bare 11-character video IDs.",
            "items": {
              "type": "string"
            },
            "default": [
              "dQw4w9WgXcQ"
            ]
          },
          "maxCommentsPerVideo": {
            "title": "Maximum comments per video",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum top-level comments and optional replies returned per video.",
            "default": 100
          },
          "order": {
            "title": "Comment order",
            "enum": [
              "time",
              "relevance"
            ],
            "type": "string",
            "description": "YouTube commentThreads order.",
            "default": "time"
          },
          "searchTerms": {
            "title": "Comment search terms",
            "type": "string",
            "description": "Optional YouTube API comment search terms. Leave blank for all comments.",
            "default": ""
          },
          "competitorNames": {
            "title": "Competitor names",
            "type": "array",
            "description": "Optional brands, products, creators, or apps to detect in comments and switching signals.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Include replies. Extra API requests are used only when YouTube's embedded reply subset is incomplete.",
            "default": false
          },
          "maxRepliesPerThread": {
            "title": "Maximum replies per thread",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Hard per-thread reply cap when replies are enabled.",
            "default": 20
          },
          "includeAuthorName": {
            "title": "Include public author display name",
            "type": "boolean",
            "description": "Off by default to minimize unnecessary personal identifiers.",
            "default": false
          },
          "monitorChanges": {
            "title": "Monitor new comments",
            "type": "boolean",
            "description": "Persist comment IDs per video and relevant filters so later runs identify newly observed comments.",
            "default": true
          },
          "onlyNewComments": {
            "title": "Emit only new comments after baseline",
            "type": "boolean",
            "description": "After a monitoring baseline exists, emit only newly observed comments plus the free video summary.",
            "default": false
          },
          "cacheTtlMinutes": {
            "title": "Cache TTL (minutes)",
            "minimum": 1,
            "maximum": 10080,
            "type": "integer",
            "description": "Used only for non-monitoring runs to reduce repeated API calls.",
            "default": 60
          },
          "forceRefresh": {
            "title": "Force refresh",
            "type": "boolean",
            "description": "Ignore a valid cache entry on non-monitoring runs.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Maximum video concurrency",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Maximum videos processed concurrently. Kept low to avoid quota spikes on one API key.",
            "default": 2
          },
          "maxRequestsPerRun": {
            "title": "YouTube API request budget",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Hard cap on API requests, including retries and optional reply pagination.",
            "default": 100
          },
          "timeoutSeconds": {
            "title": "HTTP timeout (seconds)",
            "minimum": 5,
            "maximum": 60,
            "type": "integer",
            "description": "Timeout per official YouTube Data API request.",
            "default": 20
          },
          "maxRetries": {
            "title": "Maximum retries",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Bounded retries for 408, 429 and transient 5xx/network failures.",
            "default": 2
          },
          "retryBackoffSeconds": {
            "title": "Retry backoff (seconds)",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Base exponential backoff between transient retries.",
            "default": 1
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}