For AI agents: a documentation index is available at /llms.txt
Skip to main content

/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

    blockAds boolean
    blockAdsInclude string
    launch object
    profile string
    timeout number
    token string
    trackingId string
    allowedDomains string[]
    credentials object
    externalProxyServer string
    integrationId string
    proxy ProxyType

    Possible values: [datacenter, residential]

    proxyCity string
    proxyCountry string
    proxyLocaleMatch string

    Possible values: [0, 1, false, true]

    proxyPreset string
    proxyState string
    proxySticky string

    Possible values: [0, 1, false, true]

Body

    codestringrequired
    context object
    property name* ContextValue
    anyOf
  • Array [
  • circular(ContextValue)
  • ]

Responses​

Responses are determined by the returned value of the downloads themselves, so there isn't a static response type for this API.

Schema
    Was this page helpful?