{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Community Posts & Polls Scraper",
    "description": "Scrape every YouTube community post — polls, image carousels, shared videos, and text — plus full comment threads. Three operations, one actor, no API key needed. Built for creator agencies, social-listening teams, and AI-training pipelines that need structured community-tab data.",
    "version": "1.0",
    "x-build-id": "PzZdeUZLAF1kgjB8u"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sian.agency~youtube-community-posts-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sian.agency-youtube-community-posts-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/sian.agency~youtube-community-posts-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sian.agency-youtube-community-posts-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/sian.agency~youtube-community-posts-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sian.agency-youtube-community-posts-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",
        "required": [
          "operation"
        ],
        "properties": {
          "operation": {
            "title": "🎯 Operation — what do you want to scrape?",
            "enum": [
              "channelCommunityPosts",
              "postDetail",
              "postComments"
            ],
            "type": "string",
            "description": "🎯 **PICK ONE OPERATION PER RUN.** Each run produces one clean dataset matching the chosen mode.\n\n- **📝 Channel Community Posts** — pass one or more channel IDs (or handle URLs) → get the paginated community-tab feed: text, image carousels, polls, shared videos. Headline operation.\n- **🔍 Post Detail** — pass one or more post IDs → enriched single-row detail per post (full image resolutions, poll metadata, attached video info, embedded `commentsContinuationToken` for free comment chaining).\n- **💬 Post Comments** — pass one or more post IDs → paginated comments + replies on each post.\n\n💡 **TIP:** Start with `Channel Community Posts` to discover post IDs for a channel, then feed those IDs into `Post Detail` or `Post Comments` for enrichment.",
            "default": "channelCommunityPosts"
          },
          "channelIds": {
            "title": "📺 Channel IDs or YouTube channel URLs (one per line)",
            "type": "string",
            "description": "📺 **Required for `Channel Community Posts`.**\n\nOne or more channel inputs. Each will be processed independently, paginated up to `maxPages`. Accepts any mix of:\n- Canonical channel ID: `UCBJycsmduvYEL83R_U4JriQ`\n- Channel URL: `https://www.youtube.com/channel/UCBJycsmduvYEL83R_U4JriQ`\n- Handle URL: `https://www.youtube.com/@MKBHD`\n- Bare handle: `@MKBHD` (will be resolved)\n\n💡 **TIP:** Handles + URLs are resolved to canonical channel IDs automatically (one extra upstream call per channel — no extra charge)."
          },
          "postIds": {
            "title": "🔍 Post IDs or post URLs (one per line)",
            "type": "string",
            "description": "🔍 **Required for `Post Detail` and `Post Comments`.**\n\nOne or more YouTube community post IDs. Each ID starts with `Ugkx…` and is ~34 characters. Accepts:\n- Bare post IDs: `UgkxX6gkDxQ0KRucvyG7NLui0LhjHp0CLlfZ`\n- Full post URLs: `https://www.youtube.com/post/UgkxX6gkDxQ0KRucvyG7NLui0LhjHp0CLlfZ` (the actor will extract the ID)\n- Comma-separated or one per line\n\n💡 **TIP:** Use the `Channel Community Posts` operation first to discover post IDs from a channel. The `Post Detail` operation also returns a `commentsContinuationToken` you can pass directly into a downstream `Post Comments` workflow."
          },
          "maxPages": {
            "title": "📄 Max pages per channel / per post",
            "minimum": 1,
            "maximum": 25,
            "type": "integer",
            "description": "📄 **Applies to paginated operations only** (`Channel Community Posts`, `Post Comments`). Ignored for `Post Detail`.\n\n- **Channel Community Posts:** ~10 posts per page\n- **Post Comments:** ~20 comments per page\n\nFor multi-input runs (multiple channels or post IDs), the cap applies per-input.\n\n⚠️ Hard cap: 25 pages to prevent runaway runs.",
            "default": 3
          },
          "geo": {
            "title": "🌍 Country (optional, ISO 3166-1 alpha-2)",
            "type": "string",
            "description": "🌍 **Optional.** Two-letter country code to localize results. Defaults to `US`.\n\nExamples: `US`, `GB`, `IN`, `BR`, `DE`, `JP`, `KR`, `MX`.",
            "default": "US"
          },
          "lang": {
            "title": "🗣 Language (optional, ISO 639-1)",
            "type": "string",
            "description": "🗣 **Optional.** Two-letter language code for localized labels. Defaults to `en`.\n\nExamples: `en`, `es`, `pt`, `hi`, `ja`, `ko`.",
            "default": "en"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}