{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper - Videos, Shorts, Channels & Playlists",
    "description": "Scrape YouTube videos from searches, channels, playlists and single URLs: exact views, likes, publish times, durations, tags and channel data as parsed numbers. $0.30 per 1,000 videos, platform usage included. No minimums, failed inputs and duplicates are free.",
    "version": "0.1",
    "x-build-id": "8sPVa7wRtzpQpbopb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ragnum~youtube-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ragnum-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/ragnum~youtube-scraper/runs": {
      "post": {
        "operationId": "runs-sync-ragnum-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/ragnum~youtube-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-ragnum-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 queries",
            "type": "array",
            "description": "Keywords to search on YouTube, one per line. Each query is searched separately and returns up to 'Max results per input' videos. Leave empty if you only use start URLs.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs, handles or IDs",
            "type": "array",
            "description": "Any mix of: video URLs (watch, youtu.be, /shorts/, /live/), video IDs, channel URLs (/@handle, /channel/UC…, /c/…, /user/…), @handles, UC… channel IDs, playlist URLs or IDs, and search result URLs (/results?search_query=…). Single video URLs return exactly one row each.",
            "items": {
              "type": "string"
            }
          },
          "maxResultsPerInput": {
            "title": "Max results per input",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of videos to return for each search query, channel or playlist (1–10,000). Ignored for single video URLs. You pay per video returned, so this caps the cost of each input.",
            "default": 50
          },
          "maxResults": {
            "title": "Max results in total",
            "minimum": 1,
            "type": "integer",
            "description": "Optional cap on the total number of videos for the whole run, across all inputs. Leave empty for no global cap."
          },
          "contentType": {
            "title": "Channel content",
            "enum": [
              "videos",
              "shorts",
              "streams",
              "all"
            ],
            "type": "string",
            "description": "For channel inputs: which tab to read. 'all' reads videos, then Shorts, then live streams until 'Max results per input' is reached. A channel URL that names a tab (e.g. /@name/shorts) uses that tab.",
            "default": "videos"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "views",
              "newest",
              "popular",
              "oldest"
            ],
            "type": "string",
            "description": "Searches: 'relevance' (default) or 'views' (most viewed first). Channels: 'newest' (default), 'popular' or 'oldest'. 'views' and 'popular' are interchangeable. Searches can't be sorted by upload date; use 'Upload date' to get recent videos instead.",
            "default": "relevance"
          },
          "uploadDate": {
            "title": "Upload date (search only)",
            "enum": [
              "any",
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Only return search results uploaded within this period.",
            "default": "any"
          },
          "duration": {
            "title": "Duration (search only)",
            "enum": [
              "any",
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "Only return search results of this length: short = under 3 minutes, medium = 3–20 minutes, long = over 20 minutes (the same buckets as on YouTube).",
            "default": "any"
          },
          "features": {
            "title": "Features (search only)",
            "type": "array",
            "description": "Only return search results with all selected features: hd, 4k, live, subtitles, creativeCommons, hdr, vr180, 360.",
            "items": {
              "type": "string",
              "enum": [
                "hd",
                "4k",
                "live",
                "subtitles",
                "creativeCommons",
                "hdr",
                "vr180",
                "360"
              ],
              "enumTitles": [
                "HD",
                "4K",
                "Live",
                "Subtitles/CC",
                "Creative Commons",
                "HDR",
                "VR180",
                "360°"
              ]
            },
            "default": []
          },
          "includeDetails": {
            "title": "Include video details",
            "type": "boolean",
            "description": "On (default): also read each video's page for the exact publish time, exact view and like counts, full description, tags, category, family-safe flag, comment count, channel subscriber count and the list of caption languages. Off: listing fields only (title, views, duration, relative date, thumbnails), which is faster. The price per video is the same either way.",
            "default": true
          },
          "hl": {
            "title": "Interface language (hl)",
            "type": "string",
            "description": "YouTube interface language code, e.g. en, de, fr, es, pt, ja. Affects display texts such as '1.2M views'; numbers are parsed for you either way.",
            "default": "en"
          },
          "gl": {
            "title": "Region (gl)",
            "type": "string",
            "description": "Two-letter country code for regional results, e.g. US, GB, DE.",
            "default": "US"
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many videos are processed in parallel (1–20).",
            "default": 10
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. The default works for most runs.",
            "default": {
              "useApifyProxy": true
            }
          },
          "residentialFallback": {
            "title": "Automatic fallback proxy",
            "type": "boolean",
            "description": "When a request keeps getting blocked, retry it automatically through a different proxy type. Recommended.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}