{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Comments Scraper (with Replies)",
    "description": "YouTube comments scraper for any video or Short, or the top videos of a search or channel. Rows have text, likes, reply count, date, public @handle and pinned and hearted flags, with replies after each comment. Top or newest first. No login, no API key. $0.25 per 1,000 comments.",
    "version": "0.1",
    "x-build-id": "6EHrJqZ8dg8oTyQCu"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/locaihost~youtube-comments/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-locaihost-youtube-comments",
        "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/locaihost~youtube-comments/runs": {
      "post": {
        "operationId": "runs-sync-locaihost-youtube-comments",
        "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/locaihost~youtube-comments/run-sync": {
      "post": {
        "operationId": "run-sync-locaihost-youtube-comments",
        "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 or Shorts links",
            "type": "array",
            "description": "Links to videos or Shorts (watch?v=, youtu.be/, /shorts/, /live/) or bare video ids. Each returns up to Max comments per video. A playlist link works too: its first videos (Videos per search, channel or playlist) are used.",
            "items": {
              "type": "string"
            }
          },
          "searchTerms": {
            "title": "Or: search terms",
            "type": "array",
            "description": "Optional. Comments on the top videos YouTube shows for each term, as many as Videos per search, channel or playlist.",
            "items": {
              "type": "string"
            }
          },
          "channels": {
            "title": "Or: channels",
            "type": "array",
            "description": "Optional. Comments on each channel's latest videos, as many as Videos per search, channel or playlist. Channel @handles, links or UC… ids.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Videos per search, channel or playlist",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "How many videos each search term, channel or playlist contributes. Video links always count as one video each.",
            "default": 5
          },
          "maxComments": {
            "title": "Max comments per video",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Most comment rows per video, replies included.",
            "default": 100
          },
          "commentsSort": {
            "title": "Comment order",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "Top comments (YouTube's default order) or newest first.",
            "default": "top"
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Also return replies, each right after the comment it answers, with parentId set. They count toward Max comments per video.",
            "default": false
          },
          "maxRepliesPerComment": {
            "title": "Replies per comment",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "With Replies on: the most replies returned under each comment, so a few huge threads don't use up Comments per video. 0 or empty = no cap beyond Comments per video."
          },
          "commentsNewerThan": {
            "title": "Comments newer than",
            "type": "string",
            "description": "Only comments posted after this: a date like 2026-10-01 or a period like \"24 hours\" or \"7 days\". Comments are then read newest first and each video's comments stop at the first older one (a pinned comment doesn't end them). Replies older than the cutoff are left out too. Left-out comments are free. Empty = every date."
          },
          "onlyNew": {
            "title": "Only new comments",
            "type": "boolean",
            "description": "Return only comments this input hasn't returned in an earlier run (within the latest Max comments per video). For daily or weekly comment monitoring. Skipped comments are not charged.",
            "default": false
          },
          "includeComments": {
            "title": "Comments",
            "type": "boolean",
            "description": "Always on in this Actor.",
            "default": true
          },
          "includeChannelInfo": {
            "title": "Channel row",
            "type": "boolean",
            "description": "Off in this Actor: channels only pick videos.",
            "default": false
          },
          "searchType": {
            "title": "Search type",
            "type": "string",
            "description": "Searches pick videos in this Actor.",
            "default": "videos"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}