{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Video Scraper",
    "description": "Scrape YouTube video titles, descriptions, channels, thumbnails, durations and available view counts from video URLs, channels or search queries. Export results to JSON, CSV or Excel.",
    "version": "0.9",
    "x-build-id": "i6ZMb7u8UQ2RdJYhV"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/thescrapelab~youtube-video-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-thescrapelab-youtube-video-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/thescrapelab~youtube-video-scraper/runs": {
      "post": {
        "operationId": "runs-sync-thescrapelab-youtube-video-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/thescrapelab~youtube-video-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-thescrapelab-youtube-video-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": {
          "targets": {
            "title": "Videos, channels or search queries",
            "minItems": 1,
            "maxItems": 20,
            "type": "array",
            "description": "Enter public YouTube video or channel URLs, channel handles such as @OpenAI, or search phrases. Mix up to 20 sources in one run; each is processed in the order entered. Only initial public channel/search pages are collected.",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2000
            }
          },
          "maxItems": {
            "title": "Maximum videos",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum live YouTube video records to return.",
            "default": 1
          },
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "YouTube searches. Collects the initial public results page, without pagination.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "channels": {
            "title": "Channels",
            "type": "array",
            "description": "Channel handles such as @OpenAI, channel IDs, or YouTube channel URLs. Collects the initial videos page.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "maxTotalVideos": {
            "title": "Maximum total results",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Optional additional cap on results; zero uses Maximum videos.",
            "default": 0
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Alias for searchQueries.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "maxVideosPerKeyword": {
            "title": "Max videos per keyword",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "JSON/API override for maximum delivered videos from each initial search page. Shared targets use Maximum videos automatically; legacy requests without targets retain the runtime default of 10."
          },
          "maxVideosPerChannel": {
            "title": "Max videos per channel",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "JSON/API override for maximum delivered videos from each initial channel page. Shared targets use Maximum videos automatically; legacy requests without targets retain the runtime default of 10."
          },
          "deduplicateVideos": {
            "title": "Deduplicate videos",
            "type": "boolean",
            "description": "Keep one result per video ID across sources.",
            "default": true
          },
          "includeLikeCount": {
            "title": "Include like counts (legacy)",
            "type": "boolean",
            "description": "Compatibility setting. Exact like counts are not reliably exposed on public HTML pages and are left unknown.",
            "default": false
          },
          "useYtDlpFallback": {
            "title": "Use yt-dlp fallback (legacy)",
            "type": "boolean",
            "description": "Compatibility setting. Does not change automatic public metadata retrieval; no downloader is launched.",
            "default": true
          },
          "useApifyProxyFallback": {
            "title": "Use Apify Proxy fallback",
            "type": "boolean",
            "description": "Opt in to potentially paid native Apify Proxy retries. Disabled unless explicitly true. At most two retries per discovery page and one retry per video description, within the shared request and time limits.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Max concurrency (legacy)",
            "minimum": 1,
            "maximum": 12,
            "type": "integer",
            "description": "Compatibility setting. Three workers retrieve descriptions in discovery order; the free mirror backup allows one request at a time.",
            "default": 2
          },
          "requestTimeoutSecs": {
            "title": "Request timeout seconds",
            "minimum": 5,
            "maximum": 45,
            "type": "integer",
            "description": "Upper bound per request attempt. Native metadata also has an eight-second maximum and mirror requests a five-second maximum; all collection shares a 150-second deadline.",
            "default": 12
          },
          "analysisQuery": {
            "title": "Find a phrase",
            "type": "string",
            "description": "Optional literal phrase to find in the returned records. Matches are saved in EVIDENCE_ANALYSIS."
          },
          "maxPublicPages": {
            "title": "Maximum public page requests",
            "minimum": 1,
            "maximum": 1560,
            "type": "integer",
            "description": "Optional total HTTP request cap across discovery, native metadata, watch pages, mirror backup, redirects and retries. Automatic allowance: 4 × (Maximum videos + unique sources) + 2, or 5 × that sum + 2 when paid proxy fallback is explicitly enabled; capped at 1,560. Explicit overrides are honored."
          },
          "proxyConfiguration": {
            "title": "Proxy retry configuration",
            "type": "object",
            "description": "Used only when useApifyProxyFallback is explicitly true. Providing this configuration alone does not enable proxies. Enabled fallback uses residential proxies when no configuration is supplied."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}