{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Channel & Video Scraper",
    "description": "Give it a channel, playlist, video link or search keyword and get the videos with title, view count, duration, publish date, thumbnail and the channel profile. Approximate values are flagged as approximate, and recent uploads are upgraded to exact figures for free.",
    "version": "0.1",
    "x-build-id": "3GEVFcJeVGtkVR20U"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/garnet_puppet~youtube-channel-video-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-garnet_puppet-youtube-channel-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/garnet_puppet~youtube-channel-video-scraper/runs": {
      "post": {
        "operationId": "runs-sync-garnet_puppet-youtube-channel-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/garnet_puppet~youtube-channel-video-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-garnet_puppet-youtube-channel-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": {
          "startUrls": {
            "title": "Channels, playlists or videos",
            "type": "array",
            "description": "Channel URLs, @handles, channel IDs, playlist URLs or single video URLs. A channel gives you its videos; a playlist gives you the videos on it; a single video URL gives you that one video with its full details, not the whole channel.",
            "items": {
              "type": "string"
            }
          },
          "searchKeywords": {
            "title": "Search keywords",
            "type": "array",
            "description": "Search YouTube instead of pasting URLs. Search results carry exact view counts.",
            "items": {
              "type": "string"
            }
          },
          "maxVideos": {
            "title": "Max videos per source",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Upper bound on videos taken from the Videos tab of each source. Set to 0 to skip the Videos tab."
          },
          "maxShorts": {
            "title": "Max Shorts per source",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Shorts live on a separate tab. Default 0 so you are never billed for Shorts you did not ask for. Note: YouTube does not publish a duration or a publish date for Shorts, so those fields come back empty unless you turn on Full details."
          },
          "maxStreams": {
            "title": "Max live streams per source",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Past and upcoming live streams from the Live tab. Default 0."
          },
          "sortVideosBy": {
            "title": "Sort by",
            "enum": [
              "latest",
              "popular",
              "oldest"
            ],
            "type": "string",
            "description": "Which order the Videos tab is read in. 'Popular' and 'Oldest' let you reach videos a newest-first scrape would never get to.",
            "default": "latest"
          },
          "oldestPostDate": {
            "title": "Published after",
            "type": "string",
            "description": "Skip videos published before this date (YYYY-MM-DD). Careful: for videos older than the 15 most recent, YouTube only gives a relative date such as '3 weeks ago', so this filter is approximate for them. Every record tells you which dates are approximate."
          },
          "newestPostDate": {
            "title": "Published before",
            "type": "string",
            "description": "Skip videos published after this date (YYYY-MM-DD). Same approximation note as above."
          },
          "enrichWithFeed": {
            "title": "Exact data for recent uploads (free)",
            "type": "boolean",
            "description": "One extra request per channel upgrades its 15 most recent videos to an exact view count, an exact publish date and the full description. Costs you nothing extra.",
            "default": true
          },
          "includeChannelAbout": {
            "title": "Include channel profile",
            "type": "boolean",
            "description": "Attach the channel's subscriber count, total views, join date, country, links, avatar and banner to every record. Costs you nothing extra.",
            "default": true
          },
          "fullDetails": {
            "title": "Full details (billed extra)",
            "type": "boolean",
            "description": "Fetch every video individually to add tags, the full description, an exact view count and an exact publish date. One request per video, so runs are much slower, and each video is billed an additional 'video-details' event.",
            "default": false
          },
          "incremental": {
            "title": "Skip videos seen in earlier runs",
            "type": "boolean",
            "description": "Remembers video IDs delivered by previous runs of this task and skips them, so a scheduled run never bills you twice for the same video.",
            "default": false
          },
          "previewOnly": {
            "title": "Free preview",
            "type": "boolean",
            "description": "Report what would be scraped and how many videos would be billed, without delivering or billing any of them. Listing is free for us, so this preview is free for you. The platform's own Actor start event still applies.",
            "default": false
          },
          "maxPagesPerSource": {
            "title": "Max pages per source",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Hard stop on pagination. Each page holds about 30 videos.",
            "default": 10
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}