Implementation:CrewAIInc CrewAI BrightData SERP Tool
| Knowledge Sources | |
|---|---|
| Domains | Tools, Web_Search, BrightData |
| Last Updated | 2026-02-11 00:00 GMT |
Overview
Concrete tool for performing web searches using Bright Data's SERP API across multiple search engines provided by CrewAI.
Description
The BrightDataSearchTool class extends BaseTool to perform web searches through Bright Data's SERP (Search Engine Results Page) API. It supports multiple search engines (Google, Bing, Yandex), geo-targeting via country codes, language preferences, search type specialization (images via "isch", news via "nws", jobs), and device type simulation (desktop, mobile, iOS, Android). The tool constructs search URLs for the chosen engine, appends query parameters for targeting and parsing options, and sends POST requests to the BrightData API endpoint (https://api.brightdata.com/request). When parse_results is True, results are returned as structured JSON via the brd_json=1 parameter; otherwise raw HTML is returned. Requires BRIGHT_DATA_API_KEY and BRIGHT_DATA_ZONE environment variables.
Usage
Use this tool when CrewAI agents need to perform web searches across multiple engines with advanced targeting, device simulation, and geo-specific data collection capabilities for market research, SEO analysis, or localized data gathering.
Code Reference
Source Location
- Repository: CrewAI
- File: lib/crewai-tools/src/crewai_tools/tools/brightdata_tool/brightdata_serp.py
- Lines: 1-237
Signature
class BrightDataSearchTool(BaseTool):
name: str = "Bright Data SERP Search"
description: str = "Tool to perform web search using Bright Data SERP API."
args_schema: type[BaseModel] = BrightDataSearchToolSchema
base_url: str = ""
api_key: str = ""
zone: str = ""
search_engine: str = "google"
country: str = "us"
language: str = "en"
parse_results: bool = True
def __init__(self, query=None, search_engine="google", country="us", ...): ...
def _run(self, query=None, search_engine=None, country=None, ...) -> Any: ...
def get_search_url(self, engine: str, query: str): ...
Import
from crewai_tools import BrightDataSearchTool
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| query | str | Yes | Search query to perform |
| search_engine | str or None | No | Search engine: "google", "bing", or "yandex" (default "google") |
| country | str or None | No | Two-letter country code for geo-targeting (default "us") |
| language | str or None | No | Language code for results (default "en") |
| search_type | str or None | No | Type of search: "isch" (images), "nws" (news), "jobs" |
| device_type | str or None | No | Device simulation: "desktop", "mobile", "ios", "android" (default "desktop") |
| parse_results | bool or None | No | Return structured JSON (True) or raw HTML (False) (default True) |
Outputs
| Name | Type | Description |
|---|---|---|
| _run() returns | str | Parsed JSON data or raw HTML from BrightData SERP API response |
Usage Examples
Basic Usage
from crewai_tools import BrightDataSearchTool
tool = BrightDataSearchTool(
search_engine="google",
country="us",
language="en"
)
results = tool.run(query="AI agent frameworks 2025")