{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Search Scraper: Videos & Channel Discovery",
    "description": "YouTube search scraper and YouTube search API: run a YouTube video search by keyword and get videos, Shorts, channels or playlists with views, age, length, channel and badges, in any country and language, with filters. A YouTube keyword scraper; full likes and comments as an add-on. No login.",
    "version": "0.1",
    "x-build-id": "7soyprHYQZMzIhmGN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/deepmine~youtube-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-deepmine-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/deepmine~youtube-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-deepmine-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/deepmine~youtube-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-deepmine-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",
        "properties": {
          "searchQueries": {
            "title": "🔎 Search terms",
            "type": "array",
            "description": "What to search on YouTube, one term per line (as you'd type it in YouTube's search box). YouTube search links (youtube.com/results?search_query=...) work too, with the filters in the link. Each result is saved and charged once per run, even when several terms find it. Required for API calls: searchQueries, or the same list as query, queries, q or startUrls.",
            "items": {
              "type": "string",
              "pattern": "\\S"
            }
          },
          "type": {
            "title": "🏷️ Result type",
            "enum": [
              "video",
              "shorts",
              "channel",
              "playlist",
              "movie"
            ],
            "type": "string",
            "description": "What to find: videos, Shorts, channels, playlists or movies (YouTube's own Type filter). One type per run.",
            "default": "video"
          },
          "maxResults": {
            "title": "🔢 Results per search term",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "The most results to save for each search term (100 when left empty). YouTube stops a search after a few hundred results for most terms."
          },
          "fullDetails": {
            "title": "➕ Full details (add-on)",
            "type": "boolean",
            "description": "Off: each row is what YouTube's search page shows (fast, the lowest price). On: video, Short and movie rows also get exact likes, comments, the exact publish time, tags, category, the full description and the channel's subscribers, total views, country and join date; channel rows get the channel's About panel. Each such row costs a small add-on (see Pricing). Playlists are always saved as the search shows them.",
            "default": false
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "popularity",
              "date",
              "rating"
            ],
            "type": "string",
            "description": "YouTube's 'Prioritize' order: relevance or popularity (most viewed). Upload date and rating also work.",
            "default": "relevance"
          },
          "uploadDate": {
            "title": "Upload date",
            "enum": [
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Only results uploaded within this time (videos, Shorts and movies)."
          },
          "duration": {
            "title": "Duration",
            "enum": [
              "under3min",
              "3to20min",
              "over20min"
            ],
            "type": "string",
            "description": "Only videos of this length (YouTube's buckets)."
          },
          "searchFeatures": {
            "title": "Features",
            "type": "array",
            "description": "Only videos with all of these (YouTube's Features filter).",
            "items": {
              "type": "string",
              "enum": [
                "live",
                "4k",
                "hd",
                "subtitles",
                "creativeCommons",
                "360",
                "vr180",
                "3d",
                "hdr",
                "location",
                "purchased"
              ],
              "enumTitles": [
                "Live",
                "4K",
                "HD",
                "Subtitles/CC",
                "Creative Commons",
                "360°",
                "VR180",
                "3D",
                "HDR",
                "Location",
                "Purchased"
              ]
            }
          },
          "country": {
            "title": "🌍 Country",
            "pattern": "^[A-Za-z]{2}$",
            "type": "string",
            "description": "Search as from this country: a two-letter code such as US, GB, IN, DE, BR, JP (US when left empty). YouTube ranks results by country."
          },
          "language": {
            "title": "🗣️ Language",
            "pattern": "^[A-Za-z]{2,3}(-[A-Za-z]{2,4})?$",
            "type": "string",
            "description": "Search in this language: a code such as en, es, pt, fr, de, ja, ko, hi, ar, or pt-BR, zh-TW (en when left empty). YouTube returns different results per language, and writes ages and counts in it; rows keep the text as shown and the numbers as numbers."
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Apify's datacenter proxy works for every call; there's no need to change it.",
            "default": {
              "useApifyProxy": true
            }
          },
          "query": {
            "title": "Search term (other Actors' inputs)",
            "type": "string",
            "description": "One search term, for saved inputs from other YouTube search Actors (query)."
          },
          "q": {
            "title": "Search term (other Actors' inputs)",
            "type": "string",
            "description": "One search term, for saved inputs from other YouTube search Actors (q)."
          },
          "maxItems": {
            "title": "Results per search term (other Actors' inputs)",
            "type": "integer",
            "description": "The same as maxResults, for saved inputs from other YouTube search Actors (maxItems)."
          },
          "geo": {
            "title": "Country (other Actors' inputs)",
            "type": "string",
            "description": "The same as country (geo)."
          },
          "lang": {
            "title": "Language (other Actors' inputs)",
            "type": "string",
            "description": "The same as language (lang)."
          },
          "videoDepthDetails": {
            "title": "Detail level (other Actors' inputs)",
            "type": "string",
            "description": "basic = search rows; standard, detailed or complete = full details (the same as fullDetails on)."
          },
          "scrapeAllResults": {
            "title": "Every result (other Actors' inputs)",
            "type": "boolean",
            "description": "Read every page YouTube has for each term (up to 5,000 results)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}