YouTube.js
Guide
Discord
❤️ Sponsor
GitHub
Guide
Discord
❤️ Sponsor
GitHub

youtubei.js / Utils / getRandomUserAgent

Function: getRandomUserAgent()

getRandomUserAgent(type): string

Defined in: src/utils/Utils.ts:100

Returns a random user agent.

Parameters

type

DeviceCategory

mobile | desktop

Returns

string

Edit this page
Last Updated: 10/12/25, 3:23 PM