{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper — Video Metadata, Channel Stats & Search",
    "description": "Scrape YouTube video metadata, channel stats and search results: views, likes, comments, tags, upload dates, subscribers and latest uploads from links, @handles or keywords. No transcripts. USD 2 per 1,000 records.",
    "version": "1.0",
    "x-build-id": "ksLYpRka1rh7N1m5i"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/muhammadafzal~youtube-video-channel-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-muhammadafzal-youtube-video-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/muhammadafzal~youtube-video-channel-scraper/runs": {
      "post": {
        "operationId": "runs-sync-muhammadafzal-youtube-video-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/muhammadafzal~youtube-video-channel-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-muhammadafzal-youtube-video-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": {
          "videoUrls": {
            "title": "YouTube video links or IDs",
            "maxItems": 500,
            "type": "array",
            "description": "Use this when you know the videos and want their full metadata: title, description, views, likes, comments, duration, upload date, tags, category and channel. Accepts watch links (https://www.youtube.com/watch?v=jNQXAC9IVRw), youtu.be, Shorts, embed and live links, or the bare 11-character ID. Playlist and channel links are not expanded. Duplicates are removed before any work. Up to 500.",
            "items": {
              "type": "string"
            }
          },
          "channelHandles": {
            "title": "Channel @handles",
            "maxItems": 100,
            "type": "array",
            "description": "Use this for channel stats: name, channel ID, subscribers, total videos, total views, join date, country, description, links and the latest uploads. Enter the @handle shown on the channel page (@MrBeast) or a link such as https://www.youtube.com/@MrBeast. Channel IDs (UC…) and old /c/ or /user/ links are not supported. Up to 100.",
            "items": {
              "type": "string"
            }
          },
          "latestVideos": {
            "title": "Latest uploads per channel",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Use this to choose how many of each channel's newest uploads are listed inside its record (title, link, views, age). 0 returns the channel details only. Included in the channel record's price. Default 10, at most 100.",
            "default": 10
          },
          "searchQueries": {
            "title": "Search words",
            "maxItems": 20,
            "type": "array",
            "description": "Use this to find videos (or channels) the way the YouTube search box does, for example \"espresso machine review\". Each query returns up to 20 results, or up to about 700 with deep search. A video found by several queries is delivered once. Up to 20 queries.",
            "items": {
              "type": "string"
            }
          },
          "maxResultsPerQuery": {
            "title": "Results per search",
            "minimum": 1,
            "maximum": 700,
            "type": "integer",
            "description": "Use this to cap the results kept per search query. One search page returns at most 20; values above 20 need deep search turned on. Default 20, at most 700.",
            "default": 20
          },
          "deepSearch": {
            "title": "Deep search (up to about 700 results per query)",
            "type": "boolean",
            "description": "Use this when you need more than 20 results per query. A deep search takes about 30 to 60 seconds per query and returns up to about 700 results (447 to 576 unique videos measured for \"coffee\"). Queries then run one at a time. Default: off.",
            "default": false
          },
          "searchType": {
            "title": "Search result type",
            "enum": [
              "video",
              "channel",
              "movie"
            ],
            "type": "string",
            "description": "Use this to choose what a search returns: videos (default), channels (name, @handle, subscribers, description), or movies and shows. Playlist search is not supported.",
            "default": "video"
          },
          "sortBy": {
            "title": "Sort search results by",
            "enum": [
              "relevance",
              "upload_date",
              "view_count",
              "rating"
            ],
            "type": "string",
            "description": "Use this to order search results like YouTube's filter menu: relevance (default), upload date, view count or rating.",
            "default": "relevance"
          },
          "uploadDate": {
            "title": "Upload date filter",
            "enum": [
              "any",
              "last_hour",
              "today",
              "this_week",
              "this_month",
              "this_year"
            ],
            "type": "string",
            "description": "Use this to keep only search results uploaded within a period: last hour, today, this week, this month or this year. Default: any time.",
            "default": "any"
          },
          "duration": {
            "title": "Video length filter",
            "enum": [
              "any",
              "under4",
              "4to20",
              "over20"
            ],
            "type": "string",
            "description": "Use this to keep only search results of a length: under 4 minutes, 4 to 20 minutes, or over 20 minutes. Default: any length.",
            "default": "any"
          },
          "searchCountry": {
            "title": "Search country",
            "minLength": 2,
            "maxLength": 2,
            "type": "string",
            "description": "Use this to search YouTube as seen from one country, as a two-letter code: US, GB, DE, IN, BR. Applies to search only. Default: US.",
            "default": "US"
          },
          "includeTrainingPermission": {
            "title": "Add AI-training permission",
            "type": "boolean",
            "description": "Use this to add each video's AI-training permission: whether the rights holder allows third parties to train AI models on it, and which ones. This is the rights holder's own declaration on YouTube, not legal clearance. Optional: each successful check is charged as a separate event (see Pricing), at most 500 per run. Default: off.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}