{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Search Scraper & Channel Contact Links",
    "description": "Turn YouTube search results into structured data. This scraper extracts videos, titles, channels, views, thumbnails, and links from keyword searches, helping you analyze trends and build video datasets quickly.",
    "version": "0.1",
    "x-build-id": "FuDV3ykc2CZ0Q5Py2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/simpleapi~youtube-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-simpleapi-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/simpleapi~youtube-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-simpleapi-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/simpleapi~youtube-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-simpleapi-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": {
          "searchTerms": {
            "title": "🔎 Search terms",
            "type": "array",
            "description": "One YouTube search term per line. Example: « tech review », « home espresso ». Also accepts base-actor input under the key `queries`.",
            "items": {
              "type": "string"
            },
            "default": [
              "mkbhd smartphone review"
            ]
          },
          "startUrls": {
            "title": "🔗 Direct video or channel URLs",
            "type": "array",
            "description": "Optional. Paste `https://www.youtube.com/watch?v=…` for a single video, or `https://www.youtube.com/@handle` for a channel-only row with its About links. Runs in addition to the search terms above. Also accepts base-actor input under the key `urls`.",
            "items": {
              "type": "string"
            }
          },
          "resultsPerTerm": {
            "title": "📊 Results per search term",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "How many results to collect per term. **Cost warning:** full descriptions require per-video extraction, which measured ~0.6 MB of RESIDENTIAL proxy traffic per row — 100 results is roughly 60 MB, and the 2000 maximum is roughly 1.2 GB per term. The default of 5 is deliberate. Also accepts `maxResults`.",
            "default": 5
          },
          "resultOrder": {
            "title": "↕️ Result order",
            "enum": [
              "relevance",
              "date",
              "viewCount",
              "rating"
            ],
            "type": "string",
            "description": "Ordering, encoded as YouTube's real `sp=` search parameter. Verified to change the result set: sorting by view count shared only 2 of 6 IDs with the relevance ordering. Also accepts `sortBy`.",
            "default": "relevance"
          },
          "publishedWithin": {
            "title": "📅 Published within",
            "enum": [
              "",
              "lastHour",
              "today",
              "thisWeek",
              "thisMonth",
              "thisYear"
            ],
            "type": "string",
            "description": "Restrict to videos uploaded inside this window. Verified: « This week » returned 0 of 6 IDs in common with the unfiltered search. Also accepts `uploadDate`.",
            "default": ""
          },
          "videoLength": {
            "title": "⏱️ Video length",
            "enum": [
              "",
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "Length band. Verified: « Under 4 minutes » returned 0 of 6 IDs in common with the unfiltered search. Also accepts `duration`.",
            "default": ""
          },
          "resultKind": {
            "title": "📺 Result kind",
            "enum": [
              "video",
              "channel",
              "playlist",
              "movie"
            ],
            "type": "string",
            "description": "Videos and movies are collected with full descriptions (residential-priced). **Channels** and **playlists** are collected on the cheap flat tier (~2 KB per row, no residential traffic) — channel results still get full About enrichment; playlist results carry no description, and channel data only when YouTube names an owner. Also accepts `type`.",
            "default": "video"
          },
          "includeChannelAbout": {
            "title": "🏷️ Fetch channel About pages",
            "type": "boolean",
            "description": "Adds subscribers, country, joined date, channel description and the channel's real link list to every row. **One fetch per unique channel** — 10 results from one creator cost 1 lookup. Each About page is ~1–3 MB of proxy traffic, so this is the second-largest cost in a run.",
            "default": true
          },
          "maxChannelAboutLookups": {
            "title": "🔢 Max channel About lookups per run",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Hard ceiling on About fetches, counted across the whole run after de-duplication. Rows for channels beyond the ceiling are still emitted, with `channelAboutStatus: \"budgetExhausted\"` instead of invented values. Set 0 for no ceiling.",
            "default": 10
          },
          "descriptionMaxChars": {
            "title": "✂️ Description character limit",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "0 = keep the complete description (default). Any other value truncates to that many characters and sets `descriptionTruncated: true`. Links are always extracted from the **complete** text before truncation — the base cut at 500 characters, and one measured result had 29 links in its description with none of them inside the first 500 characters.",
            "default": 0
          },
          "onlyResultsWithLinks": {
            "title": "🎯 Keep only results that carry links",
            "type": "boolean",
            "description": "Drops results whose description contains no URL **and** whose channel About page lists no link. Uncharged and excluded from the dataset. Useful when the run is a contact-surface sweep rather than a content sweep.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy",
            "type": "object",
            "description": "Your proxy choice is used for channel About pages and, unless the override below is left on, for search too.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "forceResidentialForFullExtraction": {
            "title": "🛡️ Force residential for full extraction",
            "type": "boolean",
            "description": "ON (default): video and movie searches use a RESIDENTIAL proxy regardless of the setting above, and the run log states plainly that the substitution happened. OFF: your proxy choice is used as-is — expect bot checks and empty results on datacenter IPs. Channel and playlist searches never trigger the override.",
            "default": true
          },
          "verboseLogs": {
            "title": "🐛 Verbose logging",
            "type": "boolean",
            "description": "Logs About-fetch failures in detail and un-suppresses yt-dlp warnings. Also accepts `debug`.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}