Skip to main content
The browser group is a managed headless browser. It renders pages, captures screenshots and PDFs, scrapes and extracts structured data, runs longer crawl jobs, and drives keep-alive Puppeteer-style sessions, all without you operating a browser fleet.
import { createVoyantCloudClient } from "@voyant-travel/cloud-sdk";

const client = createVoyantCloudClient({ apiKey: process.env.VOYANT_API_KEY! });

Render

Fetch the rendered HTML or Markdown of a page, or capture it as an image or PDF. This is useful for generating traveler documents such as vouchers and invoices from your own HTML.
const html = await client.browser.content({ url: "https://example.com" });
const markdown = await client.browser.markdown({ url: "https://example.com" });

const png = await client.browser.screenshot({ url: "https://example.com" });

const pdf = await client.browser.pdf({
  url: "https://example.com",
  pdfOptions: { format: "a4", printBackground: true },
});
content, markdown, screenshot, pdf, and snapshot require the browser:render scope.

Scrape and extract

Pull links or scraped content from a page, or extract structured JSON.
const scraped = await client.browser.scrape({ url: "https://example.com" });
const links = await client.browser.links({ url: "https://example.com" });
const data = await client.browser.json({ url: "https://example.com" /* schema, prompt */ });
scrape and links require browser:scrape. json requires browser:extract.

Crawls and sessions

For larger jobs, start a crawl and poll it. For interactive automation, open a keep-alive session and run a sequence of commands against it.
const crawl = await client.browser.crawls.start({ url: "https://example.com" });

const session = await client.browser.sessions.open({ /* ... */ });
browser.crawls.* requires browser:crawl, and browser.sessions.* requires browser:sessions.

Scopes

MethodsScope
content, markdown, screenshot, pdf, snapshotbrowser:render
scrape, linksbrowser:scrape
jsonbrowser:extract
crawls.*browser:crawl
sessions.*browser:sessions
Key types: BrowserRenderInput, BrowserScreenshotInput, BrowserPdfInput, BrowserScrapeInput, BrowserJsonInput, BrowserSessionSummary, OpenBrowserSessionInput, BrowserCommand, RunBrowserCommandsInput, BrowserCrawlSummary, StartBrowserCrawlInput.