Overview
Integration details
| Class | Package | Serializable | JS support | Version |
|---|---|---|---|---|
| BrightDataSERP | langchain-brightdata | β | β |
Tool features
| Native async | Returns artifact | Return data | Pricing |
|---|---|---|---|
| β | β | Title, URL, snippet, position, and other search result data | Requires Bright Data account |
Setup
The integration lives in thelangchain-brightdata package.
pip install langchain-brightdata
Credentials
Youβll need a Bright Data API key to use this tool. You can set it as an environment variable:Instantiation
Here we show how to instantiate an instance of the BrightDataSERP tool. This tool allows you to perform search engine queries with various customization options including geo-targeting, language preferences, device type simulation, and specific search types using Bright Dataβs SERP API. The tool accepts various parameters during instantiation:bright_data_api_key(required, str): Your Bright Data API key for authentication.search_engine(optional, str): Search engine to use for queries. Default is βgoogleβ. Other options include βbingβ, βyahooβ, βyandexβ, βDuckDuckGoβ etc.country(optional, str): Two-letter country code for localized search results (e.g., βusβ, βgbβ, βdeβ, βjpβ). Default is βusβ.language(optional, str): Two-letter language code for the search results (e.g., βenβ, βesβ, βfrβ, βdeβ). Default is βenβ.results_count(optional, int): Number of search results to return. Default is 10. Maximum value is typically 100.search_type(optional, str): Type of search to perform. Options include:- None (default): Regular web search
- βischβ: Images search
- βshopβ: Shopping search
- βnwsβ: News search
- βjobsβ: Jobs search
device_type(optional, str): Device type to simulate for the search. Options include:- None (default): Desktop device
- βmobileβ: Generic mobile device
- βiosβ: iOS device (iPhone)
- βandroidβ: Android device
parse_results(optional, bool): Whether to return parsed JSON results. Default is False, which returns raw HTML response.
Invocation
Basic Usage
Advanced Usage with Parameters
Customization Options
The BrightDataSERP tool accepts several parameters for customization:| Parameter | Type | Description |
|---|---|---|
query | str | The search query to perform |
search_engine | str | Search engine to use (default: βgoogleβ) |
country | str | Two-letter country code for localized results (default: βusβ) |
language | str | Two-letter language code (default: βenβ) |
results_count | int | Number of results to return (default: 10) |
search_type | str | Type of search: None (web), βischβ (images), βshopβ, βnwsβ (news), βjobsβ |
device_type | str | Device type: None (desktop), βmobileβ, βiosβ, βandroidβ |
parse_results | bool | Whether to return structured JSON (default: False) |