{
  "openapi": "3.0.1",
  "info": {
    "title": "Channel Stats, Live Streams & Comments for YouTube",
    "description": "Channel stats, recent uploads, live & upcoming streams, trending charts by country, and comments via the official YouTube Data API v3 with your own free key. No scraping, no proxies, no blocking.",
    "version": "0.1",
    "x-build-id": "JIxBtVvcR5l00BRzi"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/panda_studio~channel-stats-for-youtube/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-panda_studio-channel-stats-for-youtube",
        "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/panda_studio~channel-stats-for-youtube/runs": {
      "post": {
        "operationId": "runs-sync-panda_studio-channel-stats-for-youtube",
        "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/panda_studio~channel-stats-for-youtube/run-sync": {
      "post": {
        "operationId": "run-sync-panda_studio-channel-stats-for-youtube",
        "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 key",
            "type": "string",
            "description": "Your own YouTube Data API v3 key (free, 10,000 quota units per day). Google Cloud Console > APIs & Services > Library > enable \"YouTube Data API v3\" > Credentials > Create credentials > API key. The key is stored encrypted and only sent to googleapis.com."
          },
          "channels": {
            "title": "Channels",
            "type": "array",
            "description": "Channel handles (@name), channel URLs or channel IDs (UC...). Returns channel statistics and the most recent uploads with live status.",
            "items": {
              "type": "string"
            }
          },
          "recentVideosPerChannel": {
            "title": "Recent uploads per channel",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "How many of the latest uploads to return per channel (0 = channel stats only). Costs about 1 quota unit per 50 videos.",
            "default": 10
          },
          "onlyLiveAndUpcoming": {
            "title": "Only live & upcoming streams",
            "type": "boolean",
            "description": "Stream schedule mode: return only videos that are live now or scheduled (upcoming) among the latest uploads (checks at least 30). Channel rows are skipped.",
            "default": false
          },
          "videos": {
            "title": "Videos",
            "type": "array",
            "description": "Video URLs or IDs (watch, youtu.be, shorts, live). Returns full statistics, duration, tags and live details.",
            "items": {
              "type": "string"
            }
          },
          "commentsForVideos": {
            "title": "Get comments for these videos",
            "type": "array",
            "description": "Video URLs or IDs to download public comments from.",
            "items": {
              "type": "string"
            }
          },
          "maxCommentsPerVideo": {
            "title": "Max comments per video",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Top-level comments per video. 1 quota unit per 100 comments.",
            "default": 100
          },
          "commentOrder": {
            "title": "Comment order",
            "enum": [
              "relevance",
              "time"
            ],
            "type": "string",
            "description": "Order of comments.",
            "default": "relevance"
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Also return replies included in each thread (the API returns up to 5 replies per thread).",
            "default": false
          },
          "trendingRegions": {
            "title": "Trending chart countries",
            "type": "array",
            "description": "ISO country codes for the official most-popular chart, e.g. JP, US, KR, GB, IN.",
            "items": {
              "type": "string"
            }
          },
          "trendingCategoryId": {
            "title": "Trending category ID (optional)",
            "type": "string",
            "description": "Optional video category ID, e.g. 10 = Music, 20 = Gaming, 24 = Entertainment. Leave empty for all."
          },
          "maxTrendingPerRegion": {
            "title": "Max trending videos per country",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Up to 200 per country.",
            "default": 50
          },
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "Keyword search for videos. Note: each search page costs 100 quota units (about 100 searches per day with the free quota).",
            "items": {
              "type": "string"
            }
          },
          "maxSearchResults": {
            "title": "Max results per search",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Videos per query (50 per page).",
            "default": 25
          },
          "searchOrder": {
            "title": "Search order",
            "enum": [
              "relevance",
              "date",
              "viewCount",
              "rating"
            ],
            "type": "string",
            "description": "Sort order for search.",
            "default": "relevance"
          },
          "searchRegionCode": {
            "title": "Search region code",
            "type": "string",
            "description": "Optional ISO country code, e.g. JP."
          },
          "searchLanguage": {
            "title": "Search relevance language",
            "type": "string",
            "description": "Optional language code, e.g. ja, en."
          },
          "maxItems": {
            "title": "Max results in total",
            "minimum": 1,
            "type": "integer",
            "description": "Safety cap for the number of rows (and cost) of one run.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}