Skip to main content

Crate browsr_client

Crate browsr_client 

Source
Expand description

Browsr Client - HTTP client for browser automation

This crate provides a client for interacting with Browsr servers for browser automation, web scraping, and structured content extraction.

§Quick Start

use browsr_client::{BrowsrClient, BrowsrClientConfig};
use browsr_types::Commands;

// From environment variables
let client = BrowsrClient::from_env();

// Navigate to a page
let response = client.navigate("https://example.com", None).await?;

// Extract structured content
let data = client.extract_structured(
    "Extract the main heading and first paragraph",
    None,
    None,
).await?;

§Configuration

The client can be configured via environment variables or programmatically:

  • BROWSR_BASE_URL: Base URL (defaults to https://api.browsr.dev)
  • BROWSR_API_KEY: Optional API key for authentication

Structs§

BrowserStepInput
Input for browser_step execution (tool parameters).
BrowserStepRequest
Request payload for the /browser_step API.
BrowserStepResult
Result of browser_step execution.
BrowsrClient
Browsr HTTP client for browser automation.
BrowsrClientConfig
Configuration for the Browsr client.
CrawlApiRequest
CrawlApiResponse
JsonExtractionOptions
ObserveOptions
RelayEvent
RelayEventsResponse
RelaySessionInfo
RelaySessionListResponse
ScrapeAction
ScrapeApiRequest
ScrapeApiResponse
ScrapeData
Scraped data matching browsr-cloud /v1/scrape response.
SessionCreated
ShellCreateSessionRequest
ShellCreateSessionResponse
ShellExecRequest
ShellExecResponse
ShellSessionListItem
ShellSessionListResponse
ShellTerminateResponse

Enums§

ClientError
ScrapeFormat
TransportConfig

Constants§

DEFAULT_BASE_URL
Default base URL for the Browsr cloud service
ENV_API_KEY
Environment variable for the API key
ENV_BASE_URL
Environment variable for the base URL

Functions§

default_base_url
Derive a default base URL for HTTP transport from standard env vars.
default_transport