Skip to content

Options

userAgent

A custom user agent, for example a mobile browser.

Type
string
Default
Browser default
On this page

OverviewLink to this section

Replaces the user agent the browser sends with every request and reports to scripts. Use it to get the mobile version of a site that decides by user agent, or to recognise your captures in the logs of your own site.

An empty string is ignored and the browser default is used.

ExampleLink to this section

The same request with the SDK, with cURL and as the raw JSON body.

screenshot.ts
import { Url2Image } from '@url2image/sdk'

const { success, data, message } = await Url2Image({
    url: 'https://example.com',
    token: process.env.URL2IMAGE_TOKEN,
    options: {
        userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1'
    }
})

Good to knowLink to this section

Every option, grouped, is in the options overview.

Something unclear or missing on this page?

Tell us
Made with Modulify