{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Search Scraper: Videos, Shorts, Channels & Playlists",
    "description": "Scrape YouTube search results for any keyword: rank, title, channel, views, upload age, length and badges for videos, Shorts, channels and playlists. Use YouTube's own filters (upload date, length, 4K, live, Creative Commons), sort by popularity, set the country. No login or API key.",
    "version": "0.1",
    "x-build-id": "bVcIfRbI6j1L6yXCN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automatic~youtube-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automatic-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/automatic~youtube-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-automatic-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/automatic~youtube-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-automatic-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",
            "maxItems": 100,
            "type": "array",
            "description": "Words to search, one per line, for example python tutorial. A pasted YouTube search-results link also works. Empty input runs a five-result example.",
            "items": {
              "type": "string",
              "maxLength": 500
            }
          },
          "startUrls": {
            "title": "Search links (startUrls format)",
            "maxItems": 100,
            "type": "array",
            "description": "The common startUrls input format of other YouTube Actors: plain links or {\"url\": \"…\"} objects, for example [{\"url\": \"https://www.youtube.com/results?search_query=python+tutorial\"}]. Each search-results link runs as that search. Combined with the search terms above, duplicates removed."
          },
          "maxResultsPerQuery": {
            "title": "Results per search term",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "How many results to collect for each search, for example 50. If left unset, uses 20 (5 for the empty-input example)."
          },
          "type": {
            "title": "Result type",
            "enum": [
              "video",
              "shorts",
              "channel",
              "playlist",
              "all"
            ],
            "type": "string",
            "description": "Videos, Shorts, channels, playlists or every result type YouTube shows. If left unset, uses videos."
          },
          "sort": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "popularity"
            ],
            "type": "string",
            "description": "Relevance (YouTube's default order) or popularity. Popularity is YouTube's own ranking, not a strict view-count sort. If left unset, uses relevance."
          },
          "uploadDate": {
            "title": "Upload date",
            "enum": [
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Only videos uploaded in the last day, week, month or year, as in YouTube's filter menu. Empty applies no date filter. For videos, Shorts or all result types."
          },
          "duration": {
            "title": "Length",
            "enum": [
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "Only videos of this length. Empty applies no length filter. For videos or all result types."
          },
          "features": {
            "title": "Features",
            "type": "array",
            "description": "Only videos with all the selected features, as in YouTube's filter menu. Empty applies no feature filter.",
            "items": {
              "type": "string",
              "enum": [
                "live",
                "4k",
                "360",
                "vr180",
                "creative_commons"
              ],
              "enumTitles": [
                "Live now",
                "4K",
                "360°",
                "VR180",
                "Creative Commons"
              ]
            }
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Only videos published on or after this date: 2026-10-01, or a relative value such as 7 days or 6 months. Read from the upload age YouTube shows (\"3 weeks ago\"), so it is approximate; a video just before the date can be kept, a newer one is never dropped."
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "Two-letter country code for the search market, for example GB or DE: the results YouTube shows in that country. If left unset, uses US."
          },
          "language": {
            "title": "Interface language",
            "type": "string",
            "description": "YouTube interface language, for example en, es or de. If left unset, uses en. Titles are never translated."
          },
          "maxItems": {
            "title": "Maximum rows per run",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard total across all searches, so you control the cost, for example 200. If left unset, uses 1000.",
            "default": 1000
          },
          "maxPages": {
            "title": "Maximum pages per search",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Safety limit for result pages per search, for example 10. If left unset, uses 50. YouTube can end a search sooner.",
            "default": 50
          },
          "searchQueries": {
            "title": "Search terms (alias)",
            "maxItems": 100,
            "type": "array",
            "description": "Same as Search terms; both lists are combined with duplicates removed, for example beginner guitar.",
            "items": {
              "type": "string",
              "maxLength": 500
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}