{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Metadata Scraper",
    "description": "Scrape comprehensive YouTube video data with the YouTube Metadata Scraper. Extract titles, descriptions, tags, views, likes, comments, upload dates, and more. Perfect for SEO, content analysis, trend tracking, and research. Fast, accurate, and scalable for single or bulk videos.",
    "version": "0.1",
    "x-build-id": "cqdktwUAZNsD42pGf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapier~youtube-metadata-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapier-youtube-metadata-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/scrapier~youtube-metadata-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapier-youtube-metadata-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/scrapier~youtube-metadata-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapier-youtube-metadata-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": {
          "urls": {
            "title": "🔗 Video URLs or IDs",
            "type": "array",
            "description": "One entry per video. Accepted shapes: `youtube.com/watch?v=…`, `youtu.be/…`, `youtube.com/shorts/…`, `youtube.com/live/…`, `youtube.com/embed/…`, `youtube.com/v/…` and the bare 11-character video ID. Leave empty if you only want keyword-based discovery.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "🔍 Search keywords",
            "type": "array",
            "description": "YouTube search phrases — one phrase per line. **Sort** and **Max videos per keyword** in this same panel control ranking and how many videos are collected per phrase. Shorts that appear inside search results are skipped; a Shorts watch URL pasted above is scraped normally.",
            "items": {
              "type": "string"
            }
          },
          "sort_order": {
            "title": "📊 Sort keyword results by",
            "enum": [
              "relevance",
              "upload_date",
              "view_count",
              "rating"
            ],
            "type": "string",
            "description": "Applies to **keyword** runs only. YouTube's live sort menu currently honours only **Relevance** and **View count**; `upload_date` and `rating` are still sent and still accepted for input compatibility, but YouTube ignores them and the run logs a warning instead of pretending otherwise.",
            "default": "relevance"
          },
          "max_results_per_keyword": {
            "title": "🔢 Max videos per keyword",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "At most this many videos are taken **per keyword**, paging through YouTube's search continuations. YouTube stops serving new results well before any high number: the measured deep-page ceiling is roughly **133–484 videos per keyword** and varies by phrase, so a value above that returns whatever YouTube still has.",
            "default": 10
          },
          "max_comments": {
            "title": "💬 Max comments per video",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Top-level comments to store for each video (verified exact from 0 up to 300+). Set **0** to skip comments entirely. Reply bodies, comment sort order and comment permalinks are not collected here.",
            "default": 2
          },
          "include_transcripts": {
            "title": "📥 Include transcripts",
            "type": "boolean",
            "description": "Attach caption text for each video when YouTube exposes captions for that upload. Duplicate tracks carrying identical text are removed, and the download is capped at 6 languages and 150 seconds per video.",
            "default": true
          },
          "transcript_format": {
            "title": "🧾 Transcript format",
            "enum": [
              "text",
              "timestamps"
            ],
            "type": "string",
            "description": "`text` puts one paragraph string in `content`; `timestamps` puts a list of `{start, dur, text}` segments there instead.",
            "default": "text"
          },
          "include_english_auto": {
            "title": "🤖 Include auto-generated English",
            "type": "boolean",
            "description": "Also allow **YouTube auto-captions** in English alongside creator-uploaded captions. Turning this on is what lifts transcript coverage on videos that have no manual captions.",
            "default": false
          },
          "include_non_english": {
            "title": "🌍 Include non-English captions",
            "type": "boolean",
            "description": "Allow non-English manual or auto tracks. Popular videos expose dozens of auto-translated languages; the run keeps the first 6 distinct tracks and stops there so a single video cannot stall the whole job.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "🔒 Proxy configuration",
            "type": "object",
            "description": "Your proxy choice is honoured request by request. **Residential + US is the default and is strongly recommended**: on a datacenter exit, roughly 83% of watch pages come back as an HTTP 200 sign-in page with no title, and transcripts return nothing at all. If a page comes back walled the run escalates to Residential/US on its own and says so in the log.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountryCode": "US"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}