ScreenshotNeo

BlogHow-to

How to capture a full-page website screenshot with the Microlink API

Capture an entire scrollable webpage with Microlink using `screenshot.fullPage=true`, then handle dynamic content, output formats, and common failures.

By the ScreenshotNeo team4 October 20266 min read

To capture the entire scrollable page with Microlink, make a GET request to https://api.microlink.io with the target url, enable screenshot, and set screenshot.fullPage=true. The API returns JSON with screenshot asset metadata and a URL you can use downstream.

curl -G 'https://api.microlink.io' \
  --data-urlencode 'url=https://example.com' \
  -d 'screenshot=true' \
  -d 'screenshot.fullPage=true'

Microlink documents fullPage as capturing the entire scrollable page; it defaults to false. See the screenshot parameter documentation and its SDK option-routing reference.

1. Make a full-page request

The request needs the page URL and screenshot option. The parameter name is nested because fullPage is a screenshot option. The following examples request a full-page capture.

cURL

curl -G 'https://api.microlink.io' \
  --data-urlencode 'url=https://example.com' \
  -d 'screenshot=true' \
  -d 'screenshot.fullPage=true'

JavaScript SDK

Install the documented package with npm install microlink.io, then run this in an environment that supports ES modules:

import createClient from 'microlink.io'

const microlink = createClient()
const data = await microlink.screenshot('https://example.com', {
  fullPage: true
})

console.log(data)

The SDK call returns the screenshot result. To use its asset, inspect the returned screenshot data and pass its URL to your image or storage workflow.

Python

This example uses Python’s standard library and prints the JSON response. Save as capture.py and run with Python 3:

import json
from urllib.parse import urlencode
from urllib.request import urlopen

params = urlencode({
    "url": "https://example.com",
    "screenshot": "true",
    "screenshot.fullPage": "true",
})

with urlopen(f"https://api.microlink.io?{params}", timeout=90) as response:
    result = json.load(response)

print(json.dumps(result, indent=2))
print("Screenshot URL:", result["data"]["screenshot"]["url"])

Node.js

This uses the built-in fetch available in current Node.js releases:

const params = new URLSearchParams({
  url: 'https://example.com',
  screenshot: 'true',
  'screenshot.fullPage': 'true'
})

const response = await fetch(`https://api.microlink.io?${params}`)
if (!response.ok) {
  throw new Error(`Microlink returned HTTP ${response.status}`)
}

const result = await response.json()
console.log(result)
console.log('Screenshot URL:', result.data.screenshot.url)

2. Read and use the result

With screenshot enabled, the response JSON includes data.screenshot. The documented example includes an asset URL and fields such as width, height, file type, size, and human-readable size, along with a success status.

const screenshot = result.data.screenshot
console.log(screenshot.url)
console.log(screenshot.width, screenshot.height)
console.log(screenshot.type, screenshot.size)

Use the returned asset URL in your application or download it for storage. If your workflow needs the asset response directly instead of JSON, Microlink documents embed=screenshot.url as an option. Consult the API overview for current behavior and access details.

3. Capture pages with dynamic or lazy-loaded content

A full-page setting captures the scrollable page, but it does not guarantee that content which appears only after interaction has loaded. Choose a readiness signal that matches the page.

  1. Identify the element or section whose presence means the content is ready.
  2. If the site loads content only after scrolling, use Microlink’s documented scroll option to bring the target section into view.
  3. Wait for a selector that appears when the content is ready.
  4. Enable full-page capture as well, so the resulting screenshot covers the full scrollable page.

Microlink’s dynamic content guide demonstrates scrolling a reviews section into view and waiting for review cards. Prefer a meaningful selector over an arbitrary delay when the page offers a reliable readiness marker. Exact option shapes for scrolling and selector waits depend on the current API or SDK reference; follow that guide’s example for the options you use.

4. Choose the right capture and output options

