{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Intelligence & Transcript Scraper (with AI Insights)",
    "description": "The all-in-one YouTube scraper that extracts full transcripts, viewer comment sentiment, creator contact emails, commercial sponsorships, video chapters, and AI-powered intelligence — all in a single run.",
    "version": "0.0",
    "x-build-id": "HT8AFfLH8sL4akejB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/za_intelligence~youtube-intelligence/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-za_intelligence-youtube-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/za_intelligence~youtube-intelligence/runs": {
      "post": {
        "operationId": "runs-sync-za_intelligence-youtube-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/za_intelligence~youtube-intelligence/run-sync": {
      "post": {
        "operationId": "run-sync-za_intelligence-youtube-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": [
          "runMode"
        ],
        "properties": {
          "runMode": {
            "title": "Run Mode",
            "enum": [
              "discover",
              "scrape"
            ],
            "type": "string",
            "description": "Choose whether to discover videos by search or scrape specific video URLs.",
            "default": "discover"
          },
          "discoverConfig": {
            "title": "Discover Mode Settings",
            "type": "object",
            "description": "Settings used when discovering videos via YouTube search.",
            "properties": {
              "searchQueries": {
                "title": "🔍 Search Queries",
                "type": "array",
                "editor": "stringList",
                "prefill": [
                  "rugby highlights"
                ],
                "description": "List of search terms to find videos on YouTube."
              },
              "searchCategory": {
                "title": "🏷️ Append Category",
                "type": "string",
                "enum": [
                  "",
                  "News",
                  "Sport",
                  "Music",
                  "Gaming",
                  "Education"
                ],
                "default": "Sport",
                "description": "Optional category keyword to append to the search query."
              },
              "uploadDate": {
                "title": "📅 Upload Date",
                "type": "string",
                "enum": [
                  "",
                  "Hour",
                  "Today",
                  "This week",
                  "This month",
                  "This year"
                ],
                "default": "",
                "description": "Filter videos by upload date."
              },
              "videoDuration": {
                "title": "⏱️ Duration",
                "type": "string",
                "enum": [
                  "",
                  "Short (<4 mins)",
                  "Medium (4–20 mins)",
                  "Long (>20 mins)"
                ],
                "default": "",
                "description": "Filter videos by approximate duration."
              },
              "maxResultsPerQuery": {
                "title": "📊 Video Limit",
                "type": "integer",
                "default": 1,
                "prefill": 1,
                "description": "Maximum number of videos to collect per search query."
              }
            }
          },
          "scrapeConfig": {
            "title": "Scrape Mode Settings",
            "type": "object",
            "description": "Settings used when scraping known YouTube videos directly.",
            "properties": {
              "videoIDs": {
                "title": "📹 YouTube Video IDs",
                "type": "array",
                "editor": "stringList",
                "prefill": [
                  "xZCbAki4puY"
                ],
                "description": "Provide specific YouTube video IDs to scrape directly."
              }
            }
          },
          "lang": {
            "title": "🗣️ Transcript Language",
            "type": "string",
            "description": "Preferred language code for transcript extraction (e.g. en, fr, es).",
            "default": "en"
          },
          "enableAnalysis": {
            "title": "🤖 AI Video Analysis",
            "type": "boolean",
            "description": "Analyze video type, genre, sentiment, featured people, and key themes using Gemini 3.8 Flash.",
            "default": true
          },
          "maxComments": {
            "title": "💬 Max Comments to Analyze",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Number of top comments to scrape and analyze for audience sentiment (set to 0 to skip comments).",
            "default": 5
          },
          "targetEntities": {
            "title": "🎯 Target Entities to Check",
            "type": "array",
            "description": "Enter names of people, brands, products, companies, or topics to verify if they were mentioned in the video (returns boolean Yes/No, mention type, context, and evidence).",
            "items": {
              "type": "string"
            }
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy Configuration",
            "type": "object",
            "description": "Select proxy group to avoid YouTube IP blocks and bot-detection during scraping.",
            "default": {
              "useApifyProxy": 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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}