/chrome/download
POST/chrome/download
Runs a Puppeteer or Playwright script in Chrome and returns any files the browser downloaded during execution. the execution of puppeteer code, which is ran inside context of the browser. Browserless sets up a blank page, a fresh download directory, injects your puppeteer code, and then executes it. You can load external libraries via the "import" syntax, and import ESM-style modules that are written for execution inside of the browser. Once your script is finished, any downloaded files from Chromium are returned back with the appropriate content-type header. Failed downloads return a JSON object with an "error" message and the upstream HTTP error status when observed, or 502 for a browser cancellation without an observed HTTP error or a browser disconnection before completion. Download setup failures return 500. If no download starts within 30 seconds after the function returns, the response is 404. The configured request TIMEOUT (or timeout query parameter) may return 408 sooner. Cleanup is awaited; if cancellation or page closure fails, the browser is stopped before its download directory is removed, even when keepalive was requested. Disconnects and timeouts during running user code also stop the browser.
Request
Query Parameters
Possible values: [datacenter, residential]
Possible values: [0, 1, false, true]
Possible values: [0, 1, false, true]
- application/json
- application/javascript
- Schema
- Example (auto)
Body
- []
- object
- null | string | number | boolean
- Array [
- ]
context object
property name* ContextValue
{
"code": "string",
"context": {}
}
Responses
- 200
- 400
- 401
- 403
- 404
- 408
- 429
- 500
- 502
- 503
Responses are determined by the returned value of the downloads themselves, so there isn't a static response type for this API.
Schema
- Fields
The request contains errors or didn't properly encode content.
The request is missing, or contains bad, authorization credentials.
The request targets a destination that is not allowed.
Resource couldn't be found.
The request took has taken too long to process.
Too many requests are currently being processed.
An internal error occurred when handling the request.
The browser disconnected or canceled the download without an observed upstream HTTP error status.
Service is unavailable.