{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Channel & Video Scraper: Search, Shorts, Stats",
    "description": "Scrape YouTube channels, playlists and search results with full video metadata: title, description, exact publish date, duration, views, likes, comment count, tags, category, thumbnails, Shorts and live flags. Optional channel profile with subscribers, total views, links, join date and country.",
    "version": "1.0",
    "x-build-id": "OrSrFbsMgKSlacEZe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/zhtech~youtube-channel-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-zhtech-youtube-channel-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/zhtech~youtube-channel-scraper/runs": {
      "post": {
        "operationId": "runs-sync-zhtech-youtube-channel-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/zhtech~youtube-channel-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-zhtech-youtube-channel-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": {
          "urls": {
            "title": "Channels, playlists or videos",
            "type": "array",
            "description": "Channel URLs or @handles (youtube.com/@name, /channel/UC..., /c/name, /user/name, a tab such as /@name/shorts), playlist URLs, video or Shorts URLs, bare video IDs, or YouTube search result URLs.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "Search YouTube like the search bar does. Use the search filters below for upload date, type, duration, features and sort order.",
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerSource": {
            "title": "Max videos per channel, playlist or search",
            "minimum": 0,
            "type": "integer",
            "description": "How many videos to return from each channel, playlist or search query. 0 means all (a search returns up to about 500 to 600 results).",
            "default": 20
          },
          "maxVideos": {
            "title": "Max videos in total",
            "minimum": 0,
            "type": "integer",
            "description": "Stop the whole run after this many video rows. 0 means no limit. Your maximum cost per run setting is always respected too.",
            "default": 0
          },
          "channelContentTypes": {
            "title": "Channel content",
            "type": "array",
            "description": "Which uploads of a channel to include. A channel URL that names a tab (for example /@name/shorts) uses only that tab.",
            "items": {
              "type": "string",
              "enum": [
                "videos",
                "shorts",
                "streams"
              ],
              "enumTitles": [
                "Videos",
                "Shorts",
                "Past live streams"
              ]
            },
            "default": [
              "videos",
              "shorts",
              "streams"
            ]
          },
          "channelSort": {
            "title": "Channel video order",
            "enum": [
              "newest",
              "popular",
              "oldest"
            ],
            "type": "string",
            "description": "Order of channel uploads. Popular and oldest use the sort buttons on each channel tab (videos, Shorts, live).",
            "default": "newest"
          },
          "includeChannelInfo": {
            "title": "Add a channel profile record",
            "type": "boolean",
            "description": "For every channel input, add one row with type = channel: subscribers, total views, video count, description, links, join date, country, avatar and banner. Charged as one channel record.",
            "default": true
          },
          "channelInfoOnly": {
            "title": "Channel profiles only (no videos)",
            "type": "boolean",
            "description": "Only return the channel profile record for each channel input and skip its videos. Handy for subscriber and contact research across many channels.",
            "default": false
          },
          "searchSort": {
            "title": "Sort search results by",
            "type": "string",
            "description": "Order of search results. These are the only two orders YouTube still applies. YouTube removed sorting by upload date and rating in 2025 (it silently ignores them): for recent results use the upload date filter or Published after. Old saved inputs with \"date\" run in relevance order and \"rating\" runs as popularity, with a note in the log.",
            "default": "relevance"
          },
          "searchUploadDate": {
            "title": "Upload date",
            "enum": [
              "any",
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Only results uploaded within this period.",
            "default": "any"
          },
          "searchType": {
            "title": "Result type",
            "enum": [
              "video",
              "shorts",
              "movie"
            ],
            "type": "string",
            "description": "Videos, Shorts or movies.",
            "default": "video"
          },
          "searchDuration": {
            "title": "Duration",
            "type": "string",
            "description": "Only results of this length, the same choices as YouTube's Filters dialog. Old saved values still work: short (under 4 minutes), medium (4 to 20 minutes) and long (over 20 minutes).",
            "default": "any"
          },
          "searchFeatures": {
            "title": "Features",
            "type": "array",
            "description": "Only results with all of these features.",
            "items": {
              "type": "string",
              "enum": [
                "live",
                "4k",
                "hd",
                "subtitles",
                "creativeCommons",
                "360",
                "vr180",
                "3d",
                "hdr",
                "location",
                "purchased"
              ],
              "enumTitles": [
                "Live",
                "4K",
                "HD",
                "Subtitles/CC",
                "Creative Commons",
                "360 degrees",
                "VR180",
                "3D",
                "HDR",
                "Location",
                "Purchased"
              ]
            }
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Only videos published on or after this date or within this period (for example 30 days). Checked against the exact publish date. For newest first channel lists, listing stops as soon as older videos appear."
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "Only videos published before this date."
          },
          "titleKeywords": {
            "title": "Title contains",
            "type": "array",
            "description": "Keep only videos whose title contains at least one of these words or phrases (not case sensitive).",
            "items": {
              "type": "string"
            }
          },
          "minViews": {
            "title": "Minimum views",
            "minimum": 0,
            "type": "integer",
            "description": "Skip videos with fewer views. 0 means no minimum.",
            "default": 0
          },
          "includeDescription": {
            "title": "Include full description",
            "type": "boolean",
            "description": "Full video description text (hashtags and tags are always included).",
            "default": true
          },
          "includeCommentCount": {
            "title": "Include comment count",
            "type": "boolean",
            "description": "Adds the comment count (one extra small request per video). Turn off for the fastest runs.",
            "default": true
          },
          "includeErrorItems": {
            "title": "Include rows for failed videos",
            "type": "boolean",
            "description": "Add a free (never charged) row for each private, removed or blocked video so you can see what happened.",
            "default": true
          },
          "onlyNewVideos": {
            "title": "Only new videos (for scheduled runs)",
            "type": "boolean",
            "description": "Remember which videos earlier runs returned (under the state key below) and skip them. Ideal for daily monitoring of channels or searches.",
            "default": false
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Name of the memory used by Only new videos. Use a different key for each separate monitoring job.",
            "default": "default"
          },
          "maxConcurrency": {
            "title": "Videos in parallel",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many videos to scrape at the same time.",
            "default": 10
          },
          "maxRetries": {
            "title": "Retries per request",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Retries with a fresh proxy session when YouTube refuses a request.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Apify Proxy datacenter IPs work for most runs. Requests that YouTube blocks are retried on residential IPs automatically.",
            "default": {
              "useApifyProxy": true
            }
          },
          "residentialFallback": {
            "title": "Residential fallback",
            "type": "boolean",
            "description": "When YouTube blocks the datacenter proxy, retry those requests on residential IPs. Recommended.",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}