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: 1/21/26, 11:40 PM