{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper – Videos, Shorts, Channels & Search",
    "description": "Scrape YouTube search results, channels, playlists, Shorts and hashtags with complete data on every row: exact publish time, views, likes, exact comment count, tags, category and channel stats. Newest-first sorting that really works, optional comments. $2.50 per 1,000 videos.",
    "version": "1.0",
    "x-build-id": "t3CBHGkkfaDG7YGHs"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/brii3343~youtube-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-brii3343-youtube-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/brii3343~youtube-scraper/runs": {
      "post": {
        "operationId": "runs-sync-brii3343-youtube-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/brii3343~youtube-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-brii3343-youtube-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": {
          "searchQueries": {
            "title": "Search terms",
            "type": "array",
            "description": "One search per line, typed as you would in the YouTube search bar. Use the filters below to narrow the results.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "YouTube URLs",
            "type": "array",
            "description": "Links to videos, Shorts, channels (<code>/@handle</code>, <code>/channel/UC…</code>, <code>/c/…</code>, <code>/user/…</code>, optionally ending in <code>/videos</code>, <code>/shorts</code> or <code>/streams</code>), playlists, search result pages (their filters are kept) and hashtag pages (<code>/hashtag/cooking</code>).",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxResults": {
            "title": "Max videos per search or URL",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "For channels, the limit applies to each tab you choose (Videos, Shorts, Live).",
            "default": 20
          },
          "fullDetails": {
            "title": "Full details for every video",
            "type": "boolean",
            "description": "Exact publish date and time, duration, tags and category for every row (also for search, channel and playlist results). Turn off only if you need speed over completeness: views, likes, comment count, date, description and channel data are included either way.",
            "default": true
          },
          "sortBy": {
            "title": "Search: sort by",
            "enum": [
              "relevance",
              "date",
              "views"
            ],
            "type": "string",
            "description": "Relevance keeps the YouTube order. YouTube no longer sorts search results by date and sorts by views only roughly, so Newest first and Most viewed read the whole result list of the search (up to 1,000 videos, only the list pages) and sort it before reading the videos you keep.",
            "default": "relevance"
          },
          "uploadDate": {
            "title": "Search: upload date",
            "enum": [
              "any",
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Only videos uploaded in this period (YouTube filter).",
            "default": "any"
          },
          "videoType": {
            "title": "Search: type",
            "enum": [
              "all",
              "videos",
              "shorts",
              "live"
            ],
            "type": "string",
            "description": "Videos, Shorts or live streams. \"Everything\" returns what the YouTube page shows, Shorts shelves included.",
            "default": "all"
          },
          "duration": {
            "title": "Search: duration",
            "enum": [
              "any",
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "Video length (YouTube filter).",
            "default": "any"
          },
          "features": {
            "title": "Search: features",
            "type": "array",
            "description": "YouTube search features: all selected must match.",
            "items": {
              "type": "string",
              "enum": [
                "hd",
                "4k",
                "subtitles",
                "cc",
                "live",
                "360",
                "hdr",
                "vr180",
                "3d",
                "location",
                "purchased"
              ],
              "enumTitles": [
                "HD",
                "4K",
                "Subtitles/CC",
                "Creative Commons",
                "Live",
                "360°",
                "HDR",
                "VR180",
                "3D",
                "Location",
                "Purchased"
              ]
            },
            "default": []
          },
          "channelTabs": {
            "title": "Channel tabs",
            "type": "array",
            "description": "Which tabs to read from channel URLs (a URL ending in /videos, /shorts or /streams reads only that tab).",
            "items": {
              "type": "string",
              "enum": [
                "videos",
                "shorts",
                "streams"
              ],
              "enumTitles": [
                "Videos",
                "Shorts",
                "Live"
              ]
            },
            "default": [
              "videos"
            ]
          },
          "channelSort": {
            "title": "Channel order",
            "enum": [
              "newest",
              "popular",
              "oldest"
            ],
            "type": "string",
            "description": "Same orders as the channel page. With newest first, publishedAfter stops the scraper at the first older video.",
            "default": "newest"
          },
          "publishedAfter": {
            "title": "Only videos published after",
            "type": "string",
            "description": "A date (<code>2026-09-01</code>) or an age (<code>7 days</code>, <code>2 weeks</code>, <code>3 months</code>). Works for searches, channels, playlists and videos; on channels sorted newest first the scraper stops as soon as it reaches older videos. Older videos are not charged."
          },
          "maxComments": {
            "title": "Comments per video",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "0 = no comments. Comments are added to each video row (text, author, likes, replies, pinned, hearted by the creator) and charged per comment.",
            "default": 0
          },
          "commentsSort": {
            "title": "Comments order",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "Top comments or newest first, as on YouTube.",
            "default": "top"
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "Two-letter country code (US, GB, DE, IN, BR…): YouTube ranks search results and checks video availability for this country.",
            "default": "US"
          },
          "language": {
            "title": "Search language",
            "type": "string",
            "description": "Language code for search results (en, es, de, pt, fr, hi…). Used with Relevance order; Newest first and Most viewed read the result list in English to sort it.",
            "default": "en"
          },
          "maxConcurrency": {
            "title": "Videos in parallel",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Higher is faster.",
            "default": 20
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}