{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Data API: Videos, Channels, Playlists, Search, Comments",
    "description": "Video stats, channels with every upload, playlists, filtered search and all comments with replies, through the official YouTube Data API v3 and your own free Google API key. Reports quota used per run. Errors are never charged.",
    "version": "0.1",
    "x-build-id": "nQSVYm86LQk1MgAQ1"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/omar_jarvis~youtube-data/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-omar_jarvis-youtube-data",
        "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/omar_jarvis~youtube-data/runs": {
      "post": {
        "operationId": "runs-sync-omar_jarvis-youtube-data",
        "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/omar_jarvis~youtube-data/run-sync": {
      "post": {
        "operationId": "run-sync-omar_jarvis-youtube-data",
        "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",
        "required": [
          "apiKey",
          "mode"
        ],
        "properties": {
          "apiKey": {
            "title": "Your Google API key",
            "type": "string",
            "description": "A free Google Cloud API key with \"YouTube Data API v3\" enabled. Google gives each project 10,000 quota units a day for free. See the README for the 2-minute setup. Stored encrypted by Apify."
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "videos",
              "channels",
              "playlists",
              "search",
              "comments"
            ],
            "type": "string",
            "description": "What to fetch. videos: details and stats per video. channels: channel details plus its uploads. playlists: playlist details plus every video. search: keyword search with filters. comments: all comments and replies per video.",
            "default": "videos"
          },
          "inputs": {
            "title": "URLs, IDs or handles",
            "maxItems": 10000,
            "type": "array",
            "description": "For videos and comments: video URLs (watch, youtu.be, shorts, live, embed) or 11-character video IDs. For channels: channel URLs, @handles, /user/ URLs or UC... channel IDs. For playlists: playlist URLs or IDs. Duplicates are removed. Not used in search mode.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "Search mode only. One query per line.",
            "items": {
              "type": "string"
            }
          },
          "searchType": {
            "title": "Result type",
            "enum": [
              "video",
              "channel",
              "playlist",
              "video,channel,playlist"
            ],
            "type": "string",
            "description": "Which result types to return.",
            "default": "video"
          },
          "searchOrder": {
            "title": "Sort order",
            "enum": [
              "relevance",
              "date",
              "viewCount",
              "rating",
              "title",
              "videoCount"
            ],
            "type": "string",
            "description": "Result order.",
            "default": "relevance"
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Only results published on or after this date, e.g. 2026-01-01."
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "Only results published before this date."
          },
          "regionCode": {
            "title": "Region",
            "type": "string",
            "description": "Two-letter country code (ISO 3166-1), e.g. NL, US, DE. Results that can be watched in that country."
          },
          "relevanceLanguage": {
            "title": "Language",
            "type": "string",
            "description": "Prefer results in this language (ISO 639-1), e.g. nl, en, de."
          },
          "videoDuration": {
            "title": "Video length",
            "enum": [
              "any",
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "short: under 4 minutes. medium: 4 to 20 minutes. long: over 20 minutes. Any value other than \"any\" returns videos only.",
            "default": "any"
          },
          "safeSearch": {
            "title": "Safe search",
            "enum": [
              "moderate",
              "none",
              "strict"
            ],
            "type": "string",
            "description": "Filter restricted content.",
            "default": "moderate"
          },
          "searchChannelId": {
            "title": "Only in channel",
            "type": "string",
            "description": "Optional UC... channel ID. Searches inside that channel only."
          },
          "maxResultsPerQuery": {
            "title": "Max results per query",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Up to 500. Each 50 results use one search call; Google allows 100 search calls a day per project by default.",
            "default": 50
          },
          "includeUploads": {
            "title": "Include channel uploads",
            "type": "boolean",
            "description": "Channels mode: also return the channel's uploaded videos (newest first) with full stats.",
            "default": true
          },
          "maxVideosPerChannel": {
            "title": "Max videos per channel",
            "minimum": 0,
            "type": "integer",
            "description": "0 means all uploads. Every 50 videos cost 2 quota units.",
            "default": 100
          },
          "maxItemsPerPlaylist": {
            "title": "Max videos per playlist",
            "minimum": 0,
            "type": "integer",
            "description": "0 means all videos.",
            "default": 0
          },
          "includeCaptions": {
            "title": "List caption tracks",
            "type": "boolean",
            "description": "Videos mode: try captions.list (50 quota units per video) for track languages. Google documents this call as OAuth-only; if Google refuses the API key, the actor stops trying and reports it in captionsError. Every video row already has hasCaptions.",
            "default": false
          },
          "commentOrder": {
            "title": "Comment order",
            "enum": [
              "time",
              "relevance"
            ],
            "type": "string",
            "description": "Comments mode: newest first or YouTube's top comments.",
            "default": "time"
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Return every reply, not only top-level comments.",
            "default": true
          },
          "maxCommentsPerVideo": {
            "title": "Max comments per video",
            "minimum": 0,
            "type": "integer",
            "description": "Counts comments and replies. 0 means all.",
            "default": 0
          },
          "commentSearchTerms": {
            "title": "Only comments containing",
            "type": "string",
            "description": "Optional. Only top-level comments that contain these words."
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many inputs to process in parallel.",
            "default": 5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}