{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Search Scraper & API",
    "description": "Scrape YouTube search results — videos, channels, playlists, shorts, and movies. Filter by type, duration, upload date, sort order, and video features (HD, 4K, CC, Live). Get titles, view counts, thumbnails, channel info, and publish dates. Export as JSON, CSV, Excel.",
    "version": "1.0",
    "x-build-id": "E13gwMr63nVrW97s4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/parsebird~youtube-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-parsebird-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/parsebird~youtube-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-parsebird-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/parsebird~youtube-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-parsebird-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": [
          "query"
        ],
        "properties": {
          "query": {
            "title": "Search Query",
            "type": "string",
            "description": "The keywords to search for on YouTube (e.g. 'python tutorial', 'cooking recipes', 'tech reviews')."
          },
          "maxResults": {
            "title": "Max Results",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of results to return. Ignored if 'Scrape all available results' is enabled.",
            "default": 100
          },
          "scrapeAllResults": {
            "title": "Scrape all available results",
            "type": "boolean",
            "description": "Keep paginating until YouTube stops returning results. This may take a long time and produce a very large dataset.",
            "default": false
          },
          "type": {
            "title": "Result Type",
            "enum": [
              "video",
              "channel",
              "playlist",
              "movie",
              "shorts"
            ],
            "type": "string",
            "description": "Filter results by content type. Leave empty to return all types."
          },
          "sortBy": {
            "title": "Sort By",
            "enum": [
              "relevance",
              "popularity"
            ],
            "type": "string",
            "description": "How to sort the search results. Sorting is not available for Shorts.",
            "default": "relevance"
          },
          "duration": {
            "title": "Video Duration",
            "enum": [
              "under3min",
              "3to20min",
              "over20min"
            ],
            "type": "string",
            "description": "Filter videos by length. Only applies when searching for videos."
          },
          "uploadDate": {
            "title": "Upload Date",
            "enum": [
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Restrict results to a specific time frame."
          },
          "geo": {
            "title": "Country",
            "pattern": "^[A-Z]{2}$",
            "type": "string",
            "description": "2-letter ISO country code to get results relevant to a specific country (e.g. US, GB, IN, DE)."
          },
          "lang": {
            "title": "Language",
            "pattern": "^[a-z]{2}$",
            "type": "string",
            "description": "Language code for results (e.g. en, es, fr, de, ja)."
          },
          "features": {
            "title": "Video Features",
            "type": "object",
            "description": "Toggle YouTube feature filters. Multiple features are combined with AND logic.",
            "properties": {
              "360": {
                "title": "360°",
                "type": "boolean",
                "description": "Only show 360° videos.",
                "default": false,
                "editor": "checkbox"
              },
              "HD": {
                "title": "HD",
                "type": "boolean",
                "description": "Only show HD videos.",
                "default": false,
                "editor": "checkbox"
              },
              "subtitles": {
                "title": "Subtitles/CC",
                "type": "boolean",
                "description": "Only show videos with subtitles or closed captions.",
                "default": false,
                "editor": "checkbox"
              },
              "CCommons": {
                "title": "Creative Commons",
                "type": "boolean",
                "description": "Only show Creative Commons licensed videos.",
                "default": false,
                "editor": "checkbox"
              },
              "3D": {
                "title": "3D",
                "type": "boolean",
                "description": "Only show 3D videos.",
                "default": false,
                "editor": "checkbox"
              },
              "Live": {
                "title": "Live",
                "type": "boolean",
                "description": "Only show live videos.",
                "default": false,
                "editor": "checkbox"
              },
              "Purchased": {
                "title": "Purchased",
                "type": "boolean",
                "description": "Only show purchased content.",
                "default": false,
                "editor": "checkbox"
              },
              "4K": {
                "title": "4K",
                "type": "boolean",
                "description": "Only show 4K videos.",
                "default": false,
                "editor": "checkbox"
              },
              "Location": {
                "title": "Location",
                "type": "boolean",
                "description": "Only show videos with location metadata.",
                "default": false,
                "editor": "checkbox"
              },
              "HDR": {
                "title": "HDR",
                "type": "boolean",
                "description": "Only show HDR videos.",
                "default": false,
                "editor": "checkbox"
              },
              "VR180": {
                "title": "VR180",
                "type": "boolean",
                "description": "Only show VR180 videos.",
                "default": false,
                "editor": "checkbox"
              }
            },
            "additionalProperties": false
          },
          "local": {
            "title": "Localized Results",
            "type": "boolean",
            "description": "Request localized data from YouTube using the country and language settings above.",
            "default": 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}