Overview
Integration details
| Class | Package | Serializable | JS support | Version |
|---|---|---|---|---|
| BrightDataUnlocker | langchain-brightdata | â | â |
Tool features
| Native async | Returns artifact | Return data | Pricing |
|---|---|---|---|
| â | â | HTML, Markdown, or screenshot of web pages | Requires Bright Data account |
Setup
The integration lives in thelangchain-brightdata package.
Instantiation
Here we show how to instantiate an instance of the BrightDataUnlocker tool. This tool allows you to access websites that may be protected by anti-bot measures, geo-restrictions, or other access limitations using Bright Dataâs Web Unlocker service. The tool accepts various parameters during instantiation:bright_data_api_key(required, str): Your Bright Data API key for authentication.format(optional, Literal[ârawâ]): Format of the response content. Default is ârawâ.country(optional, str): Two-letter country code for geo-specific access (e.g., âusâ, âgbâ, âdeâ, âjpâ). Set this when you need to view the website as if accessing from a specific country. Default is None.zone(optional, str): Bright Data zone to use for the request. The âunlockerâ zone is optimized for accessing websites that might block regular requests. Default is âunlockerâ.data_format(optional, Literal[âhtmlâ, âmarkdownâ, âscreenshotâ]): Output format for the retrieved content. Options include:- âhtmlâ - Returns the standard HTML content (default)
- âmarkdownâ - Returns content converted to markdown format
- âscreenshotâ - Returns a PNG screenshot of the rendered page
Invocation
Basic Usage
Advanced Usage with Parameters
Customization Options
The BrightDataUnlocker tool accepts several parameters for customization:| Parameter | Type | Description |
|---|---|---|
url | str | The URL to access |
format | str | Format of the response content (default: ârawâ) |
country | str | Two-letter country code for geo-specific access (e.g., âusâ, âgbâ) |
zone | str | Bright Data zone to use (default: âunlockerâ) |
data_format | str | Output format: None (HTML), âmarkdownâ, or âscreenshotâ |
Data Format Options
Thedata_format parameter allows you to specify how the content should be returned:
Noneor"html"(default): Returns the standard HTML content of the page"markdown": Returns the content converted to markdown format, which is useful for feeding directly to LLMs"screenshot": Returns a PNG screenshot of the rendered page, useful for visual analysis