{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Videos Scraper: Search, Channels, Playlists, Shorts",
    "description": "YouTube videos scraper: title, video ID, channel, view count, publish time, duration and Shorts flag; full details add likes, comment count and description. Takes search keywords or YouTube channel, playlist and video URLs, no API key. Use it to research YouTube search results and channel videos.",
    "version": "1.0",
    "x-build-id": "zOPpMMb6DH5qJuvh8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tamnt67~youtube-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tamnt67-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/tamnt67~youtube-scraper/runs": {
      "post": {
        "operationId": "runs-sync-tamnt67-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/tamnt67~youtube-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-tamnt67-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": {
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "Keywords to search on YouTube, one per line. Each query is scraped separately.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "YouTube URLs",
            "type": "array",
            "description": "Optional. Channel URLs (https://www.youtube.com/@mkbhd, also /@mkbhd/shorts or /@mkbhd/streams), playlist URLs (youtube.com/playlist?list=...), video URLs (youtube.com/watch?v=... or youtu.be/...) and search result URLs (youtube.com/results?search_query=...).",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxResultsPerQuery": {
            "title": "Max results per query or URL",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Stop after this many videos, channels or playlists for each query or URL. YouTube returns about 20 search results or 30 channel videos per page.",
            "default": 50
          },
          "videoDetails": {
            "title": "Fetch full video details",
            "type": "boolean",
            "description": "For every video also fetch the exact view count, likes, comment count, publish date, category, keywords, full description, length in seconds and channel subscribers. Two extra requests per video, so runs take longer. Single video URLs always get full details.",
            "default": false
          },
          "searchType": {
            "title": "Search result type",
            "enum": [
              "video",
              "any",
              "channel",
              "playlist",
              "movie"
            ],
            "type": "string",
            "description": "Applies to search queries only.",
            "default": "video"
          },
          "searchSortBy": {
            "title": "Search sort order",
            "enum": [
              "relevance",
              "upload_date",
              "view_count",
              "rating"
            ],
            "type": "string",
            "description": "Applies to search queries only.",
            "default": "relevance"
          },
          "uploadDate": {
            "title": "Upload date filter",
            "enum": [
              "any",
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Applies to search queries only.",
            "default": "any"
          },
          "videoDuration": {
            "title": "Video duration filter",
            "enum": [
              "any",
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "Applies to search queries only.",
            "default": "any"
          },
          "searchFeatures": {
            "title": "Search features filter",
            "type": "array",
            "description": "Applies to search queries only. Same as the \"Features\" part of YouTube's search filter menu: only videos that have all selected features. Leave empty for no feature filter.",
            "items": {
              "type": "string",
              "enum": [
                "live",
                "4k",
                "hd",
                "subtitles",
                "creative_commons",
                "360",
                "vr180",
                "3d",
                "hdr",
                "purchased"
              ],
              "enumTitles": [
                "Live",
                "4K",
                "HD",
                "Subtitles/CC",
                "Creative Commons",
                "360°",
                "VR180",
                "3D",
                "HDR",
                "Purchased"
              ]
            }
          },
          "includeShorts": {
            "title": "Include Shorts in search results",
            "type": "boolean",
            "description": "YouTube mixes Shorts into search results. They are flagged with isShort: true.",
            "default": true
          },
          "publishedAfter": {
            "title": "Only videos published after",
            "type": "string",
            "description": "Optional. A date (2026-01-31) or a period back from today (\"7 days\", \"2 weeks\", \"3 months\", \"1 year\"). Applies to search, channel and playlist results. Without full video details the date comes from YouTube's relative text (\"3 days ago\"), so it is approximate; Shorts and items with no date are kept. Channel newest-first lists and search sorted by upload date stop at the first older video."
          },
          "channelVideosSort": {
            "title": "Channel videos order",
            "enum": [
              "newest",
              "popular",
              "oldest"
            ],
            "type": "string",
            "description": "Applies to channel URLs only.",
            "default": "newest"
          },
          "maxShortsPerChannel": {
            "title": "Also scrape Shorts per channel",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Channel URLs only. Besides the videos, also save up to this many Shorts from the channel's Shorts tab (isShort: true). 0 = no Shorts (the default). Not used for /shorts or /streams URLs."
          },
          "maxStreamsPerChannel": {
            "title": "Also scrape live streams per channel",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Channel URLs only. Besides the videos, also save up to this many past or current live streams from the channel's Live tab. 0 = no streams (the default). Not used for /shorts or /streams URLs."
          },
          "language": {
            "title": "Interface language",
            "type": "string",
            "description": "Two-letter language code for localized text such as \"3 days ago\" (en, de, fr, es, pt, ja, vi...).",
            "default": "en"
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "Two-letter country code YouTube uses to localize search results (US, GB, DE, IN, BR...).",
            "default": "US"
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Apify datacenter proxy works for YouTube. Switch to residential only if runs start failing.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}