{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Comments Scraper - Replies, Likes, Keyword Filters",
    "description": "[💰$0.10/1K] Scrape YouTube comments from videos, channels or a keyword search. Each row has text, likes, reply count, author, channel link, pin and heart flags and a bounded date interval, not a fake timestamp. Filter by likes, keywords and dates. A daily run emits only new comments. No login.",
    "version": "0.9",
    "x-build-id": "dbdC3CazTpT1JRwcD"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ai-lead-gen-tools~youtube-comments/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ai-lead-gen-tools-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/ai-lead-gen-tools~youtube-comments/runs": {
      "post": {
        "operationId": "runs-sync-ai-lead-gen-tools-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/ai-lead-gen-tools~youtube-comments/run-sync": {
      "post": {
        "operationId": "run-sync-ai-lead-gen-tools-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 links or ids",
            "type": "array",
            "description": "YouTube videos to read comments from. Accepts watch links, youtu.be links, Shorts and live links, or bare 11-character video ids. Up to 500 values.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "channelUrl": {
            "title": "Channel",
            "type": "string",
            "description": "Read comments from the latest videos of a channel. Accepts a channel link, an @handle or a UC channel id. Combined with `videosLimit`."
          },
          "videosLimit": {
            "title": "Videos per channel",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "How many of the channel's latest videos to read when `channelUrl` is set.",
            "default": 10
          },
          "searchQuery": {
            "title": "Search phrase",
            "type": "string",
            "description": "Find videos by a search phrase and read their comments. Combined with `searchVideoLimit`."
          },
          "searchVideoLimit": {
            "title": "Videos per search",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "How many videos to take from the search results when `searchQuery` is set.",
            "default": 10
          },
          "maxCommentsPerVideo": {
            "title": "Max comments per video",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Upper bound of top level comments read from one video.",
            "default": 200
          },
          "maxPagesPerVideo": {
            "title": "Max pages per video",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Upper bound of comment pages requested for one video. One page holds 20 comments.",
            "default": 20
          },
          "maxRepliesPerComment": {
            "title": "Max replies per comment",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "How many replies to read under each comment. Zero means replies are not requested at all and cost nothing.",
            "default": 0
          },
          "sortBy": {
            "title": "Comment order",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "`top` reads the default relevance order. `newest` reads newest first, which makes the incremental mode and the date early-exit work.",
            "default": "top"
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "When off, replies are dropped by a filter even if `maxRepliesPerComment` is above zero.",
            "default": true
          },
          "maxDepth": {
            "title": "Max reply depth",
            "minimum": 0,
            "maximum": 3,
            "type": "integer",
            "description": "Reply depth to keep. Top level comments are depth 0. YouTube returns replies flat, so depth 1 is the practical maximum.",
            "default": 1
          },
          "minLikes": {
            "title": "Min likes",
            "minimum": 0,
            "type": "integer",
            "description": "Drop comments with fewer likes. Zero disables the filter.",
            "default": 0
          },
          "maxLikes": {
            "title": "Max likes",
            "minimum": 0,
            "type": "integer",
            "description": "Drop comments with more likes. Empty disables the filter."
          },
          "commentsSince": {
            "title": "Comments since",
            "type": "string",
            "description": "Keep comments whose publication interval overlaps this date or later. ISO date or datetime. YouTube shows comment age as text, so the real timestamp is a range, not a point: a comment is kept when its range reaches this date."
          },
          "commentsUntil": {
            "title": "Comments until",
            "type": "string",
            "description": "Keep comments whose publication interval starts at or before this date. Same range semantics as `commentsSince`."
          },
          "includeTerms": {
            "title": "Include words",
            "type": "array",
            "description": "Keep only comments containing at least one of these words. Case insensitive. Empty means no word filter.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "excludeTerms": {
            "title": "Exclude words",
            "type": "array",
            "description": "Drop comments containing any of these words. Applied after the include list.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "onlyQuestions": {
            "title": "Only questions",
            "type": "boolean",
            "description": "Keep comments containing a question mark.",
            "default": false
          },
          "excludeCreatorReplies": {
            "title": "Exclude creator replies",
            "type": "boolean",
            "description": "Drop replies written by the channel that owns the video.",
            "default": false
          },
          "onlyNewSinceLastRun": {
            "title": "Only new comments",
            "type": "boolean",
            "description": "Remember the ids already emitted and push only comments not seen in previous runs. State lives in the named store and is addressed by `stateName` or by the inputs.",
            "default": false
          },
          "stateName": {
            "title": "State name",
            "type": "string",
            "description": "Name of the incremental state. Set the same value across runs of one schedule to keep them in one bucket."
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many comments. Zero means no limit.",
            "default": 0
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many videos are read in parallel.",
            "default": 4
          },
          "sameDomainDelaySecs": {
            "title": "Delay between requests",
            "minimum": 0,
            "maximum": 30,
            "type": "number",
            "description": "Minimum gap between two requests to youtube.com, in seconds.",
            "default": 0.5
          },
          "requestTimeoutSecs": {
            "title": "Request timeout",
            "minimum": 5,
            "maximum": 180,
            "type": "integer",
            "description": "Timeout of one HTTP request, in seconds.",
            "default": 30
          },
          "runBudgetSecs": {
            "title": "Run budget",
            "minimum": 30,
            "maximum": 3600,
            "type": "integer",
            "description": "Soft time limit for the run, in seconds. When reached, the actor stops starting new requests and finishes with a partial result."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional Apify Proxy. Not needed for YouTube comments: the comment endpoint answers datacenter addresses.",
            "default": {
              "useApifyProxy": 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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}