YouTube Scraper
Pricing
from $0.94 / 1,000 video scrapeds
YouTube Scraper
Search videos, get playlists, single videos with comments and all in any language
YouTube Scraper
Pricing
from $0.94 / 1,000 video scrapeds
Search videos, get playlists, single videos with comments and all in any language
You can access the YouTube Scraper programmatically from your own applications by using the Apify API. You can also choose the language preference from below. To use the Apify API, you’ll need an Apify account and your API token, found in API & Integrations in Apify Console.
{ "openapi": "3.0.1", "info": { "version": "0.1", "x-build-id": "FvqWhnX4qct4DwEg2" }, "servers": [ { "url": "https://api.apify.com/v2" } ], "paths": { "/acts/ecommerce_leads~youtube-scraper/run-sync-get-dataset-items": { "post": { "operationId": "run-sync-get-dataset-items-ecommerce_leads-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/ecommerce_leads~youtube-scraper/runs": { "post": { "operationId": "runs-sync-ecommerce_leads-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/ecommerce_leads~youtube-scraper/run-sync": { "post": { "operationId": "run-sync-ecommerce_leads-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", "required": [ "mode" ], "properties": { "mode": { "title": "1. Mode — pick what to scrape", "enum": [ "channel", "playlist", "search", "video" ], "type": "string", "description": "Choose one. Then fill in ONLY the fields for that mode below; every other field is ignored.\n\n• Channel — all videos, shorts or streams from a channel\n• Playlist — every video in a playlist\n• Search — search results\n• Single videos — full details for specific videos, with comments", "default": "channel" }, "channel": { "title": "Channel · REQUIRED for Channel mode", "type": "string", "description": "REQUIRED IF MODE = CHANNEL. Ignored in every other mode.\n\nAccepts a channel id (UC...), an @username, or a full channel URL.\nExamples: @LinusTechTips · UCXuqSBlHAE6Xw-yeJA0Tunw · https://www.youtube.com/@MrBeast" }, "contentType": { "title": "Channel tab · Channel mode only", "enum": [ "videos", "shorts", "streams" ], "type": "string", "description": "Optional. Used only in Channel mode. Which tab of the channel to scrape. Defaults to Videos.", "default": "videos" }, "sortBy": { "title": "Channel sort order · Channel mode only", "enum": [ "newest", "popular", "oldest" ], "type": "string", "description": "Optional. Used only in Channel mode. Popular and Oldest need a channel with enough videos for YouTube to show its filter chips; smaller channels fall back to Newest.", "default": "newest" }, "playlistId": { "title": "Playlist ID · REQUIRED for Playlist mode", "type": "string", "description": "REQUIRED IF MODE = PLAYLIST. Ignored in every other mode.\n\nThe id after 'list=' in a playlist URL.\nExample: PLZbbT5o_s2xrwRnXk_yCPtnqqo4_u2YGL" }, "searchQuery": { "title": "Search query · REQUIRED for Search mode", "type": "string", "description": "REQUIRED IF MODE = SEARCH. Ignored in every other mode.\n\nWhat to search YouTube for.\nExample: python tutorial" }, "resultsType": { "title": "Search result type · Search mode only", "enum": [ "video", "channel", "playlist", "movie" ], "type": "string", "description": "Optional. Used only in Search mode. What kind of results to return. Defaults to Videos.", "default": "video" }, "searchSortBy": { "title": "Search sort order · Search mode only", "enum": [ "relevance", "upload_date", "view_count", "rating" ], "type": "string", "description": "Optional. Used only in Search mode. Defaults to Relevance.", "default": "relevance" }, "videoIds": { "title": "Video IDs or URLs · REQUIRED for Single videos mode", "type": "array", "description": "REQUIRED IF MODE = SINGLE VIDEOS. Ignored in every other mode.\n\nOne entry per video. Accepts bare ids, watch URLs, youtu.be links or shorts URLs.\nExamples: dQw4w9WgXcQ · https://www.youtube.com/watch?v=dQw4w9WgXcQ · https://youtu.be/dQw4w9WgXcQ", "items": { "type": "string" } }, "commentsPerVideo": { "title": "Comments per video · Single videos mode only", "minimum": 0, "maximum": 200, "type": "integer", "description": "Optional. Used only in Single videos mode. How many top comments to include with each video. Set 0 to skip comments. Comments are included in the per-video price, so 20 costs the same as 0.", "default": 20 }, "maxItems": { "title": "Max items · all modes", "minimum": 1, "type": "integer", "description": "Optional. Applies to every mode. Stop after this many results. Leave empty to scrape everything the target has.", "default": 50 }, "language": { "title": "Language · all modes", "type": "string", "description": "Optional. Applies to every mode. Defaults to 'en'.\n\nYouTube returns this locale's version of the data: view counts, dates and subscriber counts are always localised, and titles and descriptions are localised where the creator published a translation.\n\nExamples: en · es · de · fr · pt-BR · ja", "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 } } } } } } } } }}OpenAPI is a standard for designing and describing RESTful APIs, allowing developers to define API structure, endpoints, and data formats in a machine-readable way. It simplifies API development, integration, and documentation.
OpenAPI is effective when used with AI agents and GPTs by standardizing how these systems interact with various APIs, for reliable integrations and efficient communication.
By defining machine-readable API specifications, OpenAPI allows AI models like GPTs to understand and use varied data sources, improving accuracy. This accelerates development, reduces errors, and provides context-aware responses, making OpenAPI a core component for AI applications.
You can download the OpenAPI definitions for YouTube Scraper from the options below:
If you’d like to learn more about how OpenAPI powers GPTs, read our blog post.
You can also check out our other API clients: