How to Set Up Bright Data With LangChain
Integrating Bright Data with LangChain enhances LLM-powered agents with reliable, anonymous, and scalable web access for real-world applications. The langchain-brightdata
Python package is the official LangChain integration for Bright Data, including support for:
BrightDataSERP
Bright Data provides a powerful SERP API that allows you to query search engines (Google,Bing, DuckDuckGo,Yandex) with geo-targeting and advanced customization options, particularly useful for AI agents requiring real-time web information.
BrightDataUnlocker
Bright Data provides a powerful Web Unlocker API that allows you to access websites that might be protected by anti-bot measures, geo-restrictions, or other access limitations, making it particularly useful for AI agents requiring reliable web content extraction.
BrightDataWebScraperAPI
Bright Data provides a powerful Web Scraper API that allows you to extract structured data from 100+ ppular domains, including Amazon product details, LinkedIn profiles, and more, making it particularly useful for AI agents requiring reliable structured web data feeds.
How to Integrate Bright Data With LangChain
Obtain Your Bright Data API Key
- Log in to your Bright Data dashboard.
- Go to Account Settings.
- Generate an API key if you haven’t already done so.
Install the Bright Data Integration
Install the Bright Data integration package for LangChain by running the following command:
Set the environment variable
Set your Bright Data API key as an environment variable:
Or pass it directly when initializing tools:
Select your preferred Bright Data tool
The Bright Data + LangChain integration currently supports:
API reference: Web Unlocker API Documentation
Access any public website, even if it’s bot-protected or geo-restricted.
API reference: Web Scraper API Documentation
Extract structured data from over 100 supported domains like Amazon, LinkedIn, and more.