Using Browserless with Zapier
Zapier is a powerful automation platform that connects your favorite apps and services. This guide will show you how to use Browserless with Zapier to automate browser-based tasks using Webhooks by Zapier.
For the templates below, remember to replace YOUR_API_TOKEN_HERE
with your actual Browserless API token
Prerequisites
- A Browserless account with an API token
- A Zapier account (paid plan required for webhooks)
Available Endpoints
Screenshot
The /screenshot
endpoint allows you to capture screenshots of web pages. This is useful for:
- Visual monitoring of websites
- Creating thumbnails
- Documenting web content
Learn more about the Screenshot API
Webhook Configuration
- Add Webhooks by Zapier to your Zap
- Choose POST as the event
- Set URL to
https://production-sfo.browserless.io/screenshot?token=YOUR_API_TOKEN_HERE
- Set Payload Type to
JSON
- Add these data fields:
url
:https://www.example.com
PDF Generation
The /pdf
endpoint generates PDF documents from web pages. This is useful for:
- Creating printable versions of web content
- Archiving web pages
- Generating reports
Webhook Configuration
- Add Webhooks by Zapier to your Zap
- Choose POST as the event
- Set URL to
https://production-sfo.browserless.io/pdf?token=YOUR_API_TOKEN_HERE
- Set Payload Type to
JSON
- Add these data fields:
url
:https://www.example.com
Content Extraction
The /content
endpoint extracts the HTML content from web pages. This is useful for:
- Web scraping
- Content analysis
- Data extraction
Learn more about the Content API
Webhook Configuration
- Add Webhooks by Zapier to your Zap
- Choose POST as the event
- Set URL to
https://production-sfo.browserless.io/content?token=YOUR_API_TOKEN_HERE
- Set Payload Type to
JSON
- Add these data fields:
url
:https://www.example.com
Unblock
The /unblock
endpoint helps bypass common anti-bot measures. This is useful for:
- Accessing protected content
- Handling CAPTCHAs
- Managing cookies and sessions
Learn more about the Unblock API
Webhook Configuration
- Add Webhooks by Zapier to your Zap
- Choose POST as the event
- Set URL to
https://production-sfo.browserless.io/unblock?token=YOUR_API_TOKEN_HERE
- Set Payload Type to
JSON
- Add these data fields:
url
:https://www.example.com
cookies
:true
browserWSEndpoint
:true
content
:true
screenshot
:true
Browser Query Language (BQL)
The /chrome/bql
endpoint allows you to execute complex browser automation tasks using GraphQL. This is useful for:
- Complex form filling
- Multi-step workflows
- Custom browser automation
Webhook Configuration
- Add Webhooks by Zapier to your Zap
- Choose POST as the event
- Set URL to
https://production-sfo.browserless.io/chrome/bql?token=YOUR_API_TOKEN_HERE
- Set Payload Type to
JSON
- Add these data fields:
query
:mutation FormExample {\n goto(url: \"https://www.browserless.io/practice-form\") {\n status\n }\n select(selector:\"#Contact-Subject\",value:\"support\"){ time } \n typeEmail: type(text: \"john@email.com\", selector: \"#Email\") {\n time\n }\n typeMessage: type(\n selector: \"#Message\"\n text: \"Hello world!\"\n ) {\n time\n }\n verify(\n type: cloudflare\n ){\n solved\n }\n waitForTimeout(time:3000){time}\n screenshot{\n base64\n }\n}
variables
:{}
operationName
:FormExample
Function
The /function
endpoint allows you to execute custom JavaScript code in a browser context. This is useful for:
- Custom browser automation
- Complex data extraction
- Multi-step workflows
Learn more about the Function API
Webhook Configuration
- Add Webhooks by Zapier to your Zap
- Choose POST as the event
- Set URL to
https://production-sfo.browserless.io/function?token=YOUR_API_TOKEN_HERE
- Set Payload Type to
Raw
- Set Content Type to
application/javascript
- Add this JavaScript to the Data field:
export default async function ({ page }) {
await page.goto("https://example.com/");
const url = await page.content();
const buffer = await page.pdf({ format: "A4" });
const base64PDF = buffer.toString('base64');
const screenshot = await page.screenshot({ encoding: "base64" });
return {
data: {
url,
screenshot,
base64PDF
},
type: "application/json",
};
}