{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Channel & Video Scraper",
    "description": "Scrape YouTube channels and videos without a browser or API key: subscriber counts, full upload lists, exact view counts, durations, publish dates, keywords, and optional likes and comments. No quota limits. From $0.30 per 1,000 videos.",
    "version": "0.0",
    "x-build-id": "0pP8pg6tXSdymgrLA"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/eiv~youtube-channel-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-eiv-youtube-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/eiv~youtube-channel-scraper/runs": {
      "post": {
        "operationId": "runs-sync-eiv-youtube-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/eiv~youtube-channel-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-eiv-youtube-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": {
          "channels": {
            "title": "Channels",
            "type": "array",
            "description": "Handles, URLs or channel ids, one per line: '@mkbhd', 'https://www.youtube.com/@mkbhd', 'UCBJycsmduvYEL83R_U4JriQ'. Old /c/ and /user/ URLs work too.",
            "items": {
              "type": "string"
            }
          },
          "videos": {
            "title": "Videos",
            "type": "array",
            "description": "Video URLs or 11-character ids. Accepts watch, youtu.be, /shorts/ and /live/ links. Use this when you want specific videos rather than a whole channel.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs (for chaining)",
            "type": "array",
            "description": "Alternative to Channels and Videos, for feeding output from another Actor straight into this one.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "sourceDatasetId": {
            "title": "Source dataset ID",
            "type": "string",
            "description": "Read channel or video identifiers from an existing dataset instead of typing them."
          },
          "sourceDatasetField": {
            "title": "Source dataset field",
            "type": "string",
            "description": "Which field on the source dataset holds the identifier.",
            "default": "channelUrl"
          },
          "maxVideosPerChannel": {
            "title": "Max videos per channel",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "How many recent uploads to return per channel. YouTube serves 30 per page, so this is your main billing guard. Set 0 to fetch channel statistics only and no videos at all.",
            "default": 50
          },
          "includeShorts": {
            "title": "Include Shorts",
            "type": "boolean",
            "description": "Also read the channel's Shorts tab, which YouTube keeps separate from regular uploads. Each returned Short carries isShort: true. A Shorts thumbnail shows no duration and no date, so those come only from \"Exact view counts and dates\"; without it a Short's durationSeconds and publishedAt are null.",
            "default": false
          },
          "publishedWithinDays": {
            "title": "Only videos from the last N days",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "Keep only recent uploads. Applied after fetching, because YouTube's channel tab has no date filter. 0 keeps everything.",
            "default": 0
          },
          "exactVideoStats": {
            "title": "Exact view counts and publish dates",
            "type": "boolean",
            "description": "Resolve every video individually to get its exact view count and an exact publish timestamp. Without this you get YouTube's rounded display text — '1.5M views', '2 weeks ago' — which is cheaper but imprecise. Adds one small request per video.",
            "default": true
          },
          "includeEngagement": {
            "title": "Include likes and comment counts",
            "type": "boolean",
            "description": "Fetch each video's like total and comment count. This needs a second, much larger request per video — roughly 25 times the data — so it makes runs slower and more expensive. Comment counts are rounded by YouTube itself.",
            "default": false
          },
          "includeDescription": {
            "title": "Include full descriptions",
            "type": "boolean",
            "description": "Store each video's full description. Off by default because descriptions dominate dataset size; a 300-character snippet is always included.",
            "default": false
          },
          "language": {
            "title": "Interface language",
            "type": "string",
            "description": "Two-letter code used for YouTube's display text, e.g. 'en', 'de', 'es'. Affects the wording of relative dates and view counts, not the numbers.",
            "default": "en"
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "Two-letter code for the storefront YouTube serves, e.g. 'US', 'GB'. Some videos are region-restricted and will not resolve outside their country.",
            "default": "US"
          },
          "maxConcurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Channels processed in parallel. Responses are small, so this can be raised comfortably.",
            "default": 8
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 180,
            "type": "integer",
            "description": "Per-request timeout.",
            "default": 45
          },
          "maxRetries": {
            "title": "Retries per request",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Retries for connection resets and 5xx responses.",
            "default": 2
          },
          "flattenOutput": {
            "title": "Flatten output for CSV",
            "type": "boolean",
            "description": "Emit flat dot-notation columns with arrays joined by ' | '. Use for spreadsheets; leave off for warehouses.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. YouTube's own endpoints serve this data to anonymous clients, so a proxy is only worth enabling for very large runs or to read a specific country's catalogue.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}