{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Trending Topic Finder",
    "description": "Discover rising YouTube topics in any niche. Analyzes recent videos and Shorts by view velocity, engagement, upload age and creator diversity, clusters repeated themes, and returns ranked trending topics with momentum scores, signals and evidence videos.",
    "version": "1.0",
    "x-build-id": "bTKMjSpih5k31crk7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/coregent~youtube-trending-topic-finder/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-coregent-youtube-trending-topic-finder",
        "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-trending-topic-finder/runs": {
      "post": {
        "operationId": "runs-sync-coregent-youtube-trending-topic-finder",
        "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-trending-topic-finder/run-sync": {
      "post": {
        "operationId": "run-sync-coregent-youtube-trending-topic-finder",
        "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": [
          "seedTopics"
        ],
        "properties": {
          "seedTopics": {
            "title": "Seed topics",
            "maxItems": 25,
            "type": "array",
            "description": "Niches or keywords to analyse — one per line. For each seed the Actor samples recent YouTube videos and finds the **subtopics** gaining traction inside it.\n\nExamples: `artificial intelligence`, `home workout`, `personal finance`, `gaming laptops`.\n\n💡 **TIP:** a broad niche (`fitness`) surfaces the big themes; a narrower one (`kettlebell training`) surfaces specific angles. Up to 25 seeds per run.",
            "items": {
              "type": "string"
            },
            "default": [
              "artificial intelligence"
            ]
          },
          "timeWindow": {
            "title": "Time window",
            "enum": [
              "24_HOURS",
              "3_DAYS",
              "7_DAYS",
              "14_DAYS",
              "30_DAYS",
              "90_DAYS"
            ],
            "type": "string",
            "description": "Only videos uploaded within this window are analysed. Trending is measured as momentum **inside** the window — views per hour since upload — never lifetime views.\n\n💡 Use `24 hours`–`7 days` for news-like niches, `14`–`30 days` for slower ones.",
            "default": "7_DAYS"
          },
          "videosPerSeed": {
            "title": "Videos sampled per seed",
            "minimum": 10,
            "maximum": 500,
            "type": "integer",
            "description": "How many recent videos to sample for each seed. More videos find more (and smaller) topics, at the cost of a longer run.\n\nTypical values: `50`–`100` for a quick look, `250` (default), `500` for a thorough scan.",
            "default": 250
          },
          "contentTypes": {
            "title": "Content types",
            "type": "array",
            "description": "Which formats to analyse. Shorts and long-form are ranked separately (Shorts naturally collect views faster), then combined into topics.\n\n- **Videos** — regular long-form uploads\n- **Shorts** — short-form videos up to 3 minutes\n- **Live** — live streams and their replays",
            "items": {
              "type": "string",
              "enum": [
                "VIDEOS",
                "SHORTS",
                "LIVE"
              ],
              "enumTitles": [
                "Videos",
                "Shorts",
                "Live"
              ]
            },
            "default": [
              "VIDEOS",
              "SHORTS"
            ]
          },
          "regionCode": {
            "title": "Country",
            "pattern": "^[A-Za-z]{2}$",
            "type": "string",
            "description": "Two-letter country code YouTube search is localised to, e.g. `US`, `GB`, `AU`, `CA`, `IN`, `BD`.\n\nThis biases which videos search returns — it does not prove where viewers are.",
            "default": "US"
          },
          "languageCode": {
            "title": "Language",
            "pattern": "^[a-zA-Z]{2,3}(-[A-Za-z]{2})?$",
            "type": "string",
            "description": "Interface language for search and suggestions, e.g. `en`, `es`, `pt`, `de`, `hi`. Topic extraction is tuned for English; other languages work but may surface more filler phrases.",
            "default": "en"
          },
          "expandSeeds": {
            "title": "Expand seeds with YouTube autocomplete",
            "type": "boolean",
            "description": "Also analyse what people type after your seed in YouTube search — e.g. `AI tools` → `AI tools for students`, `AI tools for video editing`.\n\nEach suggestion samples a quarter of *Videos sampled per seed* (at least 20), so expansion widens coverage and adds run time.",
            "default": false
          },
          "maxExpandedSeedsPerTopic": {
            "title": "Max suggestions per seed",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many autocomplete suggestions to analyse for each seed. Only used when expansion is on.",
            "default": 10
          },
          "minimumVideosPerTopic": {
            "title": "Minimum videos per topic",
            "minimum": 2,
            "maximum": 50,
            "type": "integer",
            "description": "A theme must appear in at least this many recent videos to count as a topic. One viral video is not a trend.",
            "default": 3
          },
          "minimumCreatorsPerTopic": {
            "title": "Minimum creators per topic",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "A theme must come from at least this many different channels. Stops one prolific channel from looking like a trend.",
            "default": 2
          },
          "minimumTrendTier": {
            "title": "Minimum trend tier",
            "enum": [
              "BREAKOUT",
              "RISING",
              "ACTIVE",
              "WEAK"
            ],
            "type": "string",
            "description": "Return only topics at or above this tier.\n\n- **Breakout** — strong recent acceleration across several creators\n- **Rising** — clearly positive momentum\n- **Active** — current activity, acceleration unclear\n- **Weak** — little evidence or momentum",
            "default": "ACTIVE"
          },
          "maxTopics": {
            "title": "Max topics returned",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "The highest-scoring topics up to this number are returned. You pay per topic returned, so this caps the cost of a run.",
            "default": 50
          },
          "minimumViews": {
            "title": "Minimum views per video",
            "minimum": 0,
            "type": "integer",
            "description": "Ignore videos below this view count before analysis. `0` keeps everything.",
            "default": 0
          },
          "minimumEngagement": {
            "title": "Minimum engagement per video",
            "minimum": 0,
            "type": "integer",
            "description": "Ignore videos with fewer likes + comments than this. Applied only where YouTube shows like/comment counts — videos with hidden counts are kept. `0` keeps everything.",
            "default": 0
          },
          "includeEvidenceVideos": {
            "title": "Include evidence videos",
            "type": "boolean",
            "description": "Attach the videos that most strongly support each topic — title, link, channel, views, likes, comments, views/hour and breakout flag.",
            "default": true
          },
          "maxEvidenceVideos": {
            "title": "Evidence videos per topic",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many evidence videos to attach to each topic, strongest momentum first.",
            "default": 5
          },
          "includeChannelContext": {
            "title": "Include channel subscriber counts",
            "type": "boolean",
            "description": "Look up subscriber counts for the channels in each topic. Adds subscriber numbers to creators and evidence videos, and lets small-channel breakouts (views far above subscriber count) count as breakouts.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Seeds processed in parallel",
            "minimum": 1,
            "maximum": 15,
            "type": "integer",
            "description": "How many seeds to search at once. Higher is faster on large runs; lower is gentler on YouTube.",
            "default": 5
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "How many times to retry a request that fails with a rate-limit (429) or server (5xx) error, with exponential backoff.",
            "default": 3
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. The Actor runs without a proxy by default. Apify Datacenter proxy and your own proxy URLs are supported; Apify Residential proxy is not.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}