REST APIs
Browserless REST APIs provide HTTP endpoints for common browser tasks like screenshots, PDFs, content scraping, file downloads, function execution, and website unblocking. Perform browser automation via simple HTTP requests without managing browser infrastructure.
Quick Start
Scrape a website with a single HTTP request:
Sign Up
Sign up for a Browserless account (free plan available).
Get API Token
Get your API token from the account dashboard.
Run Your First Request
- cURL
- Node.js
- Python
curl -X POST "https://production-sfo.browserless.io/scrape?token=YOUR_API_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com","elements":[{"selector":"h1"}]}'const response = await fetch(
'https://production-sfo.browserless.io/scrape?token=YOUR_API_TOKEN_HERE',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
url: 'https://example.com',
elements: [{ selector: 'h1' }]
})
}
);
const data = await response.json();
console.log(data);import requests
response = requests.post(
'https://production-sfo.browserless.io/scrape?token=YOUR_API_TOKEN_HERE',
json={
'url': 'https://example.com',
'elements': [{'selector': 'h1'}]
}
)
data = response.json()
print(data)Expected response:
{
"data": [
{
"title": "Example Domain",
"description": "Example Domain. This domain is for use in illustrative examples..."
}
]
}
When to Use REST APIs
Use REST APIs when you need to:
- Take screenshots or generate PDFs
- Extract content from simple pages
- Integrate browser functionality via HTTP
- Perform one-off tasks without maintaining state
- Build serverless functions or microservices
For complex multi-step automation or bot detection bypass, use BrowserQL instead.
Key Features
- Simple Integration: HTTP requests from any language or tool
- Stateless Operations: No session management required
- Low Overhead: Minimal resource usage for simple tasks
- Scalable: Easy integration at any scale
Authentication
All REST API requests require an API token. Include your token as a query parameter:
https://production-sfo.browserless.io/scrape?token=YOUR_API_TOKEN_HERE
Get your API token from the Browserless dashboard.
For sites with sophisticated bot detection, use BrowserQL which provides advanced stealth capabilities and CAPTCHA solving.