{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Video Scraper API | Keyword, Channels, Playlists",
    "description": "Extract videos with this YouTube keyword scraper: search results, channels and playlists at $0.25 per 1,000 videos on the free plan, each with full watch-page details: exact views, likes, comment count, publish time, tags, category, subscribers. YouTube's filters, a date range, only-new mode.",
    "version": "0.1",
    "x-build-id": "rJydEb0ZgN9dAuAjQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/aurelix~youtube-video-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-aurelix-youtube-video-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/aurelix~youtube-video-scraper/runs": {
      "post": {
        "operationId": "runs-sync-aurelix-youtube-video-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/aurelix~youtube-video-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-aurelix-youtube-video-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": {
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords to search on YouTube, e.g. ['coffee roasting', 'home espresso']. Results come in YouTube's own order, with the filters below. A pasted YouTube search-results URL keeps its own filters.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max videos per search, channel or playlist",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "How many videos to return from each search term, channel and playlist, e.g. 50. Videos given directly are always read. YouTube shows at most a few hundred results for one search.",
            "default": 20
          },
          "sort": {
            "title": "Search: prioritize",
            "enum": [
              "relevance",
              "popularity"
            ],
            "type": "string",
            "description": "YouTube's 'Prioritize' option for search results: relevance (default) or popularity. YouTube no longer offers an upload-date sort; use 'Upload date' or 'Published after' to get recent videos.",
            "default": "relevance"
          },
          "uploadDate": {
            "title": "Search: upload date",
            "enum": [
              "any",
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "YouTube's upload-date filter for search results.",
            "default": "any"
          },
          "videoType": {
            "title": "Search: type",
            "enum": [
              "videos",
              "shorts",
              "all"
            ],
            "type": "string",
            "description": "Videos (default) uses YouTube's 'Videos' filter; Shorts uses its 'Shorts' filter; 'Videos and Shorts' applies no type filter and also keeps the Shorts shelves inside the results.",
            "default": "videos"
          },
          "duration": {
            "title": "Search: duration",
            "enum": [
              "any",
              "under3",
              "3to20",
              "over20"
            ],
            "type": "string",
            "description": "YouTube's duration filter for search results.",
            "default": "any"
          },
          "features": {
            "title": "Search: features",
            "type": "array",
            "description": "YouTube's feature filters for search results, e.g. ['hd', 'subtitles']. Several can be combined.",
            "items": {
              "type": "string",
              "enum": [
                "live",
                "4k",
                "hd",
                "subtitles",
                "creative_commons",
                "360",
                "vr180",
                "3d",
                "hdr",
                "location"
              ],
              "enumTitles": [
                "Live",
                "4K",
                "HD",
                "Subtitles/CC",
                "Creative Commons",
                "360°",
                "VR180",
                "3D",
                "HDR",
                "Location"
              ]
            },
            "default": []
          },
          "country": {
            "title": "Search: country (optional)",
            "type": "string",
            "description": "Two-letter country code for search results as people in that country see them, e.g. 'GB' or 'DE'. Leave empty for the default (United States)."
          },
          "videos": {
            "title": "Video URLs",
            "type": "array",
            "description": "Video URLs or 11-character IDs, e.g. ['https://www.youtube.com/watch?v=dQw4w9WgXcQ', 'https://youtu.be/jNQXAC9IVRw']. Shorts and live links work too. Channel, playlist, search-results and hashtag URLs pasted here are read as such.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "channels": {
            "title": "Channels",
            "type": "array",
            "description": "Channel URLs, @handles or UC… channel IDs, e.g. ['https://www.youtube.com/@veritasium', '@mkbhd']. Videos are read from the tab below, in the order below.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "channelTab": {
            "title": "Channel tab",
            "enum": [
              "videos",
              "shorts",
              "streams"
            ],
            "type": "string",
            "description": "Which tab of each channel to read. A channel URL that names a tab (e.g. …/@mkbhd/shorts) keeps its own tab.",
            "default": "videos"
          },
          "channelSort": {
            "title": "Channel order",
            "enum": [
              "latest",
              "popular",
              "oldest"
            ],
            "type": "string",
            "description": "The channel tab's own sort buttons: latest (default), popular or oldest.",
            "default": "latest"
          },
          "playlists": {
            "title": "Playlists",
            "type": "array",
            "description": "Playlist URLs or IDs, e.g. ['https://www.youtube.com/playlist?list=PLFs4vir_WsTwEd-nJgVJCZPNL3HALHHpF'], read in playlist order.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "publishedAfter": {
            "title": "Published after (optional)",
            "type": "string",
            "description": "Return only videos published after this point: a date (YYYY-MM-DD) or an age such as '7 days', '12 hours' or '3 months'. Checked against the exact publish time on each watch page; older videos are skipped and not charged. On a channel sorted by latest, reading stops once 3 older videos in a row are seen."
          },
          "publishedBefore": {
            "title": "Published before (optional)",
            "type": "string",
            "description": "Return only videos published before this point: a date (YYYY-MM-DD) or an age such as '30 days'. Use with 'Published after' for a from-to range. Newer videos are skipped and not charged."
          },
          "incremental": {
            "title": "Only new videos since last run",
            "type": "boolean",
            "description": "Return only videos that a previous run with the same inputs did not return. On a channel in latest order the run stops at the first one already returned, so a daily schedule gets just the new uploads (or nothing). On a search term the results are not ordered by date, so 'new' means not returned before, and reading stops after 3 result pages in a row with nothing new. Already-returned videos are never returned or charged again.",
            "default": false
          },
          "stateKey": {
            "title": "Incremental state name (optional)",
            "type": "string",
            "description": "Name for the 'new since last run' memory, e.g. 'my-niche-feed'. Leave empty to derive it from the inputs."
          },
          "slackWebhookUrl": {
            "title": "Slack webhook URL (optional)",
            "type": "string",
            "description": "After each run, post a short digest to Slack: how many results were saved (new ones only when 'Only new videos since last run' is on) and the top 10 with links, e.g. https://hooks.slack.com/services/T000/B000/XXXX. Nothing is posted when the run saved nothing. Leave empty to skip."
          },
          "webhookUrl": {
            "title": "Webhook URL (optional)",
            "type": "string",
            "description": "After each run, POST the same digest as JSON (actor, newOnly, count, items = top 10 results, runUrl, text) to any URL, e.g. a Zapier, Make or n8n webhook. Nothing is sent when the run saved nothing. Leave empty to skip."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}