You can do it either by using 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.
- BrightDataUnlockerAPI - Bright Data provides a powerful 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.
langchain-brightdata package, it can be integrated manually using LangChain’s Tool or RequestsWrapper.
How to Integrate Bright Data With LangChain
0
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.
2
Install the Bright Data Integration
Install the Bright Data integration package for LangChain by running the following command:
3
Set the environment variable
Set your Bright Data API key as an environment variable:
Or pass it directly when initializing tools:
4
Select your preferred Bright Data tool
The Bright Data + LangChain integration currently supports:
- BrightDataSERP
- BrightDataUnblocker
- BrightDataWebScraperAPI