Get Screenshot

Capture full-page or viewport screenshots of dynamic, JavaScript-rendered pages with the Get Screenshot endpoint, with real browser rendering enabled by default.

Render a page in a real browser and return a base64-encoded screenshot. Real browser rendering is enabled by default so client-side scripts and layout elements render before the capture.

Note

  • Use the Scraper API Server (https://api.mrscraper.com) host when calling this endpoint.
  • Set screenshot to full for the entire scroll height, to top for the first viewport, or to <width>x<height> (optionally -<zoom>) for a custom viewport, such as 1280x800 or 1920x1080-75. The image is always a PNG.
  • The response is a JSON object with the base64-encoded screenshot and the page html. The tokens used are in the token_usage response header.
  • See Get Screenshot in the Scraper API guide for the full list of settings.
GET
/

Query Parameters

token*string

API token.

url*string

URL-encoded URL of the page you want to capture, such as https%3A%2F%2Fwww.walmart.com%2Fsearch%3Fq%3Dtable%2520lamps. Must include the protocol (https://).

Formaturi
screenshot*string

Screenshot area. full captures the entire scroll height (default), top captures the first viewport, and <width>x<height> sets the viewport size in pixels with an optional -<zoom> percent, such as 1280x800 or 1920x1080-75. Width and height range from 100 to 3840, zoom from 25 to 300. The image is a base64-encoded PNG.

Default"full"
Match^(full|top|[0-9]{3,4}x[0-9]{3,4}(-[0-9]{2,3})?)$
browserRendering?boolean

Screenshots always load the page in a real browser, so rendering stays on for this endpoint.

Defaulttrue
timeout?integer

Maximum seconds to wait for the scrape before the request times out. Up to 330, after which the API stops waiting. Increase for slow or complex pages.

Default300
Range1 <= value <= 330
warmStart?boolean

Opens the site's home page first to warm the session before loading the target URL. Useful for sites that expect a normal browsing session before deeper pages.

Defaultfalse
html?boolean

Returns the raw HTML of the scraped page in the response.

Defaulttrue
markdown?boolean

Also returns the page content as clean Markdown in markdown. Send it with html=true and browserRendering=true.

Defaultfalse
super?boolean

Routes the request through a real device to improve results on complex websites. On by default; set to false to use standard routing.

Defaulttrue
geoCode?string

Two-letter country code to load the page from, such as us or gb. Defaults to the United States. Send geoCode or proxyCountry; if you send both, they must match.

Default"us"
Length2 <= length <= 2
proxyCountry?string

Two-letter country code of the proxy server, such as us or gb. Same as geoCode; if you send both, they must match. Defaults to the United States.

Default"us"
Length2 <= length <= 2
saveResult?boolean

Saves the result to the Result tab.

Defaulttrue
maxAge?integer

Serves a cached result of the same request when it is newer than this age, in milliseconds, such as 86400000 for 1 day. Up to 604800000 (7 days). Omit or send 0 to always scrape fresh. A cached result costs the same tokens as the original scrape.

Range0 <= value <= 604800000
waitForSelector?string

Waits until a specific CSS selector appears in the DOM before returning the page, such as #results. Up to 500 characters. Useful for content that loads asynchronously after the initial page load. Turns on browser rendering.

Lengthlength <= 500
waitForDelay?number

Extra seconds to wait after the page loads, from 0 to 30. Decimals are allowed, such as 1.5. Turns on browser rendering.

Range0 <= value <= 30
action?string

Routes the request to a specific scraper action, or simply flags it. Useful for separating analytics per domain.

tokenCap?integer

Maximum total tokens the scrape and its retries can use. Automatic retries are bounded by this cap, so the total tokens for a single run stay at or below the value you set. Omit for no limit.

Range1 <= value
maxRetries?integer

Maximum number of retries for the request. Omit for no limit.

Range0 <= value

Header Parameters

x-api-token*string

API token.

Response Body

application/json

application/json

application/json

curl -X GET "https://api.mrscraper.com/?token=string&url=https%3A%2F%2Fwww.walmart.com%2Fsearch%3Fq%3Dtable%2520lamps&screenshot=1280x800" \  -H "x-api-token: string"
{
  "html": "<!DOCTYPE html>...</html>",
  "screenshot": "iVBORw0KGgoAAAANSUhEUgAA..."
}
{
  "message": "Unauthorized access",
  "data": null
}
{
  "success": false,
  "message": "Something failed on our side. Please retry. If it keeps failing, contact support@mrscraper.com with request id <trace_id>.",
  "data": null,
  "error": "internal",
  "traceId": "<trace_id>"
}