{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Search Scraper: Videos, Shorts, Channels, Playlists",
    "description": "Search YouTube by keyword: videos, Shorts, channels, playlists, movies with exact views, length, channel and upload age. All YouTube filters, real date ranges, many keywords per run, optional exact date, likes and comment count. No API key or login.",
    "version": "1.0",
    "x-build-id": "Ad8fWftaLDDbUCaEn"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/zhtech~youtube-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-zhtech-youtube-search-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/zhtech~youtube-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-zhtech-youtube-search-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/zhtech~youtube-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-zhtech-youtube-search-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": [
          "searchQueries"
        ],
        "properties": {
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "Keywords or phrases to search on YouTube. You can also paste a YouTube search URL (youtube.com/results?search_query=...&sp=...): its own filters are then used as they are.",
            "items": {
              "type": "string"
            }
          },
          "maxResultsPerQuery": {
            "title": "Max results per query",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "How many results to return for each query, in YouTube's order. One page is about 20 results. 0 means every result YouTube shows (usually 400 to 600 per query).",
            "default": 20
          },
          "maxResultsTotal": {
            "title": "Max results in total",
            "minimum": 0,
            "type": "integer",
            "description": "Stop the whole run after this many results across all queries. 0 means no limit. Your maximum cost per run is always respected too.",
            "default": 0
          },
          "resultType": {
            "title": "Result type",
            "enum": [
              "video",
              "shorts",
              "channel",
              "playlist",
              "movie",
              "all"
            ],
            "type": "string",
            "description": "Which kind of results to return. Each row has a type field: video, short, channel, playlist or movie.",
            "default": "video"
          },
          "uploadDate": {
            "title": "Upload date",
            "enum": [
              "any",
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Only results uploaded within this period. Results that YouTube shows anyway but that are clearly older are removed and not charged (see Strict date check).",
            "default": "any"
          },
          "duration": {
            "title": "Duration",
            "enum": [
              "any",
              "under3",
              "3to20",
              "over20"
            ],
            "type": "string",
            "description": "Video length filter. Applies to videos and movies.",
            "default": "any"
          },
          "features": {
            "title": "Features",
            "type": "array",
            "description": "Results must have all the features you pick.",
            "items": {
              "type": "string",
              "enum": [
                "live",
                "4k",
                "hd",
                "subtitles",
                "creativeCommons",
                "360",
                "vr180",
                "3d",
                "hdr",
                "location",
                "purchased"
              ],
              "enumTitles": [
                "Live",
                "4K",
                "HD",
                "Subtitles/CC",
                "Creative Commons",
                "360 degrees",
                "VR180",
                "3D",
                "HDR",
                "Location",
                "Purchased"
              ]
            },
            "default": []
          },
          "sortBy": {
            "title": "Prioritize",
            "enum": [
              "relevance",
              "popularity"
            ],
            "type": "string",
            "description": "YouTube's own ordering. YouTube removed sorting by upload date and rating in 2025: for recent videos use Upload date or Published after.",
            "default": "relevance"
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "Two letter country code you search from, like YouTube's Location setting (US, GB, DE, IN, BR...). Results differ by country.",
            "default": "US"
          },
          "language": {
            "title": "Interface language",
            "type": "string",
            "description": "Language code for YouTube's interface (en, de, es, pt...). Keep en for parsed dates: with other languages the relative time stays in that language and publishedAtEstimate is empty, while exact counts still work.",
            "default": "en"
          },
          "exactQuery": {
            "title": "Search the exact words (no autocorrect)",
            "type": "boolean",
            "description": "YouTube silently corrects queries it thinks are misspelled (brand names, slang). Turn this on to search exactly what you typed. When YouTube corrects a query, rows include correctedQuery so you can see it.",
            "default": false
          },
          "detailsMode": {
            "title": "Extra details",
            "enum": [
              "shorts",
              "all",
              "none"
            ],
            "type": "string",
            "description": "The search page already gives title, channel, exact views, length and age of every video. Shorts show only title and rounded views there, so by default the scraper looks up their channel, exact date, length and likes. Full details adds 1 to 2 small requests per video and makes runs slower, but costs the same per result.",
            "default": "shorts"
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Only results published after this date: 2026-01-31, 2026-01-31T12:00:00Z or a period such as \"3 days\", \"2 weeks\", \"6 months\". The matching YouTube upload date filter is applied automatically."
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "Only results published before this date. Same formats as Published after. Use both for a date range."
          },
          "minViews": {
            "title": "Minimum views",
            "minimum": 0,
            "type": "integer",
            "description": "Skip videos with fewer views. 0 means no minimum.",
            "default": 0
          },
          "strictDateFilter": {
            "title": "Strict date check",
            "type": "boolean",
            "description": "YouTube sometimes mixes older videos into filtered searches. With this on, results that are clearly outside the upload date filter are removed and not charged.",
            "default": true
          },
          "deduplicateAcrossQueries": {
            "title": "Remove duplicates across queries",
            "type": "boolean",
            "description": "Return each video, channel or playlist only once per run, even if several queries find it. Duplicates inside one query are always removed.",
            "default": false
          },
          "includeErrorItems": {
            "title": "Add notice rows for empty or failed queries",
            "type": "boolean",
            "description": "Add a free row (type = query, status = error) when a query returns nothing or fails, so integrations can see it. These rows are never charged.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Apify Proxy datacenter IPs work for search. If YouTube blocks the details lookups, those are retried on residential IPs automatically.",
            "default": {
              "useApifyProxy": true
            }
          },
          "residentialFallback": {
            "title": "Residential fallback",
            "type": "boolean",
            "description": "Retry blocked requests through Apify residential IPs. Only used with Apify Proxy datacenter groups.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Detail lookups run in parallel. Up to 3 queries are searched at the same time.",
            "default": 10
          },
          "maxRetries": {
            "title": "Max retries per request",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Retries with a fresh proxy session and backoff before a request counts as failed.",
            "default": 5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}