{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Data API Scraper: Search, Channels, Videos & Playlists",
    "description": "Search YouTube and export channel stats, latest uploads, video details (views, likes, duration, tags, category) and playlists via the official YouTube Data API v3 with your own free key.",
    "version": "0.1",
    "x-build-id": "hFFSBLflOGiiTOgrW"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fjordlabs~youtube-data/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fjordlabs-youtube-data",
        "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/fjordlabs~youtube-data/runs": {
      "post": {
        "operationId": "runs-sync-fjordlabs-youtube-data",
        "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/fjordlabs~youtube-data/run-sync": {
      "post": {
        "operationId": "run-sync-fjordlabs-youtube-data",
        "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": "Free key from Google Cloud Console → APIs & Services → Credentials (enable \"YouTube Data API v3\" for the project). Default quota: 10,000 units a day. Stored encrypted, never logged or written to the output."
          },
          "mode": {
            "title": "What to get",
            "enum": [
              "search",
              "channels",
              "videos",
              "playlists"
            ],
            "type": "string",
            "description": "Search results, channels (with their latest uploads), specific videos, or playlists (with their videos).",
            "default": "search"
          },
          "searchQueries": {
            "title": "Search terms (mode = search)",
            "type": "array",
            "description": "One search per line, e.g. \"web scraping tutorial\". Each page of up to 50 results costs 100 quota units of your key.",
            "items": {
              "type": "string"
            }
          },
          "searchType": {
            "title": "Search for",
            "enum": [
              "video",
              "channel",
              "playlist"
            ],
            "type": "string",
            "description": "Videos, channels or playlists.",
            "default": "video"
          },
          "maxResults": {
            "title": "Max results per search term",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "YouTube returns at most about 500 results per search. 50 results = 1 search page = 100 quota units.",
            "default": 20
          },
          "order": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "date",
              "viewCount",
              "rating",
              "title",
              "videoCount"
            ],
            "type": "string",
            "description": "How YouTube orders search results.",
            "default": "relevance"
          },
          "regionCode": {
            "title": "Country",
            "type": "string",
            "description": "Two-letter country code (US, GB, DK, DE…) to get the results YouTube shows in that country."
          },
          "relevanceLanguage": {
            "title": "Language",
            "type": "string",
            "description": "Prefer results in this language (en, da, de, es…)."
          },
          "videoDuration": {
            "title": "Video length",
            "enum": [
              "any",
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "Search filter for videos: short (< 4 min), medium (4–20 min), long (> 20 min).",
            "default": "any"
          },
          "safeSearch": {
            "title": "Safe search",
            "enum": [
              "moderate",
              "none",
              "strict"
            ],
            "type": "string",
            "description": "YouTube's restricted-content filter for search.",
            "default": "moderate"
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "ISO date (2026-10-01), date-time, or relative like \"7 days\", \"24 hours\", \"3 months\". Filters search results and channel/playlist videos."
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "ISO date (a date alone means the end of that day) or relative like \"1 day\"."
          },
          "channels": {
            "title": "Channels (mode = channels)",
            "type": "array",
            "description": "Channel IDs (UC…), @handles, or URLs like https://www.youtube.com/@Google or /channel/UC…. One row per channel with its stats, then its latest uploads.",
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerChannel": {
            "title": "Latest uploads per channel",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "How many of each channel's newest videos to return with full details (0 = channel info only). Costs about 2 quota units per 50 videos.",
            "default": 10
          },
          "videos": {
            "title": "Videos (mode = videos)",
            "type": "array",
            "description": "Video IDs or URLs (watch?v=, youtu.be/, /shorts/, /live/). Up to 50 videos per quota unit.",
            "items": {
              "type": "string"
            }
          },
          "playlists": {
            "title": "Playlists (mode = playlists)",
            "type": "array",
            "description": "Playlist IDs (PL…) or URLs with list=. One row per playlist, then its videos in playlist order.",
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerPlaylist": {
            "title": "Videos per playlist",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "0 = playlist info only.",
            "default": 50
          },
          "fetchDetails": {
            "title": "Fetch full details",
            "type": "boolean",
            "description": "Look up stats, duration, tags and category for every search hit (1 extra quota unit per 50 results). Off = only the search snippet (title, channel, date).",
            "default": true
          },
          "maxQuotaUnits": {
            "title": "Max quota units for this run",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Stops before this run would use more of your key's daily quota (10,000 units by default). Search = 100 units per page; everything else = 1 unit per 50 items.",
            "default": 5000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}