{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Channel, Video, Shorts & Comments Scraper | Lens",
    "description": "Scrape YouTube channels, videos, Shorts, comments, transcripts, playlists, and search. Billed via Apify Store (pay per result).",
    "version": "0.1",
    "x-build-id": "dh3Z1Ko6Z01RdJeed"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/cocoa_cherry~lens-social-youtube/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-cocoa_cherry-lens-social-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/cocoa_cherry~lens-social-youtube/runs": {
      "post": {
        "operationId": "runs-sync-cocoa_cherry-lens-social-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/cocoa_cherry~lens-social-youtube/run-sync": {
      "post": {
        "operationId": "run-sync-cocoa_cherry-lens-social-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",
        "required": [
          "endpoint"
        ],
        "properties": {
          "endpoint": {
            "title": "Endpoint",
            "enum": [
              "/v1/youtube/channel",
              "/v1/youtube/channel-videos",
              "/v1/youtube/channel/community-posts",
              "/v1/youtube/channel/lives",
              "/v1/youtube/channel/playlists",
              "/v1/youtube/channel/shorts",
              "/v1/youtube/community-post",
              "/v1/youtube/playlist",
              "/v1/youtube/search",
              "/v1/youtube/search/hashtag",
              "/v1/youtube/shorts/trending",
              "/v1/youtube/video",
              "/v1/youtube/video/comment/replies",
              "/v1/youtube/video/comments",
              "/v1/youtube/video/sponsors",
              "/v1/youtube/video/transcript"
            ],
            "type": "string",
            "description": "Which Youtube social endpoint to call.",
            "default": "/v1/youtube/channel"
          },
          "url": {
            "title": "Url",
            "type": "string",
            "description": "YouTube channel URL. Can pass a channelId, handle or url. Used by 6 endpoints — required only for some (see endpoint docs)."
          },
          "handle": {
            "title": "Handle",
            "type": "string",
            "description": "YouTube channel handle. Can pass a channelId, handle or url. Used by 6 endpoints — required only for some (see endpoint docs).",
            "default": "NASA"
          },
          "query": {
            "title": "Query",
            "type": "string",
            "description": "Search query. Used by /v1/youtube/search."
          },
          "hashtag": {
            "title": "Hashtag",
            "type": "string",
            "description": "Hashtag to search for. Used by /v1/youtube/search/hashtag."
          },
          "region": {
            "title": "Region",
            "type": "string",
            "description": "2 letter country code of the country to put the proxy in. Used by /v1/youtube/search."
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Preferred response language (mapped to Accept-Language header; not guaranteed due to YouTube localization behavior). 2 letter language code, ie 'en', 'es', 'fr' etc. Used by 3 endpoints — required only for some (see endpoint docs)."
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "latest",
              "popular"
            ],
            "type": "string",
            "description": "Sort by latest or popular. Used by 2 endpoints — required only for some (see endpoint docs)."
          },
          "cache_max_age": {
            "title": "Cache Max Age",
            "enum": [
              "1d",
              "3d",
              "7d",
              "14d",
              "30d"
            ],
            "type": "string",
            "description": "If we have a response in the cache that is this many days old or newer, return the cached response (0 credits, with \"cached\": true and a \"cached_at\" timestamp). Otherwise, scrape a live result (1 credit). [See the Caching page for details.](https://docs.scrapecreators.com/caching). Used by 3 endpoints — required only for some (see endpoint docs)."
          },
          "channelId": {
            "title": "ChannelId",
            "type": "string",
            "description": "YouTube channel ID. Can pass a channelId, handle or url. Used by 6 endpoints — required only for some (see endpoint docs)."
          },
          "continuationToken": {
            "title": "ContinuationToken",
            "type": "string",
            "description": "Continuation token to get more videos. Get 'continuationToken' from previous response. Used by 9 endpoints — required only for some (see endpoint docs)."
          },
          "duration": {
            "title": "Duration",
            "enum": [
              "under_3_min",
              "between_3_and_20_min",
              "over_20_min"
            ],
            "type": "string",
            "description": "Duration of the video. Only applies to videos (not shorts). Used by /v1/youtube/search."
          },
          "includeExtras": {
            "title": "IncludeExtras",
            "type": "string",
            "description": "This will get you the like + comment count and the description. To get the full details of the video, use the /v1/youtube/video endpoint. Honestly, if you use this param, the error rate is higher. We might deprecate this param in the future. Used by 2 endpoints — required only for some (see endpoint docs)."
          },
          "is_paid_promotions": {
            "title": "Is Paid Promotions",
            "type": "string",
            "description": "Set to 'true' to search YouTube's public paid product placement / sponsorship / endorsement search surface. This returns normal YouTube videos where the creator declared paid promotion. Cannot be combined with filter, uploadDate, sortBy, type, duration, or includeExtras. Used by /v1/youtube/channel-videos."
          },
          "order": {
            "title": "Order",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "Order of comments. Used by /v1/youtube/video/comments."
          },
          "playlist_id": {
            "title": "Playlist Id",
            "type": "string",
            "description": "The ID of the YouTube playlist. In the YouTube URL it will be the 'list' parameter. Used by /v1/youtube/playlist."
          },
          "sortBy": {
            "title": "SortBy",
            "enum": [
              "relevance",
              "popular"
            ],
            "type": "string",
            "description": "Sort by. Used by /v1/youtube/search."
          },
          "type": {
            "title": "Type",
            "enum": [
              "videos",
              "shorts",
              "channels",
              "playlists"
            ],
            "type": "string",
            "description": "Type of content to search for. Used by 2 endpoints — required only for some (see endpoint docs)."
          },
          "uploadDate": {
            "title": "UploadDate",
            "enum": [
              "today",
              "this_week",
              "this_month",
              "this_year"
            ],
            "type": "string",
            "description": "Upload date. Used by /v1/youtube/search."
          },
          "handles": {
            "title": "Handles (bulk)",
            "type": "array",
            "description": "Bulk mode: up to 1000 handles for handle-based endpoints (e.g. profile). One dataset row per handle. Overrides singular Handle when set. Newline/comma-separated strings also accepted via API.",
            "items": {
              "type": "string"
            }
          },
          "urls": {
            "title": "Urls (bulk)",
            "type": "array",
            "description": "Bulk mode: up to 1000 URLs for url-based endpoints (e.g. tweet, community). One dataset row per URL. Overrides singular Url when set.",
            "items": {
              "type": "string"
            }
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Parallel Lens calls during bulk runs (1–20, default 5).",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}