{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper (Videos, Shorts, Channels & Comments)",
    "description": "YouTube scraper for videos, Shorts, channels, playlists and search results. Rows have views, exact likes, comment count, length, exact upload time, tags, description and channel subscribers, plus comments with replies. New-only mode for schedules. No login. $0.50 per 1,000 videos.",
    "version": "0.1",
    "x-build-id": "yc3A6AT61rMFbGefI"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/locaihost~youtube-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-locaihost-youtube-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/locaihost~youtube-scraper/runs": {
      "post": {
        "operationId": "runs-sync-locaihost-youtube-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/locaihost~youtube-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-locaihost-youtube-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": {
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "What you would type into YouTube's search box (or a youtube.com/results link). Each term returns up to Max results videos (or channels, see Search type), with the filters below.",
            "items": {
              "type": "string"
            }
          },
          "channels": {
            "title": "Channels",
            "type": "array",
            "description": "Channel @handles, links or UC… ids (@MrBeast, https://www.youtube.com/@mkbhd, UCX6OQ3DkcsbYNE6H8uQQuVA). Each returns a channel row (subscribers, videos, total views, joined date, country, links) and its latest videos from the tabs chosen below.",
            "items": {
              "type": "string"
            }
          },
          "videoUrls": {
            "title": "Video or Shorts links",
            "type": "array",
            "description": "Links to single videos or Shorts (watch?v=, youtu.be/, /shorts/, /live/) or bare video ids. Add comments below to get each video's comments.",
            "items": {
              "type": "string"
            }
          },
          "playlistUrls": {
            "title": "Playlist links",
            "type": "array",
            "description": "Playlist links (youtube.com/playlist?list=…) or ids. Each returns up to Max results of its videos, in playlist order.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Any YouTube link: videos, channels, playlists, search result pages (their filters are kept), hashtag pages (youtube.com/hashtag/coldbrew) and channel tab links (youtube.com/@mkbhd/shorts reads only the Shorts tab; /videos and /streams work too). Each returns up to Max results.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Most videos (or channels) per search term, per channel tab and per playlist. 0 with channels returns the channel row only.",
            "default": 10
          },
          "videoDetails": {
            "title": "Full video details",
            "type": "boolean",
            "description": "Open every video for exact likes, exact upload time, full description, tags, category, comment count and channel subscribers. Same price either way; off is faster and returns only what the search, channel tab or playlist shows (title, views, length, relative date). Always on for video links and when comments are on.",
            "default": true
          },
          "searchType": {
            "title": "Search type",
            "enum": [
              "videos",
              "shorts",
              "live",
              "channels",
              "all"
            ],
            "type": "string",
            "description": "What a search returns. Channels returns channel rows (charged as channels).",
            "default": "videos"
          },
          "uploadDate": {
            "title": "Upload date",
            "enum": [
              "any",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Only videos uploaded within this time (YouTube's own Upload date filter).",
            "default": "any"
          },
          "duration": {
            "title": "Length",
            "enum": [
              "any",
              "under3",
              "3to20",
              "over20"
            ],
            "type": "string",
            "description": "Only videos of this length (YouTube's own Duration filter).",
            "default": "any"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "popularity"
            ],
            "type": "string",
            "description": "Relevance or Popularity, the two orders YouTube offers for search today.",
            "default": "relevance"
          },
          "features": {
            "title": "Features",
            "type": "array",
            "description": "Only videos that have all of these.",
            "items": {
              "type": "string",
              "enum": [
                "hd",
                "4k",
                "subtitles",
                "creativeCommons"
              ],
              "enumTitles": [
                "HD",
                "4K",
                "Subtitles/CC",
                "Creative Commons"
              ]
            },
            "default": []
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Only videos published on or after this: a date like 2026-10-01 (midnight UTC) or a period like \"7 days\", \"2 weeks\" or \"3 months\". A channel tab read newest first (and a search sorted by Upload date) stops at the first older video, so you get exactly the recent ones. Playlists and other orders aren't by date: older videos are skipped and the list goes on (it gives up after 10 pages in a row with nothing inside). Lists show only \"3 months ago\", so a video near the edge is opened for its exact upload time. Left-out videos are free and don't count toward Max results. Video links are always returned. Empty = any date."
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "Only videos published before this: a date like 2026-10-01 or a period like \"1 month\" (published more than a month ago). Newer videos are skipped, free, and the list goes on. Combine with Published after for a range. Video links are always returned. Empty = up to now."
          },
          "gl": {
            "title": "Region",
            "type": "string",
            "description": "Two-letter country code (GB, IN, DE…) for YouTube's region: which results a search shows and which videos are offered, as for a visitor in that country. Text stays in English, because counts and dates are read from English wording. Empty = US."
          },
          "channelTabs": {
            "title": "Channel tabs",
            "type": "array",
            "description": "Which of each channel's tabs to read, Max results videos from each. A channel without a tab (no Live tab, say) gets a free row saying so.",
            "items": {
              "type": "string",
              "enum": [
                "videos",
                "shorts",
                "streams"
              ],
              "enumTitles": [
                "Videos",
                "Shorts",
                "Live (past and current streams)"
              ]
            },
            "default": [
              "videos"
            ]
          },
          "channelSort": {
            "title": "Channel sort",
            "enum": [
              "newest",
              "popular",
              "oldest"
            ],
            "type": "string",
            "description": "Order of each channel tab's videos, as the tab's own Latest / Popular / Oldest buttons sort them.",
            "default": "newest"
          },
          "includeChannelInfo": {
            "title": "Channel row ($)",
            "type": "boolean",
            "description": "One row per channel with subscribers, number of videos, total views, joined date, country, description and links. Charged as a channel.",
            "default": true
          },
          "minSubscribers": {
            "title": "Min subscribers",
            "minimum": 0,
            "type": "integer",
            "description": "Channel searches only (Search type Channels): leave out channels with fewer subscribers. The count is checked on the search result first and on the channel's own page when the result hides it; a channel whose count YouTube doesn't show is left out. Left-out channels are free and don't count toward Max results. Empty = no limit."
          },
          "maxSubscribers": {
            "title": "Max subscribers",
            "minimum": 0,
            "type": "integer",
            "description": "Channel searches only: leave out channels with more subscribers (for finding smaller creators). Empty = no limit."
          },
          "minVideos": {
            "title": "Min videos",
            "minimum": 0,
            "type": "integer",
            "description": "Channel searches only: leave out channels with fewer public videos (checked on the channel's About panel). Empty = no limit."
          },
          "verifiedOnly": {
            "title": "Verified channels only",
            "type": "boolean",
            "description": "Channel searches only: keep only channels with YouTube's verified badge (music artists' badge included).",
            "default": false
          },
          "excludeChannels": {
            "title": "Exclude channels",
            "type": "array",
            "description": "Channel searches only: channels to leave out, as @handles, links or UC… ids (your own channel, or ones you already have).",
            "items": {
              "type": "string"
            }
          },
          "includeComments": {
            "title": "Comments ($)",
            "type": "boolean",
            "description": "Return each video's comments too, charged per comment. Each row carries the text, likes, reply count, date, the commenter's public @handle, and whether it is pinned or hearted by the creator. Videos with comments turned off get a free row saying so.",
            "default": false
          },
          "maxComments": {
            "title": "Comments per video",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Most comment rows per video, replies included.",
            "default": 20
          },
          "commentsSort": {
            "title": "Comment order",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "Top comments (YouTube's default order) or newest first.",
            "default": "top"
          },
          "includeReplies": {
            "title": "Replies",
            "type": "boolean",
            "description": "Also return replies, each right after the comment it answers, with parentId set. They count toward 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 videos and comments",
            "type": "boolean",
            "description": "Of the latest videos and comments (Max results / Comments per video), return only those this input hasn't returned in an earlier run. For daily or weekly schedules. Skipped rows are not charged. Channel rows are always returned (their counts change).",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}