{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper",
    "description": "Extract YouTube videos, shorts, channels, and playlists from search queries, URLs, or channel handles. Returns titles, view counts, publish dates, channel info, thumbnails, durations across 42 countries and 19 languages. Video and Shorts URLs also return exact like counts.",
    "version": "1.0",
    "x-build-id": "Jz5ZjOMoMKhCdlRU9"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/solidcode~youtube-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-solidcode-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/solidcode~youtube-scraper/runs": {
      "post": {
        "operationId": "runs-sync-solidcode-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/solidcode~youtube-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-solidcode-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 (e.g., 'mkbhd review', 'guitar tutorial'). Each query runs independently. Leave empty if you only want to scrape URLs or handles. To see what is popular right now, search a topic and set Sort By to \"View count\" with an Upload Date of \"Today\" or \"This week\" — YouTube retired its Trending page in 2025 and no longer publishes one.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "YouTube URLs",
            "type": "array",
            "description": "Paste YouTube URLs directly. Accepts video URLs (youtube.com/watch?v=...), channel URLs (/@handle, /channel/UC..., /c/..., /user/...), playlist URLs (/playlist?list=...), shorts URLs (/shorts/...), and search result URLs (/results?search_query=...). Mix any of these in one list. A channel link can name a tab and that tab is what you get: /@handle/shorts returns only that channel's Shorts, /@handle/videos only its regular videos, /@handle/streams only its past live streams.",
            "items": {
              "type": "string"
            }
          },
          "youtubeHandles": {
            "title": "Channel Handles",
            "type": "array",
            "description": "YouTube channel handles like '@mkbhd' or 'mkbhd'. Each handle resolves to that channel's Videos tab, or to its Shorts alone if you set Channel Content to \"Shorts only\". The leading '@' is optional.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Maximum Results per Source",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of rows per query, URL, or handle. This is a hard ceiling on what you are billed for that source — every row counts toward it, including the Shorts a channel scrape returns, the channel-details row when Fetch Channel Details is on, and the playlist summary row a playlist link returns. So a playlist link capped at 30 returns the playlist row plus 29 of its videos, never 31 rows. Set to 0 to fetch every available result (YouTube typically caps search at roughly 500-700 per query).",
            "default": 50
          },
          "includeShorts": {
            "title": "Include Shorts",
            "type": "boolean",
            "description": "Include YouTube Shorts in the results. Off (the default) returns long-form videos only, so a keyword search never spends your result budget on Shorts. On, a keyword search also returns the Shorts YouTube shows for that search, and a channel URL or handle also pulls the channel's Shorts tab in addition to the Videos tab. Shorts count toward the same Maximum Results cap as videos: on channel scrapes the cap is shared evenly between the two tabs, and whichever tab runs out first passes its unused slots to the other. Want a channel's Shorts and nothing else? Set Channel Content below to \"Shorts only\". Shorts found on a keyword search carry no publish date and no channel details — YouTube does not publish those on its Shorts shelf.",
            "default": false
          },
          "channelContent": {
            "title": "Channel Content",
            "enum": [
              "default",
              "videos",
              "shorts"
            ],
            "type": "string",
            "description": "Which part of a channel to export. Applies to channel handles and channel URLs only. \"Shorts only\" returns that channel's Shorts and nothing else, so you are never billed for regular videos you did not ask for — and a channel that posts no Shorts returns no rows instead of its videos. \"Regular videos only\" is the opposite: no Shorts, even with Include Shorts ticked. Leave it on the standard option to keep the usual behaviour. A channel link that already names a tab wins for that one link: youtube.com/@handle/shorts returns Shorts, /videos returns regular videos, /streams returns past live streams. Ignored for keyword searches, playlists, and single video or Shorts links."
          },
          "uploadDate": {
            "title": "Upload Date",
            "enum": [
              "any",
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Only include videos uploaded within this time window. Applies to keyword searches only.",
            "default": "any"
          },
          "duration": {
            "title": "Duration",
            "enum": [
              "any",
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "Filter search results by video length. Applies to keyword searches only.",
            "default": "any"
          },
          "sortBy": {
            "title": "Sort By",
            "enum": [
              "relevance",
              "uploadDate",
              "viewCount",
              "rating"
            ],
            "type": "string",
            "description": "Ordering for keyword-search results. Applies to keyword searches only. Rows are put in order before they are saved, so \"Upload date\" gives you the newest video first and \"View count\" the most-viewed first, all the way down the dataset. Two things to know: YouTube reports search upload dates rounded to the hour or day, so videos published inside the same reported window keep YouTube's order; and rows YouTube publishes no upload date or view count for (Shorts taken from its Shorts shelf) are placed at the end rather than dropped. Because the ordering covers the whole result set, the rows are saved when the search finishes rather than page by page; stop a run before then and everything it had already collected is waiting in that run's key-value store under PARTIAL-RESULTS. \"Relevance\" and \"Rating\" are YouTube's own rankings — it serves those results in its own order and publishes no rating value, so they are returned exactly as YouTube sent them.",
            "default": "relevance"
          },
          "features": {
            "title": "Video Features",
            "uniqueItems": true,
            "type": "array",
            "description": "Only include videos with these features. Multiple features can be combined. Applies to keyword searches only. \"Subtitles\" = videos with any caption track. \"Creative Commons\" = videos released under a CC license.",
            "items": {
              "type": "string",
              "enum": [
                "hd",
                "subtitles",
                "creativeCommons",
                "live",
                "4k",
                "360",
                "vr180",
                "3d",
                "hdr"
              ],
              "enumTitles": [
                "HD",
                "Subtitles (any language)",
                "Creative Commons",
                "Live",
                "4K",
                "360°",
                "VR180",
                "3D",
                "HDR"
              ]
            },
            "default": []
          },
          "country": {
            "title": "Country",
            "enum": [
              "us",
              "gb",
              "ca",
              "au",
              "nz",
              "ie",
              "fr",
              "de",
              "es",
              "it",
              "nl",
              "be",
              "pt",
              "ch",
              "at",
              "se",
              "no",
              "dk",
              "fi",
              "pl",
              "jp",
              "kr",
              "hk",
              "tw",
              "sg",
              "my",
              "th",
              "id",
              "ph",
              "vn",
              "in",
              "br",
              "mx",
              "ar",
              "cl",
              "co",
              "ae",
              "sa",
              "tr",
              "il",
              "za",
              "eg"
            ],
            "type": "string",
            "description": "Localize results to this country. Affects which videos YouTube surfaces for a search and the regional metadata returned with them.",
            "default": "us"
          },
          "language": {
            "title": "Language",
            "enum": [
              "en",
              "fr",
              "de",
              "es",
              "it",
              "pt",
              "nl",
              "pl",
              "tr",
              "ru",
              "ja",
              "ko",
              "zh-CN",
              "zh-TW",
              "ar",
              "he",
              "th",
              "vi",
              "id"
            ],
            "type": "string",
            "description": "Interface language for video titles and metadata returned in the response.",
            "default": "en"
          },
          "fetchChannelInfo": {
            "title": "Fetch Channel Details",
            "type": "boolean",
            "description": "When scraping a channel URL or handle, also emit one row per channel with subscriber count, description, country, and creation date. That row counts toward Maximum Results like any other row, so it never adds to your bill: a cap of 30 returns 29 videos plus the channel row, not 31 rows.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}