{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Video, Channel & Search Scraper — Fast Direct API",
    "description": "Fast no-browser YouTube scraper for search queries, channels (Videos, Shorts, Streams), playlists, and direct video URLs. Includes upload-date filters, exact views, tags, descriptions, and captions metadata at one flat rate.",
    "version": "0.1",
    "x-build-id": "tnVHanaeBeJ14HT51"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/leopoldsaint~youtube-video-channel-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-leopoldsaint-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/leopoldsaint~youtube-video-channel-scraper/runs": {
      "post": {
        "operationId": "runs-sync-leopoldsaint-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/leopoldsaint~youtube-video-channel-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-leopoldsaint-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": {
          "searchQueries": {
            "title": "Search Queries",
            "type": "array",
            "description": "YouTube search keywords to scrape matching videos for.",
            "default": [
              "ai agents workflow"
            ],
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Channel, Playlist, or Video URLs / @Handles",
            "type": "array",
            "description": "Direct YouTube channel URLs (e.g. https://www.youtube.com/@mkbhd), @handles, playlist URLs, or video URLs/IDs.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "channelTab": {
            "title": "Channel Tab (when scraping channels)",
            "enum": [
              "videos",
              "shorts",
              "streams"
            ],
            "type": "string",
            "description": "Which channel tab to scrape when a channel URL or @handle has no tab suffix.",
            "default": "videos"
          },
          "uploadDate": {
            "title": "Upload Date Filter (Search — Free, no add-on fee)",
            "enum": [
              "any",
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Filter search queries by upload recency.",
            "default": "any"
          },
          "sortBy": {
            "title": "Sort Order (Search)",
            "enum": [
              "relevance",
              "uploadDate",
              "viewCount",
              "rating"
            ],
            "type": "string",
            "description": "How YouTube search results are sorted.",
            "default": "relevance"
          },
          "maxResultsPerSource": {
            "title": "Max Videos per Query / Channel / Playlist",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum videos collected per individual search query, channel, or playlist.",
            "default": 20
          },
          "maxTotalVideos": {
            "title": "Max Total Videos",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Global maximum number of videos output across the run.",
            "default": 25
          },
          "includeVideoDetails": {
            "title": "Enrich Full Video Details (exact views, publishDate, description, tags, captions)",
            "type": "boolean",
            "description": "Fetches full player metadata per video for exact view counts, full description, tags, category, and available caption languages (included at no extra cost).",
            "default": true
          },
          "minViews": {
            "title": "Minimum View Count Filter",
            "minimum": 0,
            "type": "integer",
            "description": "Optional minimum view count threshold (0 = no filter).",
            "default": 0
          },
          "country": {
            "title": "Country Code (gl)",
            "type": "string",
            "description": "2-letter ISO country code for YouTube search localization (e.g. US, GB, DE, IN).",
            "default": "US"
          },
          "language": {
            "title": "Language Code (hl)",
            "type": "string",
            "description": "Interface language code (e.g. en, es, fr, de).",
            "default": "en"
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Optional Apify Proxy fallback if direct cloud detail requests are rate-limited.",
            "default": {
              "useApifyProxy": true
            }
          },
          "demoMode": {
            "title": "Demo Mode",
            "type": "boolean",
            "description": "Return deterministic sample video records without making live network calls.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}