{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Comments Scraper — Comments API & Export | $0.40/1k",
    "description": "Export YouTube comments and replies without an API key: text, likes, reply count, posting time, pinned, hearted and creator flags. Privacy-safe: no commenter names, handles or profiles. Built for sentiment analysis and market research. $0.40 per 1,000 comments.",
    "version": "0.1",
    "x-build-id": "svBEdzfPcUaO5D8jH"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/glasswing~youtube-comments-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-glasswing-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/glasswing~youtube-comments-scraper/runs": {
      "post": {
        "operationId": "runs-sync-glasswing-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/glasswing~youtube-comments-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-glasswing-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 video URLs or IDs",
            "uniqueItems": true,
            "type": "array",
            "description": "One per line. Accepted: watch?v= links, youtu.be links, /shorts/, /live/ and /embed/ links, and bare 11-character video IDs. Channel, playlist and youtube.com/results links also work here (they are read like the fields below).",
            "default": [
              "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
            ],
            "items": {
              "type": "string"
            }
          },
          "channels": {
            "title": "Channels (comments of their newest videos)",
            "type": "array",
            "description": "Channel links, @handles or channel IDs (UC...). For each channel, the newest videos of its Videos tab are read (up to 'Max videos per channel, playlist or search'), and the comments of each video are saved. Rows say source = channel.",
            "items": {
              "type": "string"
            }
          },
          "playlists": {
            "title": "Playlists",
            "type": "array",
            "description": "Playlist links or playlist IDs (PL...). The videos are read in playlist order. Rows say source = playlist.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search terms (comments of the top videos)",
            "type": "array",
            "description": "YouTube search terms, e.g. 'iphone 17 review'. The top video results (YouTube's relevance order, videos only) are read. Rows say source = search.",
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerSource": {
            "title": "Max videos per channel, playlist or search",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many videos to read from each channel, playlist or search term. Video links in the first field are always read.",
            "default": 10
          },
          "maxComments": {
            "title": "Max comments per video",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Top-level comments to save for each video, in the chosen sort order. YouTube serves about 20 per request. Replies (if switched on) come on top of this number.",
            "default": 50
          },
          "sortBy": {
            "title": "Sort comments by",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "'Top comments' is YouTube's default ranking (most liked and engaged first, pinned comment on top). 'Newest first' is reverse chronological.",
            "default": "top"
          },
          "commentsSince": {
            "title": "Only comments since",
            "type": "string",
            "description": "Keep only comments posted on or after this date: an absolute date (2026-10-01) or a span back from now (7 days, 2 weeks, 3 months, 1 year). YouTube shows only relative times ('3 weeks ago'), so the cut is approximate at that resolution. With 'Newest first' the Actor stops reading a video at the first older comment; with 'Top comments' it reads on and filters. Filtered-out comments are never charged."
          },
          "keywords": {
            "title": "Only comments containing",
            "type": "array",
            "description": "Keep only comments whose text contains at least one of these words or phrases (case-insensitive), e.g. a product name, 'refund' or 'bug'.",
            "items": {
              "type": "string"
            }
          },
          "minLikes": {
            "title": "Minimum likes",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only comments with at least this many likes. 0 = no filter.",
            "default": 0
          },
          "includeVideoDetails": {
            "title": "Add video details to every row",
            "type": "boolean",
            "description": "Add the video's view count, like count, upload date and the channel's ID, link and subscriber count to each row. Read from the same request the Actor already makes, so it costs nothing extra.",
            "default": false
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Also save the replies under each saved comment (each reply is one row with isReply = true and parentCommentId). One extra request per comment that has replies.",
            "default": false
          },
          "maxRepliesPerComment": {
            "title": "Max replies per comment",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Only used when 'Include replies' is on. Replies come in YouTube's order, about 10 per request.",
            "default": 10
          },
          "maxItems": {
            "title": "Maximum results (total)",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many rows have been saved in total, across all videos. Each saved comment or reply with status `ok` is one billable result. Keep it small for test runs.",
            "default": 1000
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Proxy (datacenter, the default group) is on by default: YouTube starts refusing one server's requests after a few hundred calls in a row, and spreading them over datacenter IPs keeps large runs clean. Residential proxies are not needed.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}