{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper API by SocialScrape",
    "description": "Scrape YouTube channels, videos, Shorts, playlists, comments, search results, community posts and transcripts as JSON. 18 endpoints in one actor, with the same field names on every platform. Pay per result: no API key and no other account needed.",
    "version": "0.1",
    "x-build-id": "bvgolXQoW4d8z6U7j"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/socialscrape~youtube-scraper-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-socialscrape-youtube-scraper-api",
        "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/socialscrape~youtube-scraper-api/runs": {
      "post": {
        "operationId": "runs-sync-socialscrape-youtube-scraper-api",
        "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/socialscrape~youtube-scraper-api/run-sync": {
      "post": {
        "operationId": "run-sync-socialscrape-youtube-scraper-api",
        "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": [
              "channel",
              "channel.videos",
              "channel.search",
              "channel.playlists",
              "channel.shorts",
              "channel.lives",
              "channel.community_posts",
              "video",
              "video.transcript",
              "video.sponsors",
              "search",
              "search.typeahead",
              "search.hashtag",
              "video.comments",
              "video.comment.replies",
              "shorts.trending",
              "playlist",
              "community_post"
            ],
            "type": "string",
            "description": "What to fetch. The fields below are shared by the endpoints; each endpoint uses only the ones it needs.",
            "default": "channel"
          },
          "handle": {
            "title": "Handle",
            "type": "string",
            "description": "Channel handle, with or without @. Used by: channel, channel.community_posts, channel.lives, channel.playlists, channel.search, channel.shorts, channel.videos."
          },
          "id": {
            "title": "ID",
            "type": "string",
            "description": "For channel, channel.videos, channel.search, channel.playlists, channel.shorts, channel.lives, channel.community_posts: Channel id (UC...). For video, video.transcript, video.sponsors, video.comments, video.comment.replies: 11-character video id. For playlist: Playlist id (PL..., UU..., OL...)."
          },
          "url": {
            "title": "URL",
            "type": "string",
            "description": "For channel, channel.videos, channel.search, channel.playlists, channel.shorts, channel.lives, channel.community_posts: Any channel URL (/@handle, /channel/UC..., /c/name). For video, video.transcript, video.sponsors, video.comments, video.comment.replies: Video or Short URL (watch, youtu.be, shorts, live, embed). For playlist: Playlist URL (list=...). For community_post: Community post URL (/post/Ug... or /channel/.../community?lb=...)."
          },
          "trim": {
            "title": "Trim",
            "type": "boolean",
            "description": "Smaller response: drops null fields and `extra`.",
            "default": false
          },
          "raw": {
            "title": "Raw",
            "type": "boolean",
            "description": "Also return the platform's original object as `raw`.",
            "default": false
          },
          "max_age_days": {
            "title": "Max Age Days",
            "minimum": 0,
            "maximum": 30,
            "type": "number",
            "description": "Accept a cached result fetched within this many days. It answers faster."
          },
          "sort": {
            "title": "Sort",
            "type": "string",
            "description": "For channel.videos, channel.shorts: Order of results. Changing it restarts the cursor chain (one of: latest, popular). For search: Order of results. YouTube now answers `latest` and `rating` in relevance order, so they are refused with invalid_params; use `relevance` or `popular` (view count) and narrow with `upload_date` (one of: relevance, latest, popular, rating). For video.comments: Order of results. Changing it restarts the cursor chain (one of: top, latest)."
          },
          "include_extras": {
            "title": "Include Extras",
            "type": "boolean",
            "description": "For channel.videos: Also fetch exact views, likes, description and publish time per video (slower, more errors). Comment counts come from the video endpoint. For channel.shorts: Also fetch exact views, length, publish date, likes and description per Short (slower, more errors). For search: Also fetch likes, comment count and description per video (slightly slower).",
            "default": false
          },
          "query": {
            "title": "Query",
            "type": "string",
            "description": "For channel.search: Keywords to search for inside the channel. For search: Search terms. For search.typeahead: Partial or complete search text."
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "For video: Preferred response language, 2 letters (en, es, fr). Not guaranteed: YouTube localises on its own. For video.transcript: Language code (\"en\", \"es\", \"en-US\"). Overrides the default track unless `original_audio` is set. For video.sponsors: 2-letter language used for the transcript lookup."
          },
          "original_audio": {
            "title": "Original Audio",
            "type": "boolean",
            "description": "Only return captions in the video's original spoken language. Takes precedence over `language`. Used by: video.transcript.",
            "default": false
          },
          "type": {
            "title": "Type",
            "type": "string",
            "description": "For search: Kind of result (one of: video, channel, playlist, short, live). For search.hashtag: Kind of result (one of: all, short)."
          },
          "upload_date": {
            "title": "Upload Date",
            "enum": [
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Upload date filter. Used by: search."
          },
          "duration": {
            "title": "Duration",
            "enum": [
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "Video length (videos only, not Shorts). Used by: search."
          },
          "region": {
            "title": "Region",
            "type": "string",
            "description": "Two-letter country code (ISO 3166-1) for results that vary by country. Used by: search, shorts.trending."
          },
          "hashtag": {
            "title": "Hashtag",
            "type": "string",
            "description": "Hashtag, with or without #. Used by: search.hashtag."
          },
          "comment_id": {
            "title": "Comment ID",
            "type": "string",
            "description": "Id of the parent comment. Used by: video.comment.replies."
          },
          "maxPages": {
            "title": "Max pages",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Follow the cursor for up to this many pages. You pay for the results, not for the pages.",
            "default": 1
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many results. 0 means no limit other than Max pages.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}