{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper - Cheapest Pay-Per-Result",
    "description": "Scrape YouTube search results, videos, channels, playlists, subtitles and AI transcripts. Same data as the leading YouTube scrapers, priced lower per result.",
    "version": "0.0",
    "x-build-id": "dhAQa0e3sueimklLV"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/prince.sh~youtube-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-prince.sh-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/prince.sh~youtube-scraper/runs": {
      "post": {
        "operationId": "runs-sync-prince.sh-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/prince.sh~youtube-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-prince.sh-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": "Enter search terms just like you would in YouTube's search bar.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Maximum videos per search term",
            "minimum": 0,
            "maximum": 999999,
            "type": "integer",
            "description": "Limit the number of regular videos to scrape. For channels, acts as the limit for regular videos.",
            "default": 0
          },
          "maxResultsShorts": {
            "title": "Maximum shorts per search term",
            "minimum": 0,
            "maximum": 999999,
            "type": "integer",
            "description": "Limit the number of Shorts videos to scrape.",
            "default": 0
          },
          "maxResultStreams": {
            "title": "Maximum streams per search term",
            "minimum": 0,
            "maximum": 999999,
            "type": "integer",
            "description": "Limit the number of live/upcoming stream videos to scrape.",
            "default": 0
          },
          "startUrls": {
            "title": "Direct URLs",
            "type": "array",
            "description": "Link to a YouTube video, channel, playlist or search results page. You can also import a CSV or Google Sheet with URLs. <b>Note:</b> search terms are ignored when direct URLs are used.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "transcriptionAndSubtitle": {
            "title": "Transcription & subtitles",
            "enum": [
              "NONE",
              "ALWAYS_SUBTITLES",
              "TRANSCRIPTION_AS_FALLBACK",
              "ALWAYS_TRANSCRIBE"
            ],
            "type": "string",
            "description": "Download existing subtitles, generate an AI transcript for videos that lack them, or always transcribe. Subtitles land on dataset items; transcripts are stored in the key-value store.",
            "default": "NONE"
          },
          "subtitlesLanguage": {
            "title": "Subtitle language",
            "enum": [
              "any",
              "en",
              "de",
              "es",
              "fr",
              "it",
              "ja",
              "ko",
              "nl",
              "pt",
              "ru"
            ],
            "type": "string",
            "description": "Language to download subtitles in. Only used when a subtitle option is selected above.",
            "default": "en"
          },
          "subtitlesFormat": {
            "title": "Subtitle format",
            "enum": [
              "srt",
              "vtt",
              "xml",
              "plaintext"
            ],
            "type": "string",
            "description": "Format for downloaded subtitles",
            "default": "srt"
          },
          "sortingOrder": {
            "title": "Sorting order",
            "enum": [
              "relevance",
              "rating",
              "date",
              "views"
            ],
            "type": "string",
            "description": "YouTube sorting parameter for search"
          },
          "dateFilter": {
            "title": "Date filter",
            "enum": [
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "YouTube upload date filter for search"
          },
          "videoType": {
            "title": "Video type filter",
            "enum": [
              "video",
              "movie"
            ],
            "type": "string",
            "description": "YouTube video type filter for search"
          },
          "lengthFilter": {
            "title": "Video length filter",
            "enum": [
              "under4",
              "between420",
              "plus20"
            ],
            "type": "string",
            "description": "YouTube video length filter for search"
          },
          "isHD": {
            "title": "HD",
            "type": "boolean",
            "description": "Apply the HD filter for search"
          },
          "hasSubtitles": {
            "title": "Subtitles/CC",
            "type": "boolean",
            "description": "Apply the Subtitles/CC filter for search"
          },
          "hasCC": {
            "title": "Creative Commons",
            "type": "boolean",
            "description": "Apply the Creative Commons filter for search"
          },
          "is3D": {
            "title": "3D",
            "type": "boolean",
            "description": "Apply the 3D filter for search"
          },
          "isLive": {
            "title": "Live",
            "type": "boolean",
            "description": "Apply the Live filter for search"
          },
          "isBought": {
            "title": "Purchased",
            "type": "boolean",
            "description": "Apply the Purchased filter for search"
          },
          "is4K": {
            "title": "4K",
            "type": "boolean",
            "description": "Apply the 4K filter for search"
          },
          "is360": {
            "title": "360 degrees",
            "type": "boolean",
            "description": "Apply the 360 degrees filter for search"
          },
          "hasLocation": {
            "title": "Location",
            "type": "boolean",
            "description": "Apply the Location filter for search"
          },
          "isHDR": {
            "title": "HDR",
            "type": "boolean",
            "description": "Apply the HDR filter for search"
          },
          "isVR180": {
            "title": "VR180",
            "type": "boolean",
            "description": "Apply the VR180 filter for search"
          },
          "gl": {
            "title": "Country (gl)",
            "type": "string",
            "description": "YouTube country parameter (e.g. US, IN, DE). Affects which localized results and trends YouTube returns."
          },
          "hl": {
            "title": "Language (hl)",
            "type": "string",
            "description": "YouTube interface language parameter (e.g. en, hi, de). Affects localized UI text and relative dates."
          },
          "oldestPostDate": {
            "title": "Scrape videos published after [date]",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])(T[0-2]\\d:[0-5]\\d(:[0-5]\\d)?(\\.\\d+)?Z?)?$|^(\\d+)\\s*(minute|hour|day|week|month|year)s?$",
            "type": "string",
            "description": "Only posts uploaded after this date get scraped. Relative values like <code>2 days</code> also work. Applies to channel URL scraping; sorting resets to NEWEST."
          },
          "sortVideosBy": {
            "title": "Sort by",
            "enum": [
              "NEWEST",
              "POPULAR",
              "OLDEST"
            ],
            "type": "string",
            "description": "Maps to the sorting buttons on the channel's Videos, Shorts and Live pages."
          },
          "aiVideoDescription": {
            "title": "Add-on: AI video description ($)",
            "type": "boolean",
            "description": "AI-generated time-segmented description of the video, based on its transcript and metadata.",
            "default": false
          },
          "aiVideoSummary": {
            "title": "Add-on: AI video summary ($)",
            "type": "boolean",
            "description": "AI-generated concise summary of the video based on its transcript and metadata.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "YouTube rate-limits datacenter IPs. Residential proxies are recommended for large runs.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "saveSubsToKVS": {
            "title": "Save subtitles to key-value store",
            "type": "boolean",
            "description": "If true, downloaded subtitles are also saved to the key-value store. Transcripts are always saved there."
          },
          "preferAutoGeneratedSubtitles": {
            "title": "Prefer automatically generated subtitles",
            "type": "boolean",
            "description": "If true, auto-generated subtitles are preferred over uploaded ones. A subtitle option and language must be selected."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}