{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Search Scraper [From $0.20/1K 💰] Official API",
    "description": "💰 $0.20 per 1,000 videos + $0.001 per run; empty searches are free. YouTube search results and trending videos by country with views, likes, comments, duration and tags, through the official YouTube Data API with your own free API key. Date, length, region and language filters; monitor.",
    "version": "0.1",
    "x-build-id": "tWPlF4taavO78Shp1"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/cybermax~youtube-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-cybermax-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/cybermax~youtube-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-cybermax-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/cybermax~youtube-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-cybermax-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": {
          "queries": {
            "title": "Search terms",
            "type": "array",
            "description": "One search per line, as you would type it on YouTube (operators such as -word and \"exact phrase\" work). Each page of 50 results uses 100 of your 10,000 free daily API units, so about 5,000 results a day on the default quota.",
            "items": {
              "type": "string"
            }
          },
          "apiKey": {
            "title": "YouTube Data API key (yours, free)",
            "type": "string",
            "description": "Your own YouTube Data API v3 key from Google Cloud Console (free, about 3 minutes: create a project, enable 'YouTube Data API v3', create an API key; steps in the README). It is stored encrypted, sent only to googleapis.com and never logged. Leave empty for a free demo that returns illustrative rows."
          },
          "maxResultsPerQuery": {
            "title": "Results per search",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "YouTube returns at most about 500 results per search.",
            "default": 50
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "date",
              "viewCount",
              "rating"
            ],
            "type": "string",
            "description": "Order of the results, as on YouTube.",
            "default": "relevance"
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "A date (2026-01-31) or an age (24 hours, 7 days, 3 months). Empty = no limit."
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "A date (2026-06-30). Empty = no limit."
          },
          "duration": {
            "title": "Length",
            "enum": [
              "any",
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "YouTube's own length filter.",
            "default": "any"
          },
          "regionCode": {
            "title": "Country",
            "type": "string",
            "description": "Two-letter country code (US, GB, DE, BR, IN…): results that can be watched in that country."
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Two-letter language code (en, es, de, pt…): prefers results in that language."
          },
          "channelId": {
            "title": "Only this channel",
            "type": "string",
            "description": "A UC… channel ID, to search inside one channel."
          },
          "minViews": {
            "title": "Minimum views",
            "minimum": 0,
            "type": "integer",
            "description": "Leave out videos with fewer views. Videos left out are not charged."
          },
          "creativeCommonsOnly": {
            "title": "Creative Commons videos only",
            "type": "boolean",
            "description": "Only videos their owners published under the Creative Commons licence.",
            "default": false
          },
          "captionsOnly": {
            "title": "Only videos with captions",
            "type": "boolean",
            "description": "Only videos that have closed captions.",
            "default": false
          },
          "trendingRegions": {
            "title": "Trending: countries",
            "type": "array",
            "description": "Two-letter country codes (US, GB, DE, JP…). Returns YouTube's most popular videos chart for each country. Costs 1 API unit per 50 videos.",
            "items": {
              "type": "string"
            }
          },
          "maxTrendingPerRegion": {
            "title": "Trending videos per country",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "The chart holds up to 200 videos.",
            "default": 50
          },
          "trendingCategoryId": {
            "title": "Trending: category ID",
            "type": "string",
            "description": "Optional YouTube category ID: 10 Music, 17 Sports, 20 Gaming, 24 Entertainment, 25 News, 28 Science & Technology."
          },
          "maxItems": {
            "title": "Maximum videos in total",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many videos across the whole run. Empty = no total cap. You can also cap the cost with the run's 'Maximum charge' option."
          },
          "monitor": {
            "title": "Monitor mode",
            "type": "boolean",
            "description": "Remembers which videos it has already delivered for these searches and returns only videos it has not delivered before. Schedule it daily with 'Sort by: Upload date' for a new-video alert; videos already delivered are free.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor name",
            "type": "string",
            "description": "Optional name for this watchlist, so two schedules with different inputs keep separate memories. Leave empty to use one memory per unique input."
          },
          "accessToken": {
            "title": "OAuth access token (optional, instead of a key)",
            "type": "string",
            "description": "For developers who already use Google OAuth: an access token with a YouTube read scope. Tokens expire after about an hour, so an API key is simpler for scheduled runs."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}