Need Approach
Entire document Set fullPage: true in the SDK or screenshot.fullPage=true in API query parameters.
One component only Target a CSS-selected element instead of capturing the entire page; use the screenshot documentation for the supported element option.
Smaller image Consider JPEG and an appropriate quality setting, and reduce device scale factor if high-density pixels are unnecessary.
No need for metadata Omit metadata you do not consume, where the API options support it.
Page is complete without scripts Disabling JavaScript may reduce work, but only do this when the page’s content is still complete without scripts.
Delayed or scroll-triggered content Prepare the page by scrolling and waiting for a readiness selector before capture.

These tradeoffs are covered in Microlink’s faster and smaller screenshots guide and screenshot parameter documentation. Check those references for exact option names and supported values before adding options to production requests.

5. Or skip the browser setup

ScreenshotNeo provides a screenshot API and MCP server. Its one-request API can return a screenshot without building or maintaining your own browser capture setup.

curl -G "https://api.screenshotneo.com/v1/shot" \
  -d access_key=YOUR_API_KEY \
  --data-urlencode url=https://example.com \
  -d full_page=true \
  -o shot.webp

See the ScreenshotNeo API documentation for options and examples. Cookie banners are accepted as a visitor and 60+ known consent platforms, newsletter popups, and chat widgets are removed before capture; each cleanup step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots.

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

6. Troubleshooting

Symptom Likely cause What to do
The image shows only the first viewport The full-page option was omitted, misspelled, or placed at the wrong level. For the API, send both screenshot=true and screenshot.fullPage=true. For the SDK, pass { fullPage: true } to the screenshot method.
A section is blank or incomplete The content is lazy-loaded, interaction-triggered, or not ready at capture time. Scroll the relevant section into view and wait for a selector that signals the content is present, then capture.
The response has no screenshot URL The request did not enable screenshot generation, or the request returned an error result. Confirm screenshot=true, inspect the response status and error details, and only read data.screenshot.url after confirming success.
The image is unexpectedly large A tall page and high device scale factor produce many pixels. Use JPEG with a suitable quality or lower the device scale factor if those pixels are not needed. Consider whether a single element capture meets the use case.
The request fails or takes too long The target site may be slow, unavailable, or waiting on resources. Check that the URL is publicly reachable and try again. For dynamic pages, wait on a specific readiness selector rather than an excessively long fixed delay. Handle HTTP errors and timeouts in the calling application.

7. Performance, reliability, and cost

  • Page height affects output size. Full-page images contain more pixels than viewport captures, so very long pages take more transfer and storage. Resize or choose JPEG and a lower device scale factor when the downstream use permits it.
  • Readiness affects consistency. A selector wait tied to the content you need is generally more repeatable than guessing a delay. Pages with scroll-triggered content may need a scroll step before the wait.
  • Validate the response. Check HTTP status and the API’s success status before consuming the screenshot URL. Set a client timeout appropriate for your application, and retry transient failures with a bounded policy rather than an unbounded loop.
  • Check current Microlink limits. Microlink’s overview currently describes access without an API key to start and advertises 25 requests per day on its free plan. Quotas, paid features, performance figures, and service terms can change; verify them on the live API overview before estimating production cost.
  • Control your own volume. Avoid capturing the same unchanged page repeatedly when your application can reuse a prior result; confirm current cache options and terms in the vendor documentation.

8. FAQ

Does full-page mean the entire website?

No. It means the entire scrollable page at the requested URL, rather than every page on the site’s domain.

Can I capture a page that requires login?

The cited examples cover public URLs and do not establish an authentication workflow. Check Microlink’s current parameter documentation for supported request headers or other authentication options before relying on a protected-page capture.

Can I get an image instead of JSON?

Microlink documents embed=screenshot.url for returning the screenshot asset directly. See the API overview for current response behavior.

Should I use full-page capture for a single card?

Usually not. Target just the relevant element when the task only needs one component; this avoids capturing and transferring the rest of a long page.