Skip to main content

REST API Tools

The Browserless MCP server exposes eight stateless tools that wrap the corresponding Browserless REST APIs. Each tool maps to a single REST endpoint and returns its result in one call — useful when the AI just needs content, a file, or a one-off result without holding browser state.

For the stateful, multi-turn tool, see the Browser Agent page.

browserless_smartscraper

Scrapes any webpage using cascading strategies — HTTP fetch, proxy, headless browser, and CAPTCHA solving — automatically selecting the best approach. Wraps the /smart-scrape API.

ParameterTypeRequiredDefaultDescription
urlstringYesThe URL to scrape (http or https)
formatsstring[]No["markdown"]Output formats: markdown, html, screenshot, pdf, links
timeoutnumberNo30000Request timeout in milliseconds

Output formats:

  • markdown — Page content converted to clean Markdown (default)
  • html — Raw HTML of the page
  • screenshot — Full-page screenshot as a PNG image
  • pdf — PDF rendering of the page
  • links — All links found on the page

Example prompts:

Scrape https://browserless.io and summarize the content.

Extract all links from https://browserless.io.

browserless_function

Executes custom Puppeteer JavaScript code on the Browserless cloud. Your function receives a Puppeteer page object and optional context data, and returns { data, type } to control the response payload and Content-Type. Wraps the /function API.

ParameterTypeRequiredDescription
codestringYesJavaScript (ESM) code to execute. The default export receives { page, context } and should return { data, type }
contextobjectNoOptional context object passed to the function
timeoutnumberNoRequest timeout in milliseconds

Example prompts

Load script.js and run it with the context { "url": "https://example.com" }.

Run a Puppeteer script that opens https://browserless.io, waits for the hero to render, and returns the visible text.

browserless_download

Runs custom Puppeteer code and returns the file that Chrome downloads during execution. Useful for downloading CSVs, PDFs, images, or any file from a website. Wraps the /download API.

ParameterTypeRequiredDescription
codestringYesJavaScript (ESM) code that triggers a file download in the browser
contextobjectNoOptional context object passed to the function
timeoutnumberNoRequest timeout in milliseconds

Example prompts:

Download the CSV export from https://example.com/report.

Trigger the "Download PDF" button on https://example.com/invoice/123 and return the file.

browserless_export

Exports a webpage by URL in its native format (HTML, PDF, image, etc.). Set includeResources to bundle all page assets into a ZIP archive for offline use. Wraps the /export API.

ParameterTypeRequiredDescription
urlstringYesThe URL to export (http or https)
gotoOptionsobjectNoPuppeteer Page.goto() options (waitUntil, timeout, referer)
bestAttemptbooleanNoWhen true, proceed even if awaited events fail or timeout
includeResourcesbooleanNoBundle all linked resources (CSS, JS, images) into a ZIP file
waitForTimeoutnumberNoMilliseconds to wait after page load before exporting
timeoutnumberNoRequest timeout in milliseconds

Example prompt:

Export https://example.com as a full offline ZIP with all assets.

Searches the web using Browserless and optionally scrapes each result. Performs web searches via SearXNG and can return results from web, news, or images. Optionally scrape each result URL to get markdown, HTML, links, or screenshots. Wraps the /search API.

ParameterTypeRequiredDefaultDescription
querystringYesThe search query string
limitnumberNo10Maximum number of results to return (capped by plan limits)
langstringNo"en"Language code for search results
countrystringNoCountry code for geo-targeted results
locationstringNoLocation string for geo-targeted results
tbsstringNoTime-based filter: day, week, month, year
sourcesstring[]No["web"]Search sources: web, news, images
categoriesstring[]NoFilter by categories: github, research, pdf
scrapeOptionsobjectNoOptions for scraping each search result (see below)
timeoutnumberNo30000Request timeout in milliseconds

Scrape options (optional sub-object on scrapeOptions):

ParameterTypeDescription
formatsstring[]Output formats for scraped content: markdown, html, links, screenshot
onlyMainContentbooleanExtract only the main content using Readability
includeTagsstring[]Only include content from these HTML tags
excludeTagsstring[]Exclude content from these HTML tags

Example prompt:

Search for "headless browser automation" and summarize the top 5 results.

