{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Hashtag Video Scraper",
    "description": "Scrape public YouTube videos and Shorts by hashtag: ranked rows with title, views, channel, duration, publish context, thumbnails and hashtag lineage. Cross-hashtag dedupe, hard result caps, filters, incremental skip lists and optional video/channel enrichment. No login or API key.",
    "version": "1.0",
    "x-build-id": "cCmrFu0mShiSmFnoe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/coregent~youtube-hashtag-video-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-coregent-youtube-hashtag-video-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/coregent~youtube-hashtag-video-scraper/runs": {
      "post": {
        "operationId": "runs-sync-coregent-youtube-hashtag-video-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/coregent~youtube-hashtag-video-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-coregent-youtube-hashtag-video-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": {
          "hashtags": {
            "title": "Hashtags",
            "type": "array",
            "description": "One or more hashtags. Use <code>travel</code>, <code>#travel</code> or <code>https://www.youtube.com/hashtag/travel</code>. Hashtags are matched case-insensitively and duplicates are merged. Letters, numbers and underscores only — no spaces.",
            "default": [
              "travel"
            ],
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max total results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard ceiling on rows for the whole run, across all hashtags. The run stops exactly at this number. Each row is one result you pay for.",
            "default": 10
          },
          "maxResultsPerHashtag": {
            "title": "Max results per hashtag",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Fairness cap so one popular hashtag cannot take the whole run. YouTube's hashtag page itself surfaces roughly 10–30 regular videos and about 36 Shorts per hashtag; turn on <b>Extend with YouTube search</b> to go deeper for regular videos.",
            "default": 50
          },
          "contentType": {
            "title": "Content type",
            "enum": [
              "all",
              "videos",
              "shorts"
            ],
            "type": "string",
            "description": "<b>All</b> returns regular videos and Shorts interleaved. <b>Videos</b> returns regular videos only, <b>Shorts</b> only Shorts.",
            "default": "all"
          },
          "countryCode": {
            "title": "Country",
            "pattern": "^[A-Za-z]{2}$",
            "type": "string",
            "description": "Two-letter country code for YouTube's regional context (gl), e.g. US, GB, IN, DE. Ranking can differ by country.",
            "default": "US"
          },
          "languageCode": {
            "title": "Language",
            "pattern": "^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,4})?$",
            "type": "string",
            "description": "YouTube interface language (hl), e.g. en, de, es, pt-BR. View counts and dates are parsed most reliably with <code>en</code>; other languages keep the raw text fields.",
            "default": "en"
          },
          "extendWithSearch": {
            "title": "Extend with YouTube search (deeper, looser)",
            "type": "boolean",
            "description": "After the hashtag page runs out, keep collecting from YouTube search results for <code>#hashtag</code>. This goes much deeper, but these are search results for the hashtag query — not guaranteed to carry the hashtag. Rows from this route have <code>discoveryRoute: hashtag_search</code>; turn on video details to get <code>hashtagVerified</code>.",
            "default": false
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Keep only videos published after this date — an absolute date or a relative period such as <code>30 days</code>. Uses the exact publish date when video details are on, otherwise YouTube's approximate label (\"2 weeks ago\"). Shorts cards carry no date: with video details off, Shorts are dropped when a date filter is set."
          },
          "minViews": {
            "title": "Minimum views",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only videos with at least this many views (from the result card; exact when video details are on)."
          },
          "includeKeywords": {
            "title": "Include keywords",
            "type": "array",
            "description": "Keep only videos whose title or description snippet contains at least one of these words (case-insensitive). With video details on, the full description and tags are searched too.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Drop videos whose title or description contains any of these words (case-insensitive).",
            "items": {
              "type": "string"
            }
          },
          "includeVideoDetails": {
            "title": "Include video details",
            "type": "boolean",
            "description": "Fetch each delivered video's page for exact publish date, exact views, likes, comment count, full description, tags, hashtags, category, live/upcoming flags and caption availability. Also fills channel name and ID for Shorts. Billed as an extra event per unique video.",
            "default": false
          },
          "includeChannelDetails": {
            "title": "Include channel details",
            "type": "boolean",
            "description": "Add the channel's handle, subscriber count, total views, video count, country, joined date, verified flag and avatar. Fetched once per unique channel and billed once per unique channel. Shorts need video details on to know their channel.",
            "default": false
          },
          "deduplicateAcrossHashtags": {
            "title": "Deduplicate across hashtags",
            "type": "boolean",
            "description": "On: one row per unique video, with every hashtag and rank it appeared under kept in <code>matchedHashtags</code> / <code>hashtagObservations</code> — a video under five hashtags is one row and one charge. Off: one row per hashtag-video observation (useful for rank analysis), each billed as a row.",
            "default": true
          },
          "skipVideoIds": {
            "title": "Skip video IDs",
            "type": "array",
            "description": "Video IDs you already have (e.g. from a previous scheduled run). They are skipped and not charged.",
            "items": {
              "type": "string"
            }
          },
          "skipVideoUrls": {
            "title": "Skip video URLs",
            "type": "array",
            "description": "Video or Shorts URLs you already have. They are skipped and not charged.",
            "items": {
              "type": "string"
            }
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "Keep only videos published before this date. Same rules as <b>Published after</b>."
          },
          "maxViews": {
            "title": "Maximum views",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only videos with at most this many views."
          },
          "minDurationSeconds": {
            "title": "Minimum duration (seconds)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only videos at least this long. Shorts cards carry no duration — with video details off, Shorts are dropped when a duration filter is set."
          },
          "maxDurationSeconds": {
            "title": "Maximum duration (seconds)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only videos at most this long."
          },
          "includeChannels": {
            "title": "Only these channels",
            "type": "array",
            "description": "Keep only videos from these channels — channel IDs (UC…), @handles or channel names. Shorts need video details on to be matched.",
            "items": {
              "type": "string"
            }
          },
          "excludeChannels": {
            "title": "Exclude channels",
            "type": "array",
            "description": "Drop videos from these channels — channel IDs (UC…), @handles or channel names.",
            "items": {
              "type": "string"
            }
          },
          "maxPagesPerHashtag": {
            "title": "Max pages per hashtag",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Safety ceiling on result pages requested per hashtag (all routes together).",
            "default": 20
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Hashtags processed in parallel (detail requests use up to twice this, max 10). Keep it low if you see rate limiting.",
            "default": 5
          },
          "requestDelayMs": {
            "title": "Request delay (ms)",
            "minimum": 0,
            "maximum": 30000,
            "type": "integer",
            "description": "Optional pause between requests. The actor also slows down on its own after rate limiting.",
            "default": 0
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "No proxy is needed for normal runs. If YouTube blocks requests, use Apify Datacenter proxy or your own proxy URLs. Apify Residential proxy is not supported — a run that selects it uses Apify Datacenter instead, with a warning — bring your own residential provider via Custom proxy URLs instead.",
            "default": {
              "useApifyProxy": false
            }
          },
          "debugMode": {
            "title": "Debug mode",
            "type": "boolean",
            "description": "Log every page and add a diagnostics block to RUN_SUMMARY. Never logs cookies, tokens or proxy credentials.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}