{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper - Exact Views & Likes",
    "description": "Scrape YouTube videos, Shorts, streams, channels, playlists, search results and comments in one Actor. Returns exact view and like counts read from each video, not the rounded labels other scrapers ship, plus category, tags, subtitle languages and engagement metrics. No API key or quota.",
    "version": "0.1",
    "x-build-id": "7ESLJrnbRsYKLLMMd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/trakk~youtube-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-trakk-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/trakk~youtube-scraper/runs": {
      "post": {
        "operationId": "runs-sync-trakk-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/trakk~youtube-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-trakk-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 terms",
            "type": "array",
            "description": "Search YouTube for these terms. Combine with the filters below to narrow the results.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Direct URLs",
            "type": "array",
            "description": "Video, shorts, live, channel, channel tab (/videos, /shorts, /streams), playlist or search URLs. Handles like @mkbhd and bare video IDs also work.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxResults": {
            "title": "Maximum videos per source",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "How many videos to return for each search term or channel.",
            "default": 50
          },
          "maxResultsShorts": {
            "title": "Maximum shorts per channel",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Shorts are only scraped when this is above zero.",
            "default": 0
          },
          "maxResultStreams": {
            "title": "Maximum live streams per channel",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Past live streams are only scraped when this is above zero.",
            "default": 0
          },
          "preset": {
            "title": "Data precision",
            "enum": [
              "fast",
              "balanced",
              "detailed"
            ],
            "type": "string",
            "description": "Balanced and Detailed open each video to read its exact view count, exact like count and full publish timestamp. Fast skips that and returns YouTube's rounded listing labels (\"18M views\", \"2 days ago\"); those rows are marked dataPrecision=approximate.",
            "default": "balanced"
          },
          "sortingOrder": {
            "title": "Sort search results by",
            "enum": [
              "relevance",
              "date",
              "views",
              "rating"
            ],
            "type": "string",
            "description": "Applies to search terms only.",
            "default": "relevance"
          },
          "dateFilter": {
            "title": "Uploaded within",
            "enum": [
              "any",
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "YouTube's own upload-date filter, applied at the source.",
            "default": "any"
          },
          "videoType": {
            "title": "Result type",
            "enum": [
              "any",
              "video",
              "shorts",
              "channel",
              "playlist",
              "movie"
            ],
            "type": "string",
            "description": "Restrict search results to one kind of result.",
            "default": "video"
          },
          "lengthFilter": {
            "title": "Video length",
            "enum": [
              "any",
              "under3",
              "3to20",
              "over20",
              "under4"
            ],
            "type": "string",
            "description": "Restrict search results by video length.",
            "default": "any"
          },
          "isHD": {
            "title": "HD only",
            "type": "boolean",
            "description": "Only results available in HD.",
            "default": false
          },
          "is4K": {
            "title": "4K only",
            "type": "boolean",
            "description": "Only results available in 4K.",
            "default": false
          },
          "isHDR": {
            "title": "HDR only",
            "type": "boolean",
            "description": "Only results available in HDR.",
            "default": false
          },
          "hasSubtitles": {
            "title": "Has subtitles/CC",
            "type": "boolean",
            "description": "Only results that have subtitles or closed captions.",
            "default": false
          },
          "hasCC": {
            "title": "Creative Commons",
            "type": "boolean",
            "description": "Only results published under a Creative Commons licence.",
            "default": false
          },
          "isLive": {
            "title": "Live only",
            "type": "boolean",
            "description": "Only results that are live right now.",
            "default": false
          },
          "is360": {
            "title": "360° only",
            "type": "boolean",
            "description": "Only 360-degree results.",
            "default": false
          },
          "is3D": {
            "title": "3D only",
            "type": "boolean",
            "description": "Only 3D results.",
            "default": false
          },
          "isVR180": {
            "title": "VR180 only",
            "type": "boolean",
            "description": "Only VR180 results.",
            "default": false
          },
          "oldestPostDate": {
            "title": "Published after",
            "type": "string",
            "description": "Keep videos published after this date. Accepts YYYY-MM-DD or a relative form such as \"7 days\". Applied to the exact publish timestamp on Balanced and Detailed."
          },
          "newestPostDate": {
            "title": "Published before",
            "type": "string",
            "description": "Keep videos published before this date. Same formats as above."
          },
          "includeComments": {
            "title": "Also scrape comments",
            "type": "boolean",
            "description": "Attach top-level comments to each video row.",
            "default": false
          },
          "maxComments": {
            "title": "Maximum comments per video",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "How many top-level comments to attach to each video. Comments are only scraped when this is above zero.",
            "default": 0
          },
          "sortCommentsBy": {
            "title": "Sort comments by",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "Whether to take YouTube's top comments or the most recent ones.",
            "default": "top"
          },
          "region": {
            "title": "Results region",
            "type": "string",
            "description": "Two-letter country code YouTube should serve results for.",
            "default": "US"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy used to reach YouTube. The default works for most runs.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}