Find the latest news about Puppeteer and return markdown for each result.

browserless_map

Discovers and maps all URLs on a website using Browserless. Crawls a site via sitemaps and link extraction to find all pages. Returns a list of URLs with optional titles and descriptions. Use the search parameter to order results by relevance to a query. Wraps the /map API.

ParameterTypeRequiredDefaultDescription
urlstringYesThe base URL to start mapping from (http or https)
searchstringNoSearch query to order results by relevance
limitnumberNo100Maximum number of links to return (max: 5000)
sitemapstringNo"include"Sitemap handling: include, skip, only
includeSubdomainsbooleanNotrueInclude URLs from subdomains
ignoreQueryParametersbooleanNotrueExclude URLs with query parameters
timeoutnumberNo30000Request timeout in milliseconds

Example prompt:

Map all the pages on https://browserless.io and list them.

browserless_performance

Runs a Lighthouse performance audit on any URL via the Browserless /performance API. Returns scores and detailed metrics for accessibility, best practices, performance, PWA, and SEO. Optionally filter by category or supply performance budgets.

note

Audits can take 30 s–120 s depending on the site.

ParameterTypeRequiredDefaultDescription
urlstringYesThe URL to audit (http or https)
categoriesstring[]NoallLighthouse categories: accessibility, best-practices, performance, pwa, seo
budgetsobject[]NoLighthouse performance budgets array
timeoutnumberNoRequest timeout in milliseconds

Example prompt:

Run a Lighthouse audit on https://browserless.io and show me the scores.

Audit https://example.com for accessibility and SEO only.

browserless_crawl

Crawls a website starting from a seed URL and scrapes every discovered page using the Browserless /crawl API. Follows links up to a configurable depth and supports sitemap discovery, path filtering, subdomain handling, and custom scrape options. Returns scraped content (markdown, HTML, or raw text) for each page along with metadata. Note: Crawl is in beta and only available on Cloud plans — see pricing or contact us to confirm access.

BETA

The Crawl API is in beta and only available for Cloud plans. Parameters and response shapes may change in future releases. Contact us to enable access on your account.

ParameterTypeRequiredDefaultDescription
urlstringYesThe URL to crawl (http or https)
limitnumberNo100Maximum pages to crawl (max: 10 000)
maxDepthnumberNo5Maximum link-follow depth from the root URL
maxRetriesnumberNo1Retry attempts per failed page
allowExternalLinksbooleanNofalseFollow links to external domains
allowSubdomainsbooleanNofalseFollow links to subdomains
sitemapstringNo"auto"Sitemap handling: auto, force, skip
includePathsstring[]NoRegex patterns for URL paths to include
excludePathsstring[]NoRegex patterns for URL paths to exclude
delaynumberNo200Delay between requests in milliseconds
scrapeOptionsobjectNoPer-page scrape settings (see below)
waitForCompletionbooleanNotrueWait for crawl to finish; if false, returns immediately with a crawl ID
pollIntervalnumberNo5000Polling interval in ms when waiting for completion
maxWaitTimenumberNo300000Maximum wait time in ms (default 5 minutes)
timeoutnumberNo30000HTTP request timeout in milliseconds

Scrape options (optional sub-object on scrapeOptions):

ParameterTypeDefaultDescription
formatsstring[]["markdown"]Output formats: markdown, html, rawText
onlyMainContentbooleantrueExtract only the main content using Readability
includeTagsstring[]HTML tag selectors to include
excludeTagsstring[]HTML tag selectors to exclude
waitFornumber0Time in ms to wait after page load before scraping
headersobjectCustom HTTP headers to send with each request
timeoutnumberNavigation timeout in milliseconds

Example prompt:

Crawl https://example.com up to 3 levels deep and summarize each page.

Resources

The MCP server also exposes these resources that your AI assistant can read:

ResourceDescription
browserless://api-docsSmart Scraper API documentation and parameter reference
browserless://statusLive status of the Browserless API connection

Prompt Templates

Built-in prompt templates help your AI assistant use the tools effectively:

PromptDescription
scrape-urlScrape a webpage and summarize its content
extract-contentExtract specific information from a webpage using custom instructions

Further reading