ScreenshotNeo

BlogHow-to

How to Set Viewport Width and Height in a PagePeeker Screenshot URL

PagePeeker’s public V2 URL documents thumbnail sizes, not viewport width and height. Here’s what you can set, what needs confirmation, and a working alternative.

By the ScreenshotNeo team4 October 20265 min read

Direct answer: PagePeeker’s public V2 thumbnail URL does not document query parameters for setting the browser viewport width or height. Its size parameter sets the dimensions of the returned thumbnail, not the viewport used to render the source webpage.

If you need a normal PagePeeker thumbnail, choose a documented size value. If you need to control the captured page width or maximum height for a premium full-page screenshot, PagePeeker lists those as premium customizations but does not publish their URL parameter names or syntax on the reviewed public pages. Ask PagePeeker for the exact configuration supported by your account; do not assume that width= or height= works.

1. Understand the two different dimensions

A screenshot request can involve two separate sizes:

  • Capture viewport: the browser’s width and height while the source page is rendered. This can affect responsive breakpoints and which page elements appear.
  • Thumbnail output: the pixel dimensions of the image returned by the service. PagePeeker documents this with size.

Changing a thumbnail output size does not, by itself, show that the source page was rendered at a matching viewport. For example, size=x requests a 480 × 360 thumbnail; it is not documented as a 480 × 360 browser viewport.

2. Use the documented PagePeeker V2 URL

The documented direct-link shape is:

http://{entrypoint}.pagepeeker.com/v2/thumbs.php?size={size}&code={code}&refresh={refresh}&wait={wait}&url={url}

Use the entrypoint associated with your account, set a supported size, and URL-encode the target URL. The documented controls are:

Parameter Purpose Notes
url Target page to capture URL-encode it when constructing the query string.
size Returned thumbnail dimensions Standard values are t, s, m, l, and x.
code Account code Optional in the documented pattern. Keep account credentials server-side where applicable.
refresh Force regeneration Premium option; use 1 when you need a refreshed capture.
wait Maximum wait for an image before returning Premium option, expressed in seconds. A placeholder may be returned if the capture is not ready.

The standard thumbnail dimensions are:

size Thumbnail dimensions
t 90 × 68 px
s 120 × 90 px
m 200 × 150 px
l 400 × 300 px
x 480 × 360 px

Premium accounts may have additional output sizes. These are image-output dimensions, not documented viewport settings.

PagePeeker’s official demo uses this pattern for a large thumbnail of Bing:

http://free.pagepeeker.com/v2/thumbs.php?size=x&url=bing.com

This requests an x-size thumbnail. It does not demonstrate custom browser viewport dimensions.

3. Can I set a custom page width and height?

PagePeeker’s premium full-page screenshot information lists “Page width and maximum height captured” as customizations. The reviewed public documentation does not give the URL parameter names or a copy-paste query-string syntax for those values.

  1. Decide whether you need a specific browser viewport, a full-page capture limit, or only a larger returned thumbnail.
  2. For a thumbnail dimension, use a documented size value.
  3. For premium full-page width or maximum captured height, ask PagePeeker for the configuration method and exact syntax for your account.
  4. Confirm whether the controls apply to direct-link requests, and whether they affect the viewport, the full-page capture boundary, or only output processing.

Do not append guessed parameters such as width=1280&height=800. They are not established by the reviewed public URL documentation.

4. Diagnose captures with the response headers

PagePeeker documents capture-related response headers for paid and unbranded accounts. These include the capture method, capture time, final URL, capture hash, timestamp, and error status. When a result looks unexpected, inspect those headers along with the returned image. They provide capture diagnostics, but they do not configure the viewport.

5. Troubleshooting

Symptom Likely cause What to do
The image is 480 × 360, but the page layout is still narrow. size=x sets thumbnail output dimensions, not a documented browser viewport. Request the premium full-page width configuration from PagePeeker if available for your account.
A width or height query parameter has no effect. Those parameter names are not documented for the public V2 direct-link pattern. Remove the guessed parameters and confirm the supported configuration with PagePeeker.
The response is a placeholder instead of the finished capture. The capture may not have completed before the request returned. For premium accounts, review the documented wait option and the error/status headers; allow a suitable maximum wait.
The result shows an old page version. The service may be returning a cached capture. For premium accounts, use the documented refresh=1 option to force regeneration.
The request fails for a nested URL with query parameters. The target URL was not encoded as a query parameter value. Percent-encode the complete target URL, or use a URL builder that encodes query parameters.
The capture follows an unexpected redirect. The target redirects to another page. Check the documented final-URL response header to see where the capture ended.

6. Reliability, performance, and cost considerations

  • Wait behavior: the premium wait setting controls how long the API waits before it returns an image or placeholder. Longer waits can make a synchronous page load take longer; a placeholder means the requested capture was not ready within that period.
  • Freshness: premium refresh=1 forces regeneration. Use it when the page changed and you need a new capture, while avoiding unnecessary refreshes when a cached result is acceptable.
  • Output size: larger thumbnail dimensions provide more pixels in the result but do not establish a larger rendering viewport.
  • Account-specific behavior: premium output sizes and full-page customizations can differ. Confirm exact options and any associated cost with PagePeeker before building them into a production request.
  • Observability: retain relevant capture headers during debugging so you can inspect timing, final URL, capture method, and error status.

7. Or skip the browser setup

If you need explicit screenshot controls without building a browser capture pipeline, ScreenshotNeo is a website screenshot API and MCP server. Its API supports viewport presets and arbitrary viewport dimensions, along with full-page captures, element captures, wait conditions, custom headers and cookies, and image or PDF output. See the ScreenshotNeo API documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
await Bun.write('shot.webp', res);

ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and response headers report the page verdict and billing status. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots.

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

8. FAQ

Does size=x mean a 480-pixel-wide browser viewport?

No. It documents a 480 × 360 thumbnail output size.

Does PagePeeker V2 recommend a different URL than V1?

Yes. The V2 API page identifies V2 as the recommended version; V1 is discontinued and redirected to V2.

Can premium accounts use other thumbnail sizes?

PagePeeker says premium accounts may have additional output sizes. Confirm the available values for your account.

Are the response headers viewport controls?

No. The documented headers help diagnose a capture; they do not set its dimensions.