{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Search Results Scraper - Videos & Channels",
    "description": "Export public YouTube videos, Shorts, live results, channels, and playlists by keyword. Filter by type, date, duration, feature, country, and language; download ranks, metrics, metadata, thumbnails, and URLs via CSV, Excel, JSON, API, or MCP.",
    "version": "0.1",
    "x-build-id": "AKGJCBcw7uPMPSFNK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fetch_cat~youtube-search-results-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fetch_cat-youtube-search-results-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/fetch_cat~youtube-search-results-scraper/runs": {
      "post": {
        "operationId": "runs-sync-fetch_cat-youtube-search-results-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/fetch_cat~youtube-search-results-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-fetch_cat-youtube-search-results-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": [
          "queries"
        ],
        "properties": {
          "queries": {
            "title": "Search queries",
            "minItems": 1,
            "maxItems": 50,
            "type": "array",
            "description": "YouTube keywords or phrases to search, one per row. Blank rows are ignored. At least one non-empty query is required, and duplicate queries run once.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "maxResultsPerQuery": {
            "title": "Maximum results per query",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of unique matching rows saved for each query.",
            "default": 25
          },
          "resultType": {
            "title": "Result type",
            "enum": [
              "all",
              "videos",
              "channels",
              "playlists"
            ],
            "type": "string",
            "description": "Return mixed public results or ask YouTube for videos, channels, or playlists only.",
            "default": "all"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "rating",
              "uploadDate",
              "viewCount"
            ],
            "type": "string",
            "description": "Native YouTube search order. Some combinations may be simplified by YouTube.",
            "default": "relevance"
          },
          "uploadDate": {
            "title": "Upload date",
            "enum": [
              "any",
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Limit results to a native YouTube upload-date window.",
            "default": "any"
          },
          "duration": {
            "title": "Duration",
            "enum": [
              "any",
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "Native YouTube video-duration filter. Relevant to video searches.",
            "default": "any"
          },
          "connectionMode": {
            "title": "Connection",
            "enum": [
              "direct",
              "automatic"
            ],
            "type": "string",
            "description": "Automatic preserves the existing Apify SDK proxy strategy from the first request and may incur proxy usage charges. It does not add a direct-first fallback. Direct makes requests without a proxy and never falls back to a paid route. Explicit advanced proxy settings take precedence, including saved-task opt-outs and customer proxy pools.",
            "default": "automatic"
          },
          "videoFeature": {
            "title": "Video feature",
            "enum": [
              "any",
              "live",
              "hd",
              "subtitles",
              "creativeCommons"
            ],
            "type": "string",
            "description": "Optional native YouTube feature filter. Relevant to video searches.",
            "default": "any"
          },
          "country": {
            "title": "Country",
            "pattern": "^[A-Za-z]{2}$",
            "minLength": 2,
            "maxLength": 2,
            "type": "string",
            "description": "Optional two-letter country code used for YouTube result localization, for example US, GB, PT, or DE."
          },
          "language": {
            "title": "Language",
            "pattern": "^[A-Za-z]{2,3}(-[A-Za-z]{2})?$",
            "type": "string",
            "description": "Optional language code used for YouTube result localization, for example en, pt, de, or en-GB."
          },
          "sp": {
            "title": "Raw YouTube filter token (sp)",
            "type": "string",
            "description": "Optional advanced filter token copied from a YouTube search URL. When provided, it overrides resultType, sortBy, uploadDate, duration, and videoFeature for backward compatibility."
          },
          "proxyConfiguration": {
            "title": "Advanced proxy settings (optional)",
            "type": "object",
            "description": "Leave unset to use Connection. Explicit settings override Connection, including its default. useApifyProxy: false keeps requests direct unless proxyUrls supplies a customer pool. Managed groups/countries and customer proxy pools retain the SDK's existing routing and bounded retries. Custom proxies can have their own costs. Invalid settings fail before the start charge. No new provider or fallback is added."
          },
          "retryCount": {
            "title": "Retries per request",
            "minimum": 0,
            "maximum": 8,
            "type": "integer",
            "description": "Retries for rate limits, blocks, transient server errors, and network failures.",
            "default": 3
          },
          "initialRetryDelayMillis": {
            "title": "Initial retry delay (milliseconds)",
            "minimum": 250,
            "maximum": 30000,
            "type": "integer",
            "description": "Initial retry backoff. Later retries increase the delay and honor Retry-After when present.",
            "default": 1000
          },
          "requestPacingMillis": {
            "title": "Delay between result pages (milliseconds)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Shared delay between search and continuation request starts, including retries across both workers.",
            "default": 250
          },
          "runTimeSecs": {
            "title": "Safe work time (seconds)",
            "minimum": 30,
            "maximum": 270,
            "type": "integer",
            "description": "Stop starting new result pages before the platform timeout so saved rows and RUN_SUMMARY can be finalized.",
            "default": 240
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}