{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Comments & Video Scraper",
    "description": "Scrape YouTube comments and replies plus video details (views, likes, exact comment count, channel, subscribers) from video links, channels or searches, without logging in. Sort by top or newest, collect only new comments on repeat runs. You only pay for rows delivered; failed videos are free.",
    "version": "0.3",
    "x-build-id": "V9IS8mYdrnENXnADN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/dataji~youtube-comments-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-dataji-youtube-comments-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/dataji~youtube-comments-scraper/runs": {
      "post": {
        "operationId": "runs-sync-dataji-youtube-comments-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/dataji~youtube-comments-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-dataji-youtube-comments-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": "Videos, channels and playlists",
            "type": "array",
            "description": "YouTube links, one per line. Videos: watch?v= links, youtu.be links, /shorts/, /live/ and /embed/ links (also from m.youtube.com, music.youtube.com and youtube-nocookie.com) or bare 11-character video ids. Channels: https://www.youtube.com/@handle, /channel/UC..., /c/... or /user/... links, or a bare @handle; the newest videos of the tabs chosen in 'Channel tabs' are read. Playlists: https://www.youtube.com/playlist?list=... links (public playlists; Mix playlists and Watch later can't be read). A search results link (youtube.com/results?search_query=...) For searches, use Search queries below. Tracking parameters (si, feature, pp, t, ...) are ignored and duplicates are removed. You can also upload a text or CSV file with one link per line.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "Search YouTube for these texts and read the top video results (videos only, in YouTube's order). 'Max videos per search' sets how many.",
            "items": {
              "type": "string"
            }
          },
          "channelTabs": {
            "title": "Channel tabs",
            "type": "array",
            "description": "Which tabs of each channel to read: 'videos' (the Videos tab), 'shorts' and 'streams' (the Live tab: past and upcoming live streams). 'Max videos per channel' applies to each tab. A tab the channel doesn't have is skipped.",
            "items": {
              "type": "string",
              "enum": [
                "videos",
                "shorts",
                "streams"
              ],
              "enumTitles": [
                "Videos",
                "Shorts",
                "Live"
              ]
            },
            "default": [
              "videos"
            ]
          },
          "maxVideosPerChannel": {
            "title": "Max videos per channel",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "How many of the newest videos to read from each channel tab chosen in 'Channel tabs' (with Videos and Shorts on, up to twice this number per channel).",
            "default": 10
          },
          "maxVideosPerSearch": {
            "title": "Max videos per search",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many video results to read for each search query.",
            "default": 10
          },
          "maxVideosPerPlaylist": {
            "title": "Max videos per playlist",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "How many videos to read from each playlist, in the playlist's order.",
            "default": 50
          },
          "maxCommentsPerVideo": {
            "title": "Max comments per video",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "How many top-level comments to read per video (replies are counted separately, see below). Comments skipped by the filters below count toward it. 0 = no comments, only the video rows.",
            "default": 100
          },
          "commentsSort": {
            "title": "Sort comments by",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "'Top' is YouTube's default order (the pinned comment first, then the most engaging); on big videos YouTube may end this list before every comment. 'Newest first' walks every visible comment from the newest down: best for monitoring, for 'Only comments newer than' and for getting as many comments as possible.",
            "default": "top"
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Also read the replies under each comment. Replies are comment rows with isReply = true and the parent's id in parentCommentId.",
            "default": false
          },
          "maxRepliesPerComment": {
            "title": "Max replies per comment",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "How many replies to read under each comment (when 'Include replies' is on).",
            "default": 20
          },
          "commentsNewerThan": {
            "title": "Only comments newer than",
            "type": "string",
            "description": "Keep only comments (and replies) posted on or after this date (YYYY-MM-DD, UTC) or within this period before the run started ('7 days', '2 weeks', '3 months'; a month counts as 30 days). YouTube shows comment times only as '3 weeks ago', so the date check is approximate. Use 'Newest first': the actor then stops reading a video once it reaches older comments. With 'Top comments' older comments are skipped but still count toward 'Max comments per video'. Replies are read only under comments inside the range."
          },
          "commentKeywords": {
            "title": "Only comments containing",
            "type": "array",
            "description": "Keep only comments that contain at least one of these words or phrases (any of them; not case-sensitive; part of a word counts, so 'price' also matches 'prices'). Empty = every comment.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Skip comments containing",
            "type": "array",
            "description": "Skip comments that contain any of these words or phrases (not case-sensitive), for example spam phrases or 'giveaway'.",
            "items": {
              "type": "string"
            }
          },
          "minLikes": {
            "title": "Minimum likes",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "Keep only comments with at least this many likes. YouTube rounds counts over 1,000 ('1.2K' = 1,200). 0 = no minimum.",
            "default": 0
          },
          "commentLanguages": {
            "title": "Comment languages",
            "type": "array",
            "description": "Keep only comments detected as one of these languages (see commentLanguage in the output). Detection runs offline and is a best guess: reliable for a sentence, often wrong for one or two words. Comments without words (emoji, links) are skipped when this is set.",
            "items": {
              "type": "string",
              "enum": [
                "af",
                "sq",
                "am",
                "ar",
                "an",
                "hy",
                "as",
                "az",
                "eu",
                "be",
                "bn",
                "bs",
                "br",
                "bg",
                "ca",
                "zh",
                "hr",
                "cs",
                "da",
                "nl",
                "dz",
                "en",
                "eo",
                "et",
                "fo",
                "fi",
                "fr",
                "gl",
                "ka",
                "de",
                "el",
                "gu",
                "ht",
                "he",
                "hi",
                "hu",
                "is",
                "id",
                "ga",
                "it",
                "ja",
                "jv",
                "kn",
                "kk",
                "km",
                "rw",
                "ko",
                "ku",
                "ky",
                "lo",
                "la",
                "lv",
                "lt",
                "lb",
                "mk",
                "mg",
                "ms",
                "ml",
                "mt",
                "mr",
                "mn",
                "ne",
                "se",
                "no",
                "nb",
                "nn",
                "oc",
                "or",
                "ps",
                "fa",
                "pl",
                "pt",
                "pa",
                "qu",
                "ro",
                "ru",
                "sr",
                "si",
                "sk",
                "sl",
                "es",
                "sw",
                "sv",
                "tl",
                "ta",
                "te",
                "th",
                "tr",
                "uk",
                "ur",
                "ug",
                "vi",
                "vo",
                "wa",
                "cy",
                "xh",
                "zu"
              ],
              "enumTitles": [
                "Afrikaans",
                "Albanian",
                "Amharic",
                "Arabic",
                "Aragonese",
                "Armenian",
                "Assamese",
                "Azerbaijani",
                "Basque",
                "Belarusian",
                "Bengali",
                "Bosnian",
                "Breton",
                "Bulgarian",
                "Catalan",
                "Chinese",
                "Croatian",
                "Czech",
                "Danish",
                "Dutch",
                "Dzongkha",
                "English",
                "Esperanto",
                "Estonian",
                "Faroese",
                "Finnish",
                "French",
                "Galician",
                "Georgian",
                "German",
                "Greek",
                "Gujarati",
                "Haitian Creole",
                "Hebrew",
                "Hindi",
                "Hungarian",
                "Icelandic",
                "Indonesian",
                "Irish",
                "Italian",
                "Japanese",
                "Javanese",
                "Kannada",
                "Kazakh",
                "Khmer",
                "Kinyarwanda",
                "Korean",
                "Kurdish",
                "Kyrgyz",
                "Lao",
                "Latin",
                "Latvian",
                "Lithuanian",
                "Luxembourgish",
                "Macedonian",
                "Malagasy",
                "Malay",
                "Malayalam",
                "Maltese",
                "Marathi",
                "Mongolian",
                "Nepali",
                "Northern Sami",
                "Norwegian",
                "Norwegian Bokmål",
                "Norwegian Nynorsk",
                "Occitan",
                "Odia",
                "Pashto",
                "Persian",
                "Polish",
                "Portuguese",
                "Punjabi",
                "Quechua",
                "Romanian",
                "Russian",
                "Serbian",
                "Sinhala",
                "Slovak",
                "Slovenian",
                "Spanish",
                "Swahili",
                "Swedish",
                "Tagalog",
                "Tamil",
                "Telugu",
                "Thai",
                "Turkish",
                "Ukrainian",
                "Urdu",
                "Uyghur",
                "Vietnamese",
                "Volapük",
                "Walloon",
                "Welsh",
                "Xhosa",
                "Zulu"
              ]
            }
          },
          "oneCommentPerAuthor": {
            "title": "One comment per author",
            "type": "boolean",
            "description": "For each video, deliver only the first comment (or reply) read from each author. Handy for giveaways and for counting unique commenters.",
            "default": false
          },
          "includeVideoDetails": {
            "title": "Include video details",
            "type": "boolean",
            "description": "Add one video row per video: title, description, views, likes, exact comment count, publish date, hashtags, chapters and channel (name, handle, subscribers), plus how many comments were delivered and why reading stopped (coveragePct, stopReason). The row comes after the video's comments.",
            "default": true
          },
          "onlyNewComments": {
            "title": "Only new comments",
            "type": "boolean",
            "description": "Skip comments this actor already delivered for the same video in earlier runs of your account (remembered in a key-value store named 'youtube-comments-seen'). Use with 'Newest first' on a schedule to monitor videos: each comment is delivered once, and its firstSeenAt tells you which run first saw it. Skipped comments are not charged.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many videos are read at the same time, each through its own proxy IP. Keep it low: YouTube is gentler with slow, steady traffic.",
            "default": 3
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Proxy (datacenter) is used by default. If many videos come back as 'blocked', switch to the RESIDENTIAL group. Proxy costs are included in the price, residential too.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}