ScreenshotNeo

BlogHow-to

How to Set Scroll Depth for Infinite Scroll in a Website Screenshot API

Set a bounded capture height, trigger lazy-loaded content with pre-scroll, and tune waits for the API you use. These settings vary by provider.

By the ScreenshotNeo team4 October 20267 min read

Direct answer: there is no universal scroll_depth parameter for website screenshot APIs. For an infinite-scroll page, enable the provider’s full-page capture option, turn on its pre-capture scrolling behavior if content loads only as it enters the viewport, and set a maximum output height if the API offers one. Then tune its documented scroll increment and wait controls for the target page. A height limit bounds the image; it does not guarantee an exact number of feed items.

Option names and behavior differ between providers. Treat each example below as specific to that API, and confirm its current documentation before deploying it.

1. Separate capture height from scroll-triggered loading

These controls solve different problems:

  • Full-page capture asks for an image of the page beyond the initial viewport.
  • Pre-capture scrolling moves through the page before the screenshot so scroll-triggered images or content can load.
  • Maximum height caps the resulting full-page image where supported.
  • Wait controls give the page time to render after navigation or scrolling.

A full-page option alone may not trigger content that is fetched only when a user scrolls. Conversely, scrolling can cause an infinite feed to keep appending entries. Use a supported height cap to bound output, and use a bounded viewport or element capture if the goal is a particular visible section.

2. Choose settings for the API you use

API Relevant documented controls What to verify
ScreenshotOne full_page, full_page_scroll, full_page_max_height; its documentation also describes scroll increment and delay tuning. Its example uses a 10,000-pixel maximum height. The docs suggest trying scroll increments in the 100–500-pixel range on some sites. These are provider-specific configuration examples, not universal defaults.
Screenshot API full_page, waitUntil, waitForSelector, delayMs. Check how its endpoint combines full-page capture with waits, and whether it offers a scroll-trigger option or height cap for your plan and endpoint.
Screenshotapi.com fullPage and doScroll. These are distinct settings: confirm the endpoint’s current behavior and available bounds.
ScreenshotNeo full_page_scroll and full_page_max_height. See the ScreenshotNeo API documentation for the supported request parameters.

Do not copy a parameter name from one provider into another. The reviewed docs use different spellings and casing, including full_page, fullPage, and doScroll.

3. Configure a bounded capture with ScreenshotOne

This provider-specific example follows the documented request shape: enable full-page capture and scrolling, then set a maximum output height. Replace the URL and key with your own values. Encode query parameters with an HTTP client in production, especially when the target URL itself contains query parameters.

curl -G 'https://api.screenshotone.com/take' \
  --data-urlencode 'access_key=YOUR_KEY' \
  --data-urlencode 'url=https://example.com' \
  --data-urlencode 'full_page=true' \
  --data-urlencode 'full_page_scroll=true' \
  --data-urlencode 'full_page_max_height=10000' \
  -o page.png

The 10,000-pixel cap is the value shown in the documentation’s example, not a general recommendation. Choose a lower or higher supported value based on the amount of content you need and the provider’s current limits. ScreenshotOne documents scroll increments of 100–500 pixels as a range to try on some pages; tune that setting together with its scroll delay if the endpoint exposes them.

4. Tune the capture for the page

  1. Start with the smallest useful output cap. Estimate the content region you need, then set the provider’s documented maximum height to bound the result.
  2. Enable pre-scroll when content is lazy-loaded. If images or cards appear only after entering the viewport, use the API’s documented scroll-before-capture option.
  3. Adjust the scroll increment and delay together. A smaller increment can expose more intermediate content-loading triggers, but may require more scrolling work. A delay gives the page time to respond after a step. ScreenshotOne’s 100–500-pixel suggestion is provider guidance to try, not a standard for other APIs.
  4. Wait for a meaningful condition where possible. If supported, wait for a selector that marks the content you need. A fixed delay can help with variable rendering time, but it cannot prove that an infinite feed has finished.
  5. Repeat with the same URL and settings. Compare whether the desired section is present and whether the output stays within the height bound. Pages with changing feeds may not produce identical content on every capture.

5. Decide whether you need page height or an item count

A maximum screenshot height controls the image dimensions, not the number of feed entries. Card heights vary, feeds may insert sponsored items, and new entries can load while scrolling. If the requirement is “capture the first 20 items,” a pixel cap alone cannot guarantee that result. Check whether your provider supports browser interactions or element capture that can target a stable container; otherwise, capture a bounded viewport or use the site’s data interface to select a known set of items before rendering.

