Take a screenshot with Browser Use
const url = 'https://digize.com/api/v1/browser/screenshots';const options = { method: 'POST', headers: { 'Idempotency-Key': '5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69', 'x-api-key': '<x-api-key>', 'Content-Type': 'application/json' }, body: '{"url":"example","width":1280,"fullPage":false,"country":"example","waitFor":2}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://digize.com/api/v1/browser/screenshots \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \ --header 'x-api-key: <x-api-key>' \ --data '{ "url": "example", "width": 1280, "fullPage": false, "country": "example", "waitFor": 2 }'Opens the page in a Browser Use cloud browser, through a residential proxy in the country given, and screenshots it: what the window shows as a PNG, or the whole page (down to about 10,000 pixels) as a JPEG. For sites that turn other browsers away. The browser is stopped as soon as it’s taken; Browser Use charges the workspace’s credits for its minutes (one at least) and the proxy’s traffic.
Needs the analytics:write permission.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Makes the request safe to send again: for 24 hours the same key and request answer the first response without repeating the change.
Example
5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69Request Bodyrequired
Section titled “Request Bodyrequired”object
The page’s address.
How wide the window is, in pixels: 1280 for a laptop, 390 for a phone.
The whole page rather than what the window shows.
Where the browser goes out from: a two-letter country code for a residential proxy there (us, uk, de, …; Browser Use writes the United Kingdom as uk), or none for no proxy. us when left out.
Seconds to wait once the page has loaded.
Responses
Section titled “Responses”Done
object
Who ran it: a member, an API key, the agent.
A screenshot’s page, or a task’s instructions.
A screenshot’s picture, a link that works for an hour.
A task’s answer in words.
A task’s fields, as it brought them back.
object
The browser’s minutes, as Browser Use bills them.
What Browser Use charged, in US dollars: the browser, its proxy and a task’s model.
Example
{ "kind": "screenshot", "status": "running", "source": "page"}What was sent isn’t valid (invalid).
object
object
object
Example
{ "error": { "code": "invalid" }}No key, or one that’s unknown, off or expired.
object
object
object
Example
{ "error": { "code": "invalid" }}The key doesn’t have the permission this needs.
object
object
object
Example
{ "error": { "code": "invalid" }}Nothing has that id (not_found).
object
object
object
Example
{ "error": { "code": "invalid" }}A request with the same Idempotency-Key is still running (conflict).
object
object
object
Example
{ "error": { "code": "invalid" }}The Idempotency-Key was used with a different request.
object
object
object
Example
{ "error": { "code": "invalid" }}Over the rate limit; see retry-after.
object
object
object
Example
{ "error": { "code": "invalid" }}