{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Comments Scraper — $0.50/1K comments & replies",
    "description": "Get YouTube comments and replies from videos, channels, playlists or a search: text, likes, reply count, commenter and date. Typical run: 50 comments from one video in under a minute. Example input: {\"videoUrls\":[\"https://www.youtube.com/watch?v=jNQXAC9IVRw\"],\"maxCommentsPerVideo\":50}",
    "version": "0.1",
    "x-build-id": "5AmNKYum7hIJiezVN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lergassy~youtube-comments-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lergassy-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/lergassy~youtube-comments-scraper/runs": {
      "post": {
        "operationId": "runs-sync-lergassy-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/lergassy~youtube-comments-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-lergassy-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": {
          "videoUrls": {
            "title": "🎬 Video URLs or IDs",
            "type": "array",
            "description": "YouTube video links or 11-character video IDs, one per line: <b>https://www.youtube.com/watch?v=dQw4w9WgXcQ</b>, <b>https://youtu.be/dQw4w9WgXcQ</b>, a Shorts link, or just <b>dQw4w9WgXcQ</b>.",
            "items": {
              "type": "string"
            }
          },
          "channelUrls": {
            "title": "📺 Channel URLs",
            "type": "array",
            "description": "Channel links, one per line — <b>https://www.youtube.com/@mkbhd</b> or a <b>/channel/UC…</b> link. The channel's latest videos are collected (see <b>Videos per channel</b>) and their comments scraped.",
            "items": {
              "type": "string"
            }
          },
          "playlistUrls": {
            "title": "📋 Playlist URLs",
            "type": "array",
            "description": "Playlist links, one per line. Every video in the playlist is scraped, up to <b>Videos per channel</b>.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "🔍 YouTube search",
            "type": "array",
            "description": "Search YouTube and scrape the comments of the top results — <b>\"iphone 17 review\"</b>, <b>\"n8n tutorial\"</b>. Up to <b>Videos per channel</b> videos per query.",
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerSource": {
            "title": "📹 Videos per channel / playlist / search",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many videos to take from each channel, playlist or search — newest first for channels, playlist order for playlists, YouTube's ranking for searches.",
            "default": 10
          },
          "maxCommentsPerVideo": {
            "title": "💬 Comments per video",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many comments per video (replies count too when included). 0 = all comments; a viral video can have hundreds of thousands.",
            "default": 100
          },
          "sort": {
            "title": "↕️ Sort comments",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "<b>Newest first</b> plus a date cutoff turns a scheduled run into a feed of what was said since last time.",
            "default": "top"
          },
          "includeReplies": {
            "title": "↩️ Include replies",
            "type": "boolean",
            "description": "Also collect the replies under each comment. Each reply is its own row with <b>parentCommentId</b> set.",
            "default": true
          },
          "maxRepliesPerComment": {
            "title": "Replies per comment",
            "minimum": 0,
            "type": "integer",
            "description": "Cap on replies collected under one comment. 0 = all.",
            "default": 20
          },
          "commentsSince": {
            "title": "📅 Only comments since",
            "type": "string",
            "description": "Skip comments older than this: a date such as <b>2026-06-01</b> or a period such as <b>7 days</b>, <b>3 months</b>. YouTube shows ages, not dates, so the cutoff is applied to that age. With <b>Newest first</b> collection stops at the first older comment."
          },
          "keyword": {
            "title": "🔎 Keyword in comment",
            "type": "string",
            "description": "Keep only comments whose text contains this word or phrase (case-insensitive). Several alternatives: separate with <b>|</b>, e.g. <b>battery|charging</b>."
          },
          "minLikes": {
            "title": "👍 Minimum likes",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only comments with at least this many likes."
          },
          "onlyCreatorHearted": {
            "title": "❤️ Only comments hearted by the creator",
            "type": "boolean",
            "description": "Keep only comments the channel owner marked with a heart — the ones the creator noticed.",
            "default": false
          },
          "includeVideoDetails": {
            "title": "🎥 Video summary rows",
            "type": "boolean",
            "description": "Add one row per video with title, channel, views, likes, publish date, duration and how many comments were collected (rowType = video). These rows have different columns from the comment rows, so the table shows blanks where a column does not apply.",
            "default": false
          },
          "language": {
            "title": "🌐 Language",
            "type": "string",
            "description": "Two-letter language for YouTube's interface text, such as <b>en</b>, <b>de</b>, <b>id</b>. Affects comment ages (\"2 weeks ago\") and video metadata labels, not the comments themselves.",
            "default": "en"
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "YouTube serves video pages from Apify's data-centre addresses but answers the comments continuation with 403, so a run moves itself onto a residential proxy the first time that happens. Bring your own proxies here to keep the run on them instead.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}