{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Comments Scraper with Replies",
    "description": "Extract public YouTube comments and replies with text, likes, authors, badges, pinned and hearted signals, and creator interactions. No YouTube API key or login is required.",
    "version": "1.0",
    "x-build-id": "cQVr64gpWigpz1N5x"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sebastian-actors~youtube-comments-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sebastian-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/sebastian-actors~youtube-comments-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sebastian-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/sebastian-actors~youtube-comments-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sebastian-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": [
          "videoUrls"
        ],
        "properties": {
          "videoUrls": {
            "title": "YouTube video URLs or IDs",
            "minItems": 1,
            "maxItems": 1000,
            "type": "array",
            "description": "Individual video URLs, Shorts URLs, or raw 11-character video IDs. Channels, playlists, profiles, community posts, and searches return free per-input status rows.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048
            }
          },
          "sort": {
            "title": "Comment sorting",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "Use YouTube's top-comments ranking or newest-first order.",
            "default": "top"
          },
          "maxTopLevelCommentsPerVideo": {
            "title": "Top-level comments per video",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum unique top-level comments. Use 0 for all available comments.",
            "default": 100
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Fetch public replies beneath each top-level comment.",
            "default": false
          },
          "maxRepliesPerThread": {
            "title": "Replies per thread",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum replies per top-level thread. Use 0 for all available replies.",
            "default": 20
          },
          "maxResultsPerVideo": {
            "title": "Results per video",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard limit across top-level comments and replies for one video.",
            "default": 1000
          },
          "maxTotalResults": {
            "title": "Results per run",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Hard run-wide limit across all comment rows.",
            "default": 10000
          },
          "includeVideoMetadata": {
            "title": "Include video metadata",
            "type": "boolean",
            "description": "Fetch available title, channel, duration, publication, thumbnail, Shorts, and live metadata.",
            "default": true
          },
          "includeAuthorDetails": {
            "title": "Include author details",
            "type": "boolean",
            "description": "Include channel identity, avatar, verification, membership, and badge fields.",
            "default": true
          },
          "includeTextReferences": {
            "title": "Include text references",
            "type": "boolean",
            "description": "Extract links, channel mentions, and hashtags from YouTube text runs.",
            "default": true
          },
          "locale": {
            "title": "YouTube locale",
            "type": "object",
            "description": "Language and country sent to the anonymous Innertube session.",
            "properties": {
              "language": {
                "title": "Language",
                "description": "BCP 47 language code.",
                "type": "string",
                "editor": "textfield",
                "minLength": 2,
                "maxLength": 35,
                "default": "en"
              },
              "country": {
                "title": "Country",
                "description": "Two-letter country code.",
                "type": "string",
                "editor": "textfield",
                "pattern": "^[A-Za-z]{2}$",
                "default": "US"
              }
            },
            "default": {
              "language": "en",
              "country": "US"
            },
            "additionalProperties": false
          },
          "cleaning": {
            "title": "Comment cleaning",
            "type": "object",
            "description": "Deterministic normalization only. Text is never translated, summarized, censored, or rewritten.",
            "properties": {
              "decodeHtmlEntities": {
                "title": "Decode HTML entities",
                "description": "Convert encoded entities such as &amp; back to their literal characters.",
                "type": "boolean",
                "editor": "checkbox",
                "default": true
              },
              "normalizeUnicode": {
                "title": "Normalize Unicode to NFC",
                "description": "Normalize canonically equivalent Unicode sequences without changing their meaning.",
                "type": "boolean",
                "editor": "checkbox",
                "default": true
              },
              "normalizeWhitespace": {
                "title": "Normalize spaces and tabs",
                "description": "Collapse repeated spaces and tabs while preserving intentional newlines.",
                "type": "boolean",
                "editor": "checkbox",
                "default": true
              },
              "removeInvalidControlCharacters": {
                "title": "Remove invalid control characters",
                "description": "Remove invalid controls while preserving newlines, tabs, and emoji joiners.",
                "type": "boolean",
                "editor": "checkbox",
                "default": true
              },
              "trimWhitespace": {
                "title": "Trim surrounding whitespace",
                "description": "Remove whitespace surrounding the complete comment text.",
                "type": "boolean",
                "editor": "checkbox",
                "default": true
              }
            },
            "default": {
              "decodeHtmlEntities": true,
              "normalizeUnicode": true,
              "normalizeWhitespace": true,
              "removeInvalidControlCharacters": true,
              "trimWhitespace": true
            },
            "additionalProperties": false
          },
          "maxVideoConcurrency": {
            "title": "Concurrent videos",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Number of videos processed concurrently.",
            "default": 4
          },
          "maxReplyConcurrencyPerVideo": {
            "title": "Concurrent reply threads",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Reply threads fetched concurrently within one top-level page.",
            "default": 3
          },
          "maxRetriesPerRequest": {
            "title": "Retries per request",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Temporary request retries on the same session and proxy identity.",
            "default": 3
          },
          "requestTimeoutSecs": {
            "title": "Request timeout",
            "minimum": 10,
            "maximum": 120,
            "type": "integer",
            "description": "Timeout for each YouTube request.",
            "default": 30
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Use Apify Proxy or custom proxy URLs for YouTube requests.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "debug": {
            "title": "Debug logging",
            "type": "boolean",
            "description": "Log sanitized phases and codes without comments, tokens, raw responses, cookies, or proxy URLs.",
            "default": 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}