{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper: Videos, Channels, Search, Comments (API)",
    "description": "Clean YouTube video, channel, keyword search and comment data from the official YouTube Data API v3 using your own free key. No proxies, no blocks, your quota, our low per-result price.",
    "version": "1.0",
    "x-build-id": "nva7jmhnji5TbsrKl"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rawtojson~youtube-data-api-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rawtojson-youtube-data-api-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/rawtojson~youtube-data-api-scraper/runs": {
      "post": {
        "operationId": "runs-sync-rawtojson-youtube-data-api-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/rawtojson~youtube-data-api-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-rawtojson-youtube-data-api-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": {
          "apiKey": {
            "title": "YouTube Data API v3 key",
            "type": "string",
            "description": "Your own key from Google Cloud Console (free quota: 10,000 units per day; the API cost is yours, not ours). Needed for search, channels and comments. Leave empty for basic mode with video URLs only."
          },
          "searchQueries": {
            "title": "Search keywords",
            "type": "array",
            "description": "One search per keyword (needs API key). Each page of up to 50 results is one search.list call: 1 unit, and it also counts against Google's separate default limit of 100 search calls per day (https://developers.google.com/youtube/v3/determine_quota_cost).",
            "items": {
              "type": "string"
            }
          },
          "channelUrls": {
            "title": "Channels",
            "type": "array",
            "description": "Channel URLs, @handles or channel IDs (needs API key). Returns channel stats plus its latest uploads (cheap: 1 unit per call of up to 50 videos; a @handle or ID needs no search call).",
            "items": {
              "type": "string"
            }
          },
          "videoUrls": {
            "title": "Videos",
            "type": "array",
            "description": "Video URLs or 11-character IDs (watch, youtu.be, shorts, embed).",
            "items": {
              "type": "string"
            }
          },
          "maxResultsPerQuery": {
            "title": "Videos per search",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum videos returned for each search keyword. Up to 50 per search.list call (1 unit and 1 of your 100 daily search calls); more results need more pages and more calls.",
            "default": 10
          },
          "maxVideosPerChannel": {
            "title": "Latest videos per channel",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum latest uploads returned for each channel. Use 0 to get only the channel statistics.",
            "default": 10
          },
          "includeChannelInfo": {
            "title": "Include channel statistics",
            "type": "boolean",
            "description": "Return one channel item (subscribers, views, country, handle) for every channel you list.",
            "default": true
          },
          "maxItems": {
            "title": "Max videos in total",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap on the number of videos returned (and charged) in this run.",
            "default": 100
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Also return top-level comments for each video (needs API key, 1 unit per call of up to 100 comments, charged as separate comment events).",
            "default": false
          },
          "maxCommentsPerVideo": {
            "title": "Comments per video",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum comments returned for each video.",
            "default": 20
          },
          "commentsOrder": {
            "title": "Comments order",
            "enum": [
              "relevance",
              "time"
            ],
            "type": "string",
            "description": "Most relevant first or newest first.",
            "default": "relevance"
          },
          "order": {
            "title": "Search order",
            "enum": [
              "relevance",
              "date",
              "viewCount",
              "rating",
              "title"
            ],
            "type": "string",
            "description": "How YouTube sorts search results.",
            "default": "relevance"
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Only videos published after this date (YYYY-MM-DD)."
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "Only videos published before this date (YYYY-MM-DD)."
          },
          "videoDuration": {
            "title": "Duration",
            "enum": [
              "any",
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "short: under 4 min, medium: 4 to 20 min, long: over 20 min.",
            "default": "any"
          },
          "regionCode": {
            "title": "Region code",
            "type": "string",
            "description": "Optional ISO 3166-1 alpha-2 country code, for example US or ES."
          },
          "relevanceLanguage": {
            "title": "Language",
            "type": "string",
            "description": "Optional ISO 639-1 language code, for example en or es."
          },
          "maxQuotaUnits": {
            "title": "Max API quota units",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Safety cap on the API units this run may spend (every API call costs 1 unit; Google's default daily quota is 10,000 units and is subject to change, https://developers.google.com/youtube/v3/getting-started). The run stops cleanly when reached.",
            "default": 3000
          },
          "maxSearchCalls": {
            "title": "Max search calls",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Cap on search.list calls this run may make. Google gives search.list its own default limit of 100 calls per day, separate from the general units (https://developers.google.com/youtube/v3/getting-started), so the default is 100. Raise it only if your project has a higher search quota.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}