Trick Websites to show only desktop version

There are some websites which give us different site for mobile and desktop.
for example “youtube”

for mobile: m.www.youtube.com
for desktop: www.youtube.com

Now, my question is how to trick “youtube” or any other website into giving us only the desktop version in js

fetch('https://www.youtub.com/api')
    .then( res => res.json()
    .then(json => console.log(json);