{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Comments Scraper: Replies, Shorts & Video Comments",
    "description": "Scrape YouTube comments and replies, no login or API key: a YouTube comment scraper and comments extractor for video, Shorts and community post URLs, a channel, playlist or search. Full text, author, likes, reply count, date, pinned and hearted flags, the exact comment count. Newest or top.",
    "version": "0.1",
    "x-build-id": "DBxEeca5X22vaOfu2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/hyperbach~youtube-comments-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-hyperbach-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/hyperbach~youtube-comments-scraper/runs": {
      "post": {
        "operationId": "runs-sync-hyperbach-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/hyperbach~youtube-comments-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-hyperbach-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": "YouTube URLs or ids",
            "maxItems": 5000,
            "type": "array",
            "description": "Videos and Shorts (watch, youtu.be, /shorts/, /live/, /embed/ links or an 11-character id), community posts (/post/<id>), channels (URL, @handle or UC… id: their latest videos, see maxVideos and channelTab; a URL that ends in /shorts, /streams or /posts reads that tab), playlists (URL or PL… id) or search URLs. The leader's {\"url\": …} objects are read too. A value that names nothing is a free row that says why.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search keywords",
            "maxItems": 200,
            "type": "array",
            "description": "Keywords: the top maxVideos videos of each YouTube search are read, from the country in searchCountry (YouTube shows each country a different search).",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "maxComments": {
            "title": "Max comments per video",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "Comments read per video or post, in the order of sortCommentsBy; 0 = every comment YouTube lists. Replies are not counted in it (see maxRepliesPerComment). The summary row of each video says whether its list ended (COMPLETE), YouTube's list ended early (TRUNCATED) or this cap came first (CAPPED).",
            "default": 100
          },
          "sortCommentsBy": {
            "title": "Order",
            "enum": [
              "NEWEST_FIRST",
              "TOP_COMMENTS"
            ],
            "type": "string",
            "description": "YouTube's own two orders. Newest first walks every comment; Top comments is YouTube's ranking, which ends at about 1,000–1,200 comments on a famous video.",
            "default": "NEWEST_FIRST"
          },
          "oldestCommentDate": {
            "title": "Oldest comment date",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2}|\\d+\\s*(day|days|week|weeks|month|months|year|years)?)?$",
            "type": "string",
            "description": "Only comments published on or after this date: YYYY-MM-DD, or a number of days (\"1 day\" = today's comments, \"7 days\" = the last week), weeks, months or years. It reads newest first. YouTube shows a comment's age in words (\"3 weeks ago\"), so the cut-off works to that precision."
          },
          "includeReplies": {
            "title": "Replies",
            "type": "boolean",
            "description": "Read the replies of every comment delivered, each its own row with the parent comment's id (charged as a reply).",
            "default": false
          },
          "maxRepliesPerComment": {
            "title": "Max replies per comment",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "Replies read per comment when Replies is on; 0 = every reply.",
            "default": 0
          },
          "includeKeywords": {
            "title": "Only comments with these words",
            "maxItems": 200,
            "type": "array",
            "description": "Keep a comment only when its text contains one of these words or phrases as a whole word (any case: \"art\" does not keep \"start\"). A comment left out is free and does not count toward maxComments; a kept comment comes with all its replies.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "excludeKeywords": {
            "title": "Leave out comments with these words",
            "maxItems": 200,
            "type": "array",
            "description": "Leave out a comment whose text contains one of these words or phrases as a whole word (any case). Free.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "minLikes": {
            "title": "Min likes",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "Keep a comment only with at least this many likes (YouTube rounds likes past 999: \"1.6K\" counts as 1,600). 0 = every comment.",
            "default": 0
          },
          "maxVideos": {
            "title": "Max videos per channel, playlist or search",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Videos taken from each channel (newest first), playlist (in its order) or search (top results).",
            "default": 10
          },
          "channelTab": {
            "title": "Channel videos",
            "enum": [
              "videos",
              "shorts",
              "both"
            ],
            "type": "string",
            "description": "Which of a channel's lists maxVideos takes from.",
            "default": "videos"
          },
          "maxPosts": {
            "title": "Max community posts per channel",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "A channel's latest community posts whose comments are read too; 0 = none.",
            "default": 0
          },
          "searchCountry": {
            "title": "Country of the search",
            "enum": [
              "US",
              "GB",
              "CA",
              "AU",
              "NZ",
              "IE",
              "IN",
              "PK",
              "BD",
              "PH",
              "ID",
              "MY",
              "SG",
              "TH",
              "VN",
              "JP",
              "KR",
              "TW",
              "HK",
              "DE",
              "AT",
              "CH",
              "FR",
              "BE",
              "NL",
              "ES",
              "PT",
              "IT",
              "PL",
              "CZ",
              "RO",
              "HU",
              "GR",
              "SE",
              "NO",
              "DK",
              "FI",
              "TR",
              "UA",
              "IL",
              "AE",
              "SA",
              "EG",
              "MA",
              "NG",
              "KE",
              "ZA",
              "BR",
              "MX",
              "AR",
              "CO",
              "CL",
              "PE",
              "LK",
              "KZ",
              "NP"
            ],
            "type": "string",
            "description": "Where each keyword search is read from (YouTube shows each country a different search). A video's comments are the same everywhere.",
            "default": "US"
          },
          "onlyNew": {
            "title": "Only new comments (memory between runs)",
            "type": "boolean",
            "description": "Skip every comment an earlier run with the same memory delivered (free); newest first, a video's walk stops at the first comment delivered before. For a scheduled task.",
            "default": false
          },
          "stateStoreName": {
            "title": "Memory name",
            "pattern": "^([a-zA-Z0-9][a-zA-Z0-9._-]{0,63})?$",
            "type": "string",
            "description": "The name of the memory onlyNew keeps (letters, digits, '.', '_', '-'); empty = a name derived from the inputs.",
            "default": ""
          },
          "maxItems": {
            "title": "Max comments and replies (whole run)",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "The most charged rows (comments and replies) of the whole run; 0 = no cap beyond maxComments and your charge limit.",
            "default": 0
          },
          "proxyUrl": {
            "title": "Proxy URL",
            "type": "string",
            "description": "Your own proxy (scheme://user:pass@host:port) for every call instead of ours. Leave empty: the Actor brings its own connections at no cost to you."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}