{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Comments Scraper: Comments & Replies Export",
    "description": "Export YouTube comments and replies from videos, Shorts and whole channels to CSV, Excel or JSON: text, author, likes, replies, date, pinned and creator-hearted. Filter by keyword and date, top or newest. Only-new mode returns just the new comments on each scheduled run. No API key or quota.",
    "version": "0.1",
    "x-build-id": "byZEI7PvJchb5ppKL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/s_actors~youtube-comments-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-s_actors-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/s_actors~youtube-comments-scraper/runs": {
      "post": {
        "operationId": "runs-sync-s_actors-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/s_actors~youtube-comments-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-s_actors-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",
        "required": [
          "videos"
        ],
        "properties": {
          "videos": {
            "title": "🎬 Videos, Shorts or channels",
            "type": "array",
            "description": "One per line: video links (youtube.com/watch?v=..., youtu.be/...), Shorts links (/shorts/...), 11-character video IDs, channel links (youtube.com/@handle, /channel/UC...), @handles or playlist links (?list=...). A channel gives the comments of its latest videos, a playlist of its videos (see Videos per channel).",
            "items": {
              "type": "string"
            }
          },
          "maxComments": {
            "title": "💬 Max comments per video",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Top-level comments to return per video (replies come on top, see below). 0 = all comments of the video. In only-new mode: the maximum number of new comments per video.",
            "default": 100
          },
          "sort": {
            "title": "↕️ Sort comments by",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "Top: YouTube's default order, most liked and discussed first. Newest first: the latest comments first, best with Newer than. Only-new mode always reads newest first.",
            "default": "top"
          },
          "includeReplies": {
            "title": "↩️ Include replies",
            "type": "boolean",
            "description": "Also return the replies to each comment, right after it (isReply = true, parentCommentId = the comment).",
            "default": false
          },
          "maxRepliesPerComment": {
            "title": "🔢 Max replies per comment",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "With Include replies: how many replies to return per comment, oldest first as on YouTube. 0 = all replies. A cap keeps one viral thread from taking the whole run.",
            "default": 20
          },
          "maxVideosPerChannel": {
            "title": "📺 Videos per channel or playlist",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "For channels: how many of the latest uploads (videos, Shorts and past streams) to scrape comments from. For playlists: how many videos from the top of the playlist.",
            "default": 10
          },
          "newerThan": {
            "title": "📅 Newer than",
            "type": "string",
            "description": "Only comments posted in this period, e.g. 24 hours, 7 days, 2 weeks, 1 month, or a date like 2026-09-01. With Newest first the scan stops at the first older comment, so it is fast and cheap. YouTube shows relative dates (\"3 days ago\"), so the limit is approximate for older comments."
          },
          "keywords": {
            "title": "🔍 Only comments containing",
            "type": "array",
            "description": "Keep only comments (and replies) that contain at least one of these words or phrases, not case-sensitive: your brand, a product, a question. You pay only for the comments returned. With a filter the Actor scans up to 20 times Max comments per video (at least 2,000).",
            "items": {
              "type": "string"
            }
          },
          "onlyNew": {
            "title": "🔔 Only new comments",
            "type": "boolean",
            "description": "For scheduled runs (save the input as a task and add a schedule). The first run returns the latest comments and remembers them; every later run returns only comments posted since, plus new replies to recent comments (with Include replies). An empty result means no new comments.",
            "default": false
          },
          "monitorName": {
            "title": "🏷️ Monitor name",
            "type": "string",
            "description": "Name of the memory used by Only new comments. Use a different name for each task, otherwise two tasks share what they have already seen.",
            "default": "default"
          },
          "maxConcurrency": {
            "title": "⚡ Parallel requests",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "How many requests to YouTube run at the same time.",
            "default": 10
          },
          "proxyConfiguration": {
            "title": "🛡️ Proxy",
            "type": "object",
            "description": "Requests go direct first and switch to Apify datacenter proxies when YouTube refuses them. The default works for most runs.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}