{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Comments Scraper — Comments, Replies & Likes",
    "description": "Scrape YouTube comments and replies from videos, Shorts, playlists and channels: text, author, likes, reply count, date, pinned and creator-heart flags.",
    "version": "0.1",
    "x-build-id": "RDQiwCqZfROieWLtD"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tortuga~youtube-comments-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tortuga-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/tortuga~youtube-comments-scraper/runs": {
      "post": {
        "operationId": "runs-sync-tortuga-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/tortuga~youtube-comments-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-tortuga-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": [
          "urls"
        ],
        "properties": {
          "urls": {
            "title": "YouTube URLs or video IDs",
            "type": "array",
            "description": "One per line. Video URLs (`watch?v=`, `youtu.be/`, `/shorts/`, `/live/`, `/embed/`) or 11-character video IDs, playlist URLs (`/playlist?list=...`), and channel URLs (`/@handle`, `/channel/UC...`, `/c/name`, `/user/name`, optionally ending in `/videos`, `/shorts` or `/streams`). Playlists and channels are expanded to their latest videos.",
            "items": {
              "type": "string"
            }
          },
          "maxComments": {
            "title": "Max comments per video",
            "minimum": 1,
            "type": "integer",
            "description": "Stop each video after this many saved items (comments plus their replies). Large videos have millions of comments, so this keeps runs and cost predictable.",
            "default": 100
          },
          "sortBy": {
            "title": "Sort comments by",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "Top comments (YouTube's default ranking) or newest first. YouTube's Top list ends after about 1,000-1,250 comments on big videos; if you ask for more, the Actor continues with newest first and skips duplicates. Monitoring mode and the date filter always use newest first.",
            "default": "top"
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Also save the replies under each comment (each reply is one result, with `parentCommentId`). Replies count toward Max comments per video.",
            "default": false
          },
          "maxRepliesPerComment": {
            "title": "Max replies per comment",
            "minimum": 1,
            "type": "integer",
            "description": "With Include replies on: save at most this many replies per comment. Leave empty for all replies (still capped by Max comments per video)."
          },
          "commentsNewerThan": {
            "title": "Only comments newer than",
            "type": "string",
            "description": "Only comments newer than: a date (YYYY-MM-DD) or a period such as '7 days' or '24 hours'. Uses newest-first order and stops paging once a whole page is older. YouTube shows relative dates ('3 weeks ago'), so the cut is approximate."
          },
          "maxVideosPerSource": {
            "title": "Max videos per playlist / channel",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "For each playlist or channel URL, take this many videos (playlist order, or newest first for channels). Video URLs are always processed.",
            "default": 10
          },
          "channelTab": {
            "title": "Channel tab",
            "enum": [
              "videos",
              "shorts",
              "streams"
            ],
            "type": "string",
            "description": "Which list a channel URL is expanded from, unless the URL itself ends in `/videos`, `/shorts` or `/streams`.",
            "default": "videos"
          },
          "maxItems": {
            "title": "Max results (total)",
            "minimum": 1,
            "type": "integer",
            "description": "Stop the whole run after this many comments and replies are saved. Each saved comment or reply is one charged result, so this caps the cost.",
            "default": 1000
          },
          "onlyNewOrChanged": {
            "title": "Only new or changed items",
            "type": "boolean",
            "description": "Remember which comments earlier runs of this input returned and output only new comments (newest first). Use with a Schedule; paging stops as soon as it reaches comments an earlier run already saw, and those are not charged.",
            "default": false
          },
          "monitoringKey": {
            "title": "Monitoring key",
            "type": "string",
            "description": "Name for this watch, so several schedules on the same videos stay separate; defaults to a key derived from the input"
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Apify Proxy (datacenter) works for YouTube comments and is the cheapest option. Switch to RESIDENTIAL only if runs report rate limits. Comment pages are trimmed to about 10 KB each on the wire.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}