If the page continues fetching new content, use a height cap to stop the output from growing without bound. If only a particular portion matters, prefer a bounded viewport or a provider-supported element capture over an unrestricted full-page image.

6. Common problems and fixes

Symptom Likely cause What to try
Images or cards are missing lower on the page The service captured without triggering viewport-based loading, or moved too quickly for the page to respond. Enable the provider’s pre-scroll option. Increase its documented scroll delay or tune the increment. Confirm that the page actually loads those items in a normal browser.
The screenshot is unexpectedly short Full-page capture is disabled, a height cap is too low, or a wait/selector condition ended before content appeared. Check the provider’s full-page flag and exact parameter spelling. Raise the cap within supported limits and correct the wait condition.
The output is too tall or expensive to store The API captured more page height than needed, or the feed kept appending content. Lower the documented maximum height. For a known region, use viewport or element capture if supported.
The capture times out Repeated feed requests, slow resources, or waits that never resolve keep the browser session busy. Set a finite height bound, avoid waiting for a condition that never occurs, and use the provider’s supported timeout or resource-blocking controls if available.
The API ignores the option A parameter from another provider was copied, the name’s casing is wrong, or the option is unsupported on that endpoint. Check the exact endpoint reference and encode query values correctly. Do not assume similarly named flags are interchangeable.
Repeated captures show different content The feed is dynamic, personalized, or changing while it is captured. Use a stable test URL and authenticated state if supported. Wait for a known marker and bound the capture; accept that a changing feed may not yield an identical image each time.

7. Performance, reliability, and cost

Longer pages and pre-scroll work generally require more browser activity than a viewport capture. A smaller scroll increment can mean more steps, while longer waits add time at each step. Keep the output cap and waits to the minimum that reliably includes the section you need, and avoid an unbounded wait on a feed that may never settle.

For repeatable jobs, define the target URL, authentication state, wait condition, scroll behavior, and maximum height explicitly. Record the provider’s response status and relevant headers or job result. A height cap limits output size but does not make a dynamic source deterministic, and it cannot promise a particular number of items.

Cost depends on the provider’s pricing and billing rules; check its current plan details for how full-page captures, browser time, retries, and failed loads are counted. Avoid assuming that a parameter or behavior is included at no extra charge unless the provider documents it.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. Its full-page options include full_page_scroll and full_page_max_height. For infinite-scroll pages, set a finite maximum height so the capture has a defined bound. See the API docs for request parameters.

curl -G 'https://api.screenshotneo.com/v1/shot' \
  -d access_key=YOUR_API_KEY \
  --data-urlencode url=https://example.com \
  -d full_page_scroll=true \
  -d full_page_max_height=10000 \
  -o shot.webp
import requests

r = requests.get(
    'https://api.screenshotneo.com/v1/shot',
    params={
        'access_key': 'YOUR_API_KEY',
        'url': 'https://example.com',
        'full_page_scroll': 'true',
        'full_page_max_height': 10000,
    },
    timeout=90,
)
r.raise_for_status()
with open('shot.webp', 'wb') as f:
    f.write(r.content)
const q = new URLSearchParams({
  access_key: 'YOUR_API_KEY',
  url: 'https://example.com',
  full_page_scroll: 'true',
  full_page_max_height: '10000',
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
const image = Buffer.from(await res.arrayBuffer());
await import('node:fs/promises').then(fs => fs.writeFile('shot.webp', image));

ScreenshotNeo removes cookie banners, popups, and chat widgets before the shot. Bot checks, blank pages, and failed loads are never billed. 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. Sign up free for 1,000 screenshots a month, with no card required.

Frequently asked questions

Is there a standard value for scroll depth?

No. The option names, defaults, and limits depend on the provider and endpoint.

Does a full-page screenshot always load lazy content?

No. Some services expose pre-scroll separately from full-page capture. Check whether your provider scrolls before taking the image.

Can a height cap capture exactly N feed items?

No. It bounds the image height. Item count depends on the page layout and loaded content.

Should I use a delay or wait for a selector?

Use a selector when the page exposes a stable marker for the content you need. A delay is a time-based fallback and can be too short or unnecessarily long as page conditions vary.

References