{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper",
    "description": "[💰 $0.5 / 1K]  Extract YouTube videos, shorts, channels, and playlists from search queries, URLs, handles, or the Trending tab. Returns titles, view counts, like counts, publish dates, channel info, thumbnails, and durations with localization across 45+ countries and 19+ languages.",
    "version": "1.0",
    "x-build-id": "2CH46LDncsATseqev"
  },
  "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, handles, or Trending.",
            "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.",
            "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. The leading '@' is optional.",
            "items": {
              "type": "string"
            }
          },
          "getTrending": {
            "title": "Include Trending",
            "type": "boolean",
            "description": "Also pull the current Trending tab for the selected country.",
            "default": false
          },
          "maxResults": {
            "title": "Maximum Results per Source",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of rows per query, URL, or handle. For channel inputs with Shorts enabled, the cap applies to the combined videos + shorts total (not per tab). Set to 0 to fetch every available result (YouTube typically caps search at roughly 500-700 per query). The actor may return a few extra from the final page — it won't fetch additional pages once this number is reached.",
            "default": 50
          },
          "includeShorts": {
            "title": "Include Shorts on Channel Scrapes",
            "type": "boolean",
            "description": "When scraping a channel URL or handle, also pull the channel's Shorts tab in addition to the Videos tab. Shorts count toward the same Maximum Results cap as videos — videos are fetched first, then shorts fill any remaining slots.",
            "default": false
          },
          "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.",
            "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 are shown, Trending selection, and currency-equivalent metadata.",
            "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 extra row per channel with subscriber count, description, country, and creation date. Adds one extra result per channel.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}