Skip to main content

REST APIs

Browserless REST APIs provide HTTP endpoints for common browser tasks like screenshots, PDFs, content scraping, file downloads, function execution, and website unblocking. Use them when you want a single HTTP request to do one browser task without managing browser infrastructure.

Quick Start

Scrape a website with a single HTTP request:

  1. Sign Up

    Sign up for a Browserless account (free plan available).

  2. Get API Token

    Get your API token from the account dashboard.

  3. Run Your First Request

    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"}]}'

    Response

    {
      "data": [
        {
          "results": [
            {
              "html": "Example Domain",
              "text": "Example Domain"
            }
          ],
          "selector": "h1"
        }
      ]
    }

Which API Should I Use?

APIBest ForInputOutput
/smart-scrapeScraping a page with automatic fallbacks for blocked or JavaScript-heavy sitesURL + optional output formatsapplication/json
/contentGetting fully rendered HTML, including JS-rendered contentURL or raw HTMLtext/html
/scrapeExtracting structured data with CSS selectorsURL + elements array of CSS selectorsapplication/json
/screenshotCapturing full-page or viewport screenshotsURL or raw HTML + Puppeteer optionsimage/png, image/jpeg, or image/webp
/pdfGenerating PDF documents from pagesURL or raw HTML + Puppeteer optionsapplication/pdf
/searchSearching the web and optionally scraping result pagesQuery + optional sources and scrape optionsapplication/json
/mapDiscovering URLs on a site or sitemapBase URL + optional search and sitemap settingsapplication/json
/functionRunning custom Puppeteer code server-sideJavaScript code (+ optional context object)Any (based on function return type)
/downloadRetrieving files that Chrome downloads during executionJavaScript code (+ optional context object)Any (matches downloaded file)
/exportFetching a URL and streaming it in its native content typeURLAny (native content type, or zip with includeResources)
/unblockBypassing CAPTCHAs and bot detectionURL + data flags (content, cookies, screenshot, browserWSEndpoint)application/json (HTML, cookies, screenshot, WebSocket endpoint)
/performanceRunning Lighthouse audits for SEO, accessibility, and speedURL + optional Lighthouse configapplication/json (Lighthouse metrics)
/crawlAsynchronously crawling an entire site and scraping every pageURL + depth, path filters, scrape optionsapplication/json (structured page data)

REST API Limitations

REST APIs are stateless, single-action endpoints. Each request launches a browser, performs one task, and closes the session. Keep these constraints in mind:

  • No multi-step workflows — you cannot click a button, fill a form, and then scrape the result in a single request. Each call is independent (except through /function, which still runs in a single session).
  • No session persistence — cookies and state are discarded after every response. Use BaaS sessions or BrowserQL persisted state if you need to keep a browser alive between requests.
  • Limited bot-detection bypass/unblock handles basic protections, but sites with advanced fingerprinting or interactive CAPTCHAs may still block requests. Use BrowserQL for advanced stealth and CAPTCHA solving.
  • No real-time interaction — you cannot observe the page, react to changes, or branch logic mid-execution. To prototype and debug Puppeteer code with a live browser view, use the Live Debugger in your Browserless dashboard, then deploy the working code via the /function API. The REST API Playground is for building and testing REST requests, not for debugging /function code live.

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.

Bot Detection

For sites with sophisticated bot detection, use BrowserQL which provides advanced stealth capabilities and CAPTCHA solving.

Next Steps