{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper — Channel Videos, Shorts & Playlists",
    "description": "Scrape public YouTube channel videos, Shorts, search results, playlists and direct video URLs. Export views, titles, channel details and available publication data to JSON, CSV or Excel, with counter accuracy flags. No user-supplied YouTube API key.",
    "version": "1.1",
    "x-build-id": "NYRfELp8lSP5Z4u1m"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/funny_ground~youtube-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-funny_ground-youtube-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/funny_ground~youtube-scraper/runs": {
      "post": {
        "operationId": "runs-sync-funny_ground-youtube-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/funny_ground~youtube-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-funny_ground-youtube-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": {
          "channelUrls": {
            "title": "Channel URLs or handles",
            "maxItems": 50,
            "uniqueItems": true,
            "type": "array",
            "description": "YouTube channel URLs, @handles, channel IDs, or handles without @. The Videos tab is used unless the input URL explicitly ends in /shorts or /streams.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeShorts": {
            "title": "Also scrape Shorts",
            "type": "boolean",
            "description": "For each normal channel input, also scrape its Shorts tab. resultsPerInput applies separately to Videos and Shorts.",
            "default": false
          },
          "includeVideoStats": {
            "title": "Fetch video statistics",
            "type": "boolean",
            "description": "Fetch current public views, likes, comment totals, and available publication dates for each result. Enabled by default; disable it for the fastest feed-only crawl without extra statistics/watch-page requests. Enrichment uses at most two statistics requests, one missing-date player request, and one watch-page fallback per unique video, before configured HTTP retries. Existing player metadata is reused. Approximate counts and unavailable fields are explicitly labelled; date-only metadata is not converted to a fabricated timestamp.",
            "default": true
          },
          "searchQueries": {
            "title": "Search queries",
            "maxItems": 50,
            "uniqueItems": true,
            "type": "array",
            "description": "Free-text YouTube video searches, one query per line.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "playlistUrls": {
            "title": "Playlist URLs or IDs",
            "maxItems": 50,
            "uniqueItems": true,
            "type": "array",
            "description": "Full YouTube playlist URLs or playlist IDs.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "videoUrls": {
            "title": "Direct video URLs or IDs",
            "maxItems": 100,
            "uniqueItems": true,
            "type": "array",
            "description": "YouTube watch, youtu.be, Shorts, embed, or live URLs. Direct IDs are also accepted.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "resultsPerInput": {
            "title": "Results per input",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum unique candidate videos examined for each channel tab, search, or playlist, before incremental exclusions and cross-input deduplication. Direct video URLs return at most one new row each. Set 0 to continue until the feed ends, with a 10,000-candidate safety cap per input. This is not a target number of unseen rows: known IDs still count toward this candidate window. Optional maxResults bounds actual saved rows globally. For Apify Free-plan users, a separate global limit of 50 dataset rows per run applies regardless of this field.",
            "default": 50
          },
          "maxResults": {
            "title": "Global maximum saved videos",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Optional global bound on actual saved dataset rows across all channel tabs, searches, playlists and direct videos. Omit to retain the existing per-input behavior. Known IDs, duplicates and rows without public playback counts do not consume new-row capacity. The smallest of this bound, the Free-plan 50-row cap and the remaining event-charge budget applies. Collection/enrichment stops at capacity; at most one already-started feed page per concurrent input may finish."
          },
          "knownVideoIds": {
            "title": "Previously known video IDs",
            "maxItems": 10000,
            "type": "array",
            "description": "Optional case-sensitive 11-character YouTube video IDs to exclude BEFORE extra detail requests and saving. At most 10,000 entries; URLs are not accepted here. Combined with IDs from previousDatasetId. A valid feed whose scanned candidate window contains only known videos succeeds with zero new rows/result events. Known direct inputs can be skipped without any YouTube request; startup and platform usage may still apply.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "previousDatasetId": {
            "title": "Previous YouTube dataset ID",
            "pattern": "^[A-Za-z0-9]{17}$",
            "type": "string",
            "description": "Optional existing 17-character Apify dataset ID accessible to this run. Read-only SDK calls load videoId or YouTube url from ONLY the first 10,000 source rows, in pages of at most 1,000; later rows are not excluded. This is not a dataset name or URL. Missing, unreadable, incomplete or nonempty non-YouTube datasets fail explicitly before source requests. Invalid rows in an otherwise usable dataset are counted in OUTPUT. No shared named store is created."
          },
          "maxConcurrency": {
            "title": "HTTP concurrency",
            "minimum": 1,
            "maximum": 12,
            "type": "integer",
            "description": "Number of inputs or direct videos processed concurrently. The conservative default balances speed and YouTube rate limits.",
            "default": 4
          },
          "maxRequestRetries": {
            "title": "Request retries",
            "minimum": 0,
            "maximum": 4,
            "type": "integer",
            "description": "Retries for temporary 408, 429, and 5xx responses.",
            "default": 2
          },
          "requestTimeoutSecs": {
            "title": "Request timeout",
            "minimum": 10,
            "maximum": 120,
            "type": "integer",
            "description": "Timeout for each lightweight HTTP request.",
            "default": 30
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}