Screenshots & actions overview
Capture a page image, or run a sequence of browser actions, through /fetch.
Screenshots and browser actions are driven through the same POST /fetch endpoint. Include a screenshot flag or an
actions array and the request runs in a real browser instead of a plain fetch.
Two ways to invoke
Set screenshot: true to navigate to the URL and capture a screenshot. This is shorthand for a single screenshot
action.
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 }'Pass an actions array to drive the page — click, type, scroll, wait — and optionally capture a screenshot at the end.
curl https://request.usestring.ai/v1/fetch \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"actions": [
{ "type": "click", "selector": "#load-more" },
{ "type": "wait", "milliseconds": 1000 },
{ "type": "screenshot", "full_page": true }
]
}'The API automatically navigates to your url first, then runs your actions in order.
What's returned
The response always includes the final page's HTML in data and the final URL. If your actions include a screenshot, it
comes back as base64 in the JSON body:
{
"finalUrl": "https://example.com",
"data": "<!doctype html>…",
"screenshot": { "format": "png", "base64": "iVBORw0KGgo…" }
}See Screenshots and Browser actions for the full details.
Constraints when using screenshot / actions
These run through the browser path, so a request that sets screenshot or actions may not also set method
(other than GET), a non-json format, body, headers, jsonSchema, or solveCaptcha: false. Only url,
countryCode, and the screenshot/actions fields apply. actions and screenshot are also mutually exclusive —
use one or the other.
Billing
Screenshot and action requests run a browser session and are billed as a browser WebSocket (CDP) session, by bandwidth and duration, rather than at the per-request fetch rate. See Pricing.