{
  "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.4",
    "x-build-id": "0KXsgu3G2gEUo3MKZ"
  },
  "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": {
          "providedRecords": {
            "title": "Your records (JSON)",
            "type": "array",
            "description": "Paste records you have permission to process. These are normalized, validated and deduplicated without fetching their original websites. Use this OR a supplied dataset ID. Invalid web URLs, non-finite values and negative prices or counts are rejected. Unknown values remain unknown.",
            "items": {
              "type": "object"
            }
          },
          "providedDatasetId": {
            "title": "Your Apify dataset ID",
            "type": "string",
            "description": "Optional 17-character ID of a dataset you can access. Clear the JSON records to [] when using a dataset. Only a bounded number of records is read."
          },
          "maxItems": {
            "title": "Maximum videos",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum video records to return. For uploaded records, bounds the records scanned, including rejected and duplicate rows.",
            "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": []
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "YouTube video URLs or channel URLs. Shorts and youtu.be links are supported.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "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": "Maximum initial-page videos per search query.",
            "default": 10
          },
          "maxVideosPerChannel": {
            "title": "Max videos per channel",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum initial-page videos per channel.",
            "default": 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. No downloader or source API fallback is used.",
            "default": true
          },
          "useApifyProxyFallback": {
            "title": "Use Apify Proxy fallback",
            "type": "boolean",
            "description": "Opt in to potentially paid Apify Proxy retries for blocked or missing public metadata. Disabled unless explicitly true, including API calls. At most two retries within maxPublicPages. No paid data API is called.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Max concurrency (legacy)",
            "minimum": 1,
            "maximum": 12,
            "type": "integer",
            "description": "Compatibility setting. Public page requests run sequentially to keep request budgets predictable.",
            "default": 2
          },
          "requestTimeoutSecs": {
            "title": "Request timeout seconds",
            "minimum": 5,
            "maximum": 45,
            "type": "integer",
            "description": "Total timeout per public HTML download attempt, including redirects and streaming. Also bounded by the 150-second collection 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": 20,
            "type": "integer",
            "description": "Maximum HTTP requests across all sources, redirects and proxy retries. Unvisited sources and the stop reason appear in the run summary.",
            "default": 3
          },
          "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}