{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Unlimited Comments & Transcript Scraper",
    "description": "Input YouTube video URLs, IDs, Shorts, channels, playlists, or search keywords. Output unlimited comments, nested replies, clean and timestamped transcripts, views, likes, and channel details as per-video JSON or flat CSV and Excel rows.",
    "version": "0.0",
    "x-build-id": "ankDaAHEOxnVFfI3N"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/codenest~youtube-unlimited-comments-transcript-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-codenest-youtube-unlimited-comments-transcript-scraper",
        "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/codenest~youtube-unlimited-comments-transcript-scraper/runs": {
      "post": {
        "operationId": "runs-sync-codenest-youtube-unlimited-comments-transcript-scraper",
        "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/codenest~youtube-unlimited-comments-transcript-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-codenest-youtube-unlimited-comments-transcript-scraper",
        "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": {
          "startUrls": {
            "title": "YouTube URLs or Video IDs",
            "type": "array",
            "description": "YouTube video URLs, 11-character video IDs, Shorts (/shorts/...), Channel URLs (/@handle), or Playlist URLs (?list=...).",
            "items": {
              "type": "string"
            }
          },
          "searchKeywords": {
            "title": "Search Keywords",
            "type": "array",
            "description": "Optional search keywords to find YouTube videos and scrape their comments and transcripts.",
            "items": {
              "type": "string"
            }
          },
          "maxVideos": {
            "title": "Max Videos per Source",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum videos to collect from each channel, playlist, or keyword search. Set 0 for unlimited.",
            "default": 20
          },
          "includeTranscript": {
            "title": "Include Transcript",
            "type": "boolean",
            "description": "Extract video subtitles/captions (prefers manual captions and falls back to auto-generated captions).",
            "default": true
          },
          "transcriptLanguages": {
            "title": "Preferred Transcript Languages",
            "type": "array",
            "description": "Language codes in priority order (for example: en, bn, es, de). Falls back to available language if missing.",
            "items": {
              "type": "string"
            },
            "default": [
              "en"
            ]
          },
          "includeTimestamps": {
            "title": "Include Timestamped Segments",
            "type": "boolean",
            "description": "Include startSec, durationSec, timestamp, and text per caption line alongside full transcriptText.",
            "default": true
          },
          "includeComments": {
            "title": "Include Comments",
            "type": "boolean",
            "description": "Extract comments from each video using pagination.",
            "default": true
          },
          "maxCommentsPerVideo": {
            "title": "Max Comments per Video (0 = Unlimited)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum top-level comments to scrape per video. Set 0 to collect all available comments.",
            "default": 200
          },
          "commentSortBy": {
            "title": "Comment Sort Order",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "Fetch Top comments first or Newest comments first. If Top is filtered early by YouTube, remaining unfiltered comments are automatically fetched from Newest.",
            "default": "top"
          },
          "includeReplies": {
            "title": "Include Replies",
            "type": "boolean",
            "description": "Also scrape replies under each comment thread.",
            "default": false
          },
          "maxRepliesPerComment": {
            "title": "Max Replies per Comment (0 = Unlimited)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum replies to fetch per comment thread when Include Replies is enabled.",
            "default": 10
          },
          "outputFormat": {
            "title": "Output Format",
            "enum": [
              "per_video",
              "flat_comments"
            ],
            "type": "string",
            "description": "per_video outputs one row per video with nested comments and full transcript; flat_comments outputs one row per comment or reply for CSV/Excel analysis.",
            "default": "per_video"
          },
          "proxyCountry": {
            "title": "Proxy Country",
            "enum": [
              "US",
              "GB",
              "CA",
              "AU",
              "DE",
              "FR",
              "IN",
              "BD"
            ],
            "type": "string",
            "description": "Country code for Apify Residential Proxy.",
            "default": "US"
          },
          "maxConcurrency": {
            "title": "Parallel Workers",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Number of videos processed simultaneously (1 to 10).",
            "default": 5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}