/chromium/function
POST/chromium/function
Executes a Puppeteer or Playwright script in the browser context and returns the result. Browserless sets up a blank page, injects your puppeteer code, and runs it. You can optionally load external libraries via the "import" module that are meant for browser usage. Values returned from the function are checked and an appropriate content-type and response is sent back to your HTTP call.
Note: Also available at /function as a convenience alias.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 408
- 429
- 500
- 503
Responses are determined by the returned value of the function itself. Binary responses (PDF's, screenshots) are returned back as binary data, and primitive JavaScript values are returned back by type (HTML data is "text/html", Objects are "application/json")
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.
Service is unavailable.