{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Metadata Lookup (Bring Your Own Key)",
    "description": "Live video, channel, playlist and search metadata from the official YouTube Data API v3, using your own API key and quota. No caching, no transcripts, no scraping.",
    "version": "0.1",
    "x-build-id": "DeRX30wSIwwF4bKDB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/hydra_search~youtube-metadata-lookup/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-hydra_search-youtube-metadata-lookup",
        "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/hydra_search~youtube-metadata-lookup/runs": {
      "post": {
        "operationId": "runs-sync-hydra_search-youtube-metadata-lookup",
        "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/hydra_search~youtube-metadata-lookup/run-sync": {
      "post": {
        "operationId": "run-sync-hydra_search-youtube-metadata-lookup",
        "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": {
          "apiKey": {
            "title": "Your YouTube Data API v3 key",
            "type": "string",
            "description": "A YouTube Data API v3 key from your own Google Cloud project (console.cloud.google.com, enable \"YouTube Data API v3\", create an API key). Used only for this run, never stored or logged. Quota usage counts against your own project's quota, not ours."
          },
          "videoIds": {
            "title": "Video IDs or URLs",
            "type": "array",
            "description": "YouTube video IDs (e.g. dQw4w9WgXcQ) or full video URLs (watch, youtu.be, shorts, embed). Leave empty to skip video lookups.",
            "items": {
              "type": "string"
            }
          },
          "channelRefs": {
            "title": "Channel IDs or handles",
            "type": "array",
            "description": "Channel IDs (start with UC...) or handles (e.g. @mkbhd, with or without the @). Leave empty to skip channel lookups.",
            "items": {
              "type": "string"
            }
          },
          "playlistIds": {
            "title": "Playlist IDs or URLs",
            "type": "array",
            "description": "Playlist IDs (e.g. PL... or UU...) or full playlist URLs. Each playlist also returns its items (videos in the playlist), up to the overall max results cap. Leave empty to skip playlist lookups.",
            "items": {
              "type": "string"
            }
          },
          "searchQuery": {
            "title": "Keyword search",
            "type": "string",
            "description": "A keyword search, same as typing into YouTube's search box. Leave empty to skip. Search is the most expensive call against your quota (100 units per call) — see README."
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Stop after returning this many records in total, across every lookup type in this run.",
            "default": 50
          },
          "maxQuotaUnits": {
            "title": "Quota budget for this run",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Stop cleanly once this many YouTube API quota units have been spent in this run, so one run can't silently use your whole daily allowance. The default (10,000) matches YouTube's standard daily project quota. Lower it if you share that quota with other tools.",
            "default": 10000
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "none",
              "viewCount",
              "likeCount",
              "commentCount",
              "engagementRate"
            ],
            "type": "string",
            "description": "Sort the finished rows by this field, highest first. Applied after fetching, before pushing — a missing value on a row counts as 0.",
            "default": "none"
          },
          "topN": {
            "title": "Top N",
            "minimum": 1,
            "type": "integer",
            "description": "Optional. Keep only the first N rows after filtering and sorting. Only kept rows are pushed, and only pushed rows are charged."
          },
          "minViewCount": {
            "title": "Minimum view count",
            "minimum": 0,
            "type": "integer",
            "description": "Drop rows with fewer views than this. A missing view count is treated as 0.",
            "default": 0
          },
          "includeChannelUploads": {
            "title": "Include channel uploads",
            "type": "boolean",
            "description": "For each channel in Channel IDs or handles, also return its recent uploads (via the channel's official uploads playlist), up to Max uploads per channel.",
            "default": false
          },
          "maxUploadsPerChannel": {
            "title": "Max uploads per channel",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Cap on how many recent uploads to return per channel when Include channel uploads is on. You'll get a clear warning if a channel has more uploads than this cap.",
            "default": 10
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "For every video row returned (including from videoIds, playlists and channel uploads), also return its top-level comments, up to Max comments per video. Pushed as separate rows, priced separately from metadata rows — see README for the event name.",
            "default": false
          },
          "maxCommentsPerVideo": {
            "title": "Max comments per video",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Cap on how many top-level comments to return per video when Include comments is on.",
            "default": 10
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}