String docs
Fetch

Screenshots

Capture PNG or JPEG screenshots of a page, full-page or viewport.

The screenshot action captures an image of the page. A request to POST /fetch with a screenshot runs in a real browser instead of a plain fetch. The simplest form is the screenshot: true shorthand, which navigates to the URL and captures a default screenshot.

curl https://request.usestring.ai/v1/fetch \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://example.com", "screenshot": true }'

Options

For more control, use a screenshot action inside an actions array:

OptionTypeDescription
full_pagebooleanCapture the entire scrollable page instead of just the viewport.
qualityinteger (1–100)Compression quality for the captured image.
{
  "url": "https://example.com",
  "actions": [{ "type": "screenshot", "full_page": true, "quality": 80 }]
}

Response

The screenshot is returned as base64 in the JSON body, alongside the final page in data. data is HTML by default, or converted Markdown when the request sets format: "markdown":

{
  "finalUrl": "https://example.com",
  "data": "<!doctype html>…",
  "screenshot": {
    "format": "png",
    "base64": "iVBORw0KGgoAAAANSUhEUgAA…"
  }
}

Decode screenshot.base64 to get the image bytes. format is png or jpeg.

Markdown output

Set format: "markdown" to convert the final page in data while keeping the response envelope and screenshot fields in JSON. The default markdownMode: "full" retains the full cleaned page body, including navigation, sidebars, and footers. Set markdownMode: "readable" to remove boilerplate and reduce output size. mainContentOnly: true is also supported when page chrome should be removed explicitly.

{
  "url": "https://example.com",
  "format": "markdown",
  "markdownMode": "full",
  "screenshot": true
}

See Response formats for the full preservation behavior.

Need to interact first?

Combine the screenshot with other browser actions — for example dismiss a cookie banner or expand a section — and place the screenshot action last to capture the result.

Rules and limits

At most one screenshot action is allowed per request; a second returns 400. A request with a screenshot can't also set jsonSchema, and the other options it can't be combined with are listed in Combining with other options.

Billing

A screenshot request is billed as a browser session, by bandwidth and duration. See Pricing.