{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Search Scraper - Keyword Results, Views, 4K, Filters",
    "description": "[💰$0.10/1K] Scrape YouTube search results for any keyword: one row per video, Short, channel or playlist with title, URL, views, duration, upload age, channel link and rank. Upload date, length, 4K, HD, subtitles and live are sent as native YouTube filters. Export to CSV or Excel. No API key.",
    "version": "0.9",
    "x-build-id": "5caQ8Pha8YuUpLMXr"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ai-lead-gen-tools~youtube-search/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ai-lead-gen-tools-youtube-search",
        "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/ai-lead-gen-tools~youtube-search/runs": {
      "post": {
        "operationId": "runs-sync-ai-lead-gen-tools-youtube-search",
        "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/ai-lead-gen-tools~youtube-search/run-sync": {
      "post": {
        "operationId": "run-sync-ai-lead-gen-tools-youtube-search",
        "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": {
          "searchQuery": {
            "title": "Search keyword",
            "type": "string",
            "description": "Single keyword or phrase to search YouTube for."
          },
          "queries": {
            "title": "Search keywords",
            "type": "array",
            "description": "Several keywords in one run. Every keyword is searched separately and its results carry the keyword in the `query` field. Combined with `searchQuery`, both are used. Up to 100 values.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "type": {
            "title": "Result type",
            "enum": [
              "video",
              "shorts",
              "channel",
              "playlist",
              "movie"
            ],
            "type": "string",
            "description": "What to return. `video` returns videos and livestreams, `shorts` returns Shorts, `channel` returns channels, `playlist` returns playlists. Leave empty to get whatever YouTube ranks first, all types mixed."
          },
          "maxResults": {
            "title": "Max results in total",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Hard cap on rows in the dataset across all keywords. Set 0 for no global cap.",
            "default": 50
          },
          "maxResultsPerQuery": {
            "title": "Max results per keyword",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap on rows taken from one keyword.",
            "default": 50
          },
          "maxPagesPerQuery": {
            "title": "Max pages per keyword",
            "minimum": 1,
            "maximum": 40,
            "type": "integer",
            "description": "Upper bound of result pages requested for one keyword. One page holds about 20 results.",
            "default": 10
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "popularity"
            ],
            "type": "string",
            "description": "YouTube search offers only two orders: relevance and popularity. There is no sort by upload date on YouTube search, use `uploadDate` to narrow the age window instead.",
            "default": "relevance"
          },
          "uploadDate": {
            "title": "Upload date",
            "enum": [
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Keep only results published inside this window. Applied by YouTube itself."
          },
          "duration": {
            "title": "Video length",
            "enum": [
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "Keep only results inside this length bucket. The boundary is 4 minutes and 20 minutes."
          },
          "features": {
            "title": "Features",
            "type": "array",
            "description": "Extra YouTube search filters. Every listed feature must be present. `hd` is high definition, `uhd4k` is 4K, `subtitles` is closed captions, `live` is a livestream, `creativeCommons` is a CC licence, `deg3d` is 3D, `deg360` is 360 degrees, `hdr` is HDR, `vr180` is VR180, `location` is geotagged, `purchased` is a purchased title.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "language": {
            "title": "Interface language",
            "type": "string",
            "description": "Language of the results page, as a two letter code. Affects the language YouTube prefers and the wording of age, view and duration labels. Rendered labels are parsed in 23 European languages.",
            "default": "en"
          },
          "region": {
            "title": "Region",
            "type": "string",
            "description": "Country of the results page, as a two letter code, e.g. US, DE, JP. Changes which results YouTube ranks first.",
            "default": "US"
          },
          "sameDomainDelaySecs": {
            "title": "Delay between requests",
            "minimum": 0,
            "maximum": 30,
            "type": "number",
            "description": "Pause in seconds before each request to youtube.com. Raising it lowers the chance of an HTTP 429.",
            "default": 1
          },
          "requestTimeoutSecs": {
            "title": "Request timeout",
            "minimum": 5,
            "maximum": 180,
            "type": "integer",
            "description": "Timeout of one HTTP request in seconds.",
            "default": 30
          },
          "runBudgetSecs": {
            "title": "Run budget",
            "minimum": 30,
            "maximum": 3600,
            "type": "integer",
            "description": "Soft time budget for the whole run, in seconds. The run stops paginating before the platform timeout and marks the summary as budget exhausted."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy for the requests to youtube.com. Optional: the actor works without a proxy, but a proxy lowers the risk of a temporary block on a busy schedule.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}