DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk5 min

How to Set a Custom Viewport Size in a Screenshot API Request

Screenshot APIs do not share one viewport syntax. Learn how to set width and height using the right fields, keep full-page and device settings separate, and troubleshoot common request issues.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set the browser viewport by sending both width and height using the exact parameter names and structure documented by your screenshot API. Some APIs expect a nested JSON object such as "viewport": {"width": 1280, "height": 720}; others use flat fields or query parameters. There is no universal screenshot API syntax, so do not copy a request shape from one provider to another.

What viewport width and height control

The viewport is the browser window size used to lay out a page for capture. Setting it to 1280 by 720 requests a layout at those dimensions where the API accepts that syntax; it does not, by itself, guarantee that the final image is exactly 1280 by 720 pixels.

Full-page capture is a separate setting: it asks the service to capture content beyond the initially visible viewport. Pixel density or device scale can also be controlled separately, and device emulation may involve additional settings beyond width and height.

Use the syntax your API documents

Nested JSON: Screenshot API

Screenshot API documents a POST request with a nested viewport object. Its example uses illustrative dimensions, not a universal default or limit. See the Screenshot API REST documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
curl -X POST "https://screenshot-api.org/api/v1/screenshot" 
  -H "Authorization: Bearer YOUR_API_KEY" 
  -H "Content-Type: application/json" 
  -d '{
    "url": "https://example.com",
    "viewport": { "width": 1280, "height": 720 },
    "format": "png",
    "fullPage": false
  }'

Here, width and height are numeric JSON values. Keep fullPage separate from the viewport dimensions.

Flat fields: ScreenshotAPI.com

ScreenshotAPI.com’s GET reference names the dimensions viewportWidth and viewportHeight, documents defaults of 1280 by 720, and treats device scale factor as a separate setting. Follow its GET reference for the endpoint and authentication syntax; do not assume another provider accepts these same names.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Width and height parameters: ScreenshotEngine

ScreenshotEngine uses width and height for its request parameters and documents both GET query strings and POST JSON. Names are case-sensitive, and casing conventions vary among options. Its viewport preset overrides explicit width and height, so check its parameter reference before combining a preset with custom dimensions.

Nested viewport: Cloudflare Browser Rendering

Cloudflare’s screenshot request schema also has a nested viewport object with numeric width and height. Its viewport settings include deviceScaleFactor and device-emulation flags such as isMobile, hasTouch, and isLandscape; screenshot options are a distinct part of the request schema. Check the current Cloudflare screenshot API documentation for the request format.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Choose dimensions and related settings

  1. Identify the service, API version, and endpoint. Different products—and sometimes different endpoints from one product—can use different request formats.
  2. Match the request method. Confirm whether the endpoint expects GET query parameters or a POST body, then copy the documented names and capitalization.
  3. Send both dimensions in the expected types. For JSON schemas that define numeric values, use numbers, not quoted strings. Check the provider’s documented units and accepted ranges.
  4. Check presets for precedence. A selected device or viewport preset may override explicit width and height.
  5. Set capture behavior independently. Configure full-page capture, device scale factor, and device emulation separately when required.
  6. Inspect a real response. Confirm the resulting layout and image dimensions rather than assuming viewport dimensions alone determine output size.

Viewport size is not the whole device

A narrow viewport can trigger a page’s mobile layout, but that does not necessarily emulate a physical phone. Device emulation can also involve user agent, touch input, orientation, and pixel density. The available controls and their interactions are provider-specific: Cloudflare documents separate emulation flags, while ScreenshotEngine says its viewport presets set dimensions but do not emulate a physical device’s browser, touch input, user agent, or pixel density.

Likewise, a high device scale factor can affect bitmap pixel dimensions without changing the CSS viewport used for layout. ScreenshotAPI.com and Cloudflare document device-scale controls separately from viewport width and height. Consult the selected service’s reference when matching a specific browser or device output.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo accepts a URL in one GET request and returns a screenshot; its viewport and other options are documented in the ScreenshotNeo API docs. For example:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -d width=1280 -d height=720 -o shot.webp

ScreenshotNeo’s documented options include 12 device presets and arbitrary viewports. Before capture, it accepts the cookie or consent banner like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents and other MCP clients. The free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Sign up for ScreenshotNeo and get 1,000 free screenshots a month, with no card required.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Troubleshooting custom viewport requests

  • The API ignores the dimensions: Check the exact field names, casing, nesting, and request method. A provider may accept viewport.width, for example, while another expects flat query parameters.
  • A preset appears to win: Review precedence rules. ScreenshotEngine documents that its viewport preset overrides explicit width and height.
  • The page looks mobile, but not like a phone: Width and height affect layout, but may not emulate touch, user agent, orientation, or device pixel density. Configure supported emulation options separately.
  • The output bitmap dimensions differ from the requested viewport: Check device scale factor and whether full-page capture is enabled; neither is the same as the initial browser viewport.
  • The request is rejected: Verify the endpoint and API version, authentication, HTTP method, JSON content type, parameter capitalization, numeric value types, and documented dimension limits.
  • The image has the right dimensions but the wrong page layout: Check whether the page requires a wait condition or whether a device preset or emulation option changes rendering. Use the provider’s response and documentation to identify supported controls; do not infer undocumented limits or behavior.

Cost and reliability considerations

Viewport choice does not establish a service’s pricing or guarantee a successful capture. Review the provider’s billing rules for failed requests, retries, cached responses, and asynchronous jobs. If a capture looks wrong, inspect the returned image and response status before repeatedly increasing wait times or dimensions. The references cited above document request formats and settings; no independent request test or performance comparison is claimed here.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.