{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper — Search, Channels, Videos & Playlists",
    "description": "All-in-one YouTube data Actor: keyword search, per-video detail (exact player fields when served, else exact-id list metadata), channel videos/shorts/live and whole playlists — one flat schema, no API key, no login, no proxy. Pay per result: 1 unit per row; failed or empty lookups never billed.",
    "version": "0.1",
    "x-build-id": "E1m3VmybeiolqLytL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datamule~youtube-data-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datamule-youtube-data-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/datamule~youtube-data-scraper/runs": {
      "post": {
        "operationId": "runs-sync-datamule-youtube-data-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/datamule~youtube-data-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-datamule-youtube-data-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": "Mode",
            "enum": [
              "search",
              "videos",
              "channel",
              "playlist"
            ],
            "type": "string",
            "description": "What to scrape. 'search' = keyword search results. 'videos' = per-video detail for the exact video URLs/IDs you list: exact player fields (exact view/like counts, exact publish date, category, keywords) when YouTube serves the player to the run, otherwise exact-id list metadata (approximate view text and relative publish text, exact-only fields omitted). 'channel' = a channel's Videos / Shorts / Live tabs. 'playlist' = every item of a playlist, in order. Each mode reads its own input field below.",
            "default": "search"
          },
          "searchQueries": {
            "title": "Search queries (mode = search)",
            "type": "array",
            "description": "One or more keyword queries. Each query is paginated up to 'Max items per target'. Only used when mode = search.",
            "items": {
              "type": "string"
            }
          },
          "videoUrls": {
            "title": "Video URLs or IDs (mode = videos)",
            "type": "array",
            "description": "Watch URLs, Shorts URLs, youtu.be links, or bare 11-character video IDs. Only used when mode = videos. Each resolvable listed video returns one row, and every delivered row belongs to the exact id you requested: exact player metadata when YouTube serves the player to the run, otherwise the exact-id list metadata (approximate view text, relative publish text) with the exact-only fields omitted.",
            "items": {
              "type": "string"
            }
          },
          "channelUrls": {
            "title": "Channel URLs, handles or IDs (mode = channel)",
            "type": "array",
            "description": "Channel handles (@name), /channel/UC… URLs, /c/… or /user/… URLs, or bare UC… channel IDs. Handles are resolved to a channel ID automatically. Only used when mode = channel.",
            "items": {
              "type": "string"
            }
          },
          "playlistUrls": {
            "title": "Playlist URLs or IDs (mode = playlist)",
            "type": "array",
            "description": "Playlist URLs (…?list=PL…) or bare playlist IDs. Items are returned in playlist order with their position. Only used when mode = playlist.",
            "items": {
              "type": "string"
            }
          },
          "channelTabs": {
            "title": "Channel tabs",
            "type": "array",
            "description": "Which channel tabs to read when mode = channel. Shorts are emitted with type 'short'; videos and live streams with type 'video'.",
            "items": {
              "type": "string",
              "enum": [
                "videos",
                "shorts",
                "streams"
              ],
              "enumTitles": [
                "Videos",
                "Shorts",
                "Live streams"
              ]
            },
            "default": [
              "videos"
            ]
          },
          "maxItems": {
            "title": "Max items (whole run)",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard cap on the total number of rows this run will emit and bill across every target. The run stops as soon as it is reached. Billing is per delivered row: every video/short/channel/playlist row costs 1 result unit. Nothing that fails or comes back empty is billed.",
            "default": 100
          },
          "maxItemsPerTarget": {
            "title": "Max items per target",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Cap per individual query / channel tab / playlist, so one huge target cannot consume the whole run budget. Defaults to the whole-run cap."
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Interface language (hl), e.g. 'en', 'de', 'ja'. Affects titles and human-readable metadata text.",
            "default": "en"
          },
          "region": {
            "title": "Region",
            "type": "string",
            "description": "Two-letter region code (gl) used for results, e.g. 'US', 'GB', 'SG'. Affects ranking and availability.",
            "default": "US"
          },
          "includeChannelInfo": {
            "title": "Include a channel summary row",
            "type": "boolean",
            "description": "When on, mode = channel also emits one 'channel' row per channel (title, description, handle URL, keywords) in addition to its videos.",
            "default": true
          },
          "timeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 600,
            "type": "integer",
            "description": "Per-request timeout for each YouTube call.",
            "default": 60
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Bounded retry attempts per request for transient failures (HTTP 429/5xx and network errors), with exponential backoff.",
            "default": 4
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional proxy for YouTube requests. All four modes work without a proxy; enable one only if you want IP rotation on very large runs. Proxy traffic is billed by the Apify platform on top of this Actor's per-result price.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}