Skip to content

Options

width

Viewport width in pixels, up to 10000.

Type
number
Default
1080
Range
1 to 10,000 pixels
On this page

OverviewLink to this section

Sets the width of the browser window in CSS pixels, which is also the width of the image. Responsive sites pick their layout from it, so a small width gives you the mobile layout.

Values above 10,000 are capped at 10,000 and decimals are rounded. Zero, negative numbers and anything that is not a number fall back to 1080. A number written as a string, such as "1440", works too.

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: {
        width: 1920
    }
})

Every option, grouped, is in the options overview.

Something unclear or missing on this page?

Tell us
Made with Modulify