{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper (Videos, Shorts, Channels & Comments)",
    "description": "Scrape YouTube videos, Shorts, channels, playlists and search results. Get title, views, likes, comment count, subscribers, length, exact upload time, tags and description, channel joined date and country, plus comments with replies. Search filters, new-only mode. No login. $0.50 per 1,000 videos.",
    "version": "0.1",
    "x-build-id": "Sa3GYSMB48WRM7Xpx"
  },
  "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"
            }
          },
          "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": "YouTube's own two orders. For the newest, combine Relevance with an upload date such as Today or This week.",
            "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": []
          },
          "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
          },
          "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
          },
          "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}