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

youtubei.js / Utils / getRandomUserAgent

Function: getRandomUserAgent()

getRandomUserAgent(type): string

Returns a random user agent.

Parameters

• type: DeviceCategory

mobile | desktop

Returns

string

Defined in

src/utils/Utils.ts:102

Edit this page
Last Updated: 7/22/25, 7:55 PM
Contributors: Luan