Bright Data는 Amazon 제품 상세 정보, LinkedIn 프로필 등 100개 이상의 인기 도메인에서 구조화된 데이터를 추출할 수 있는 강력한 Web Scraper API를 제공합니다. 이는 신뢰할 수 있는 구조화된 웹 데이터 피드가 필요한 AI agent에 특히 유용합니다.

Overview

Integration details

ClassPackageSerializableJS supportVersion
BrightDataWebScraperAPIlangchain-brightdataPyPI - Version

Tool features

Native asyncReturns artifactReturn dataPricing
웹사이트의 구조화된 데이터 (Amazon 제품, LinkedIn 프로필 등)Bright Data 계정 필요

Setup

이 integration은 langchain-brightdata package에 포함되어 있습니다.
pip install langchain-brightdata
이 tool을 사용하려면 Bright Data API key가 필요합니다. 환경 변수로 설정할 수 있습니다:
import os

os.environ["BRIGHT_DATA_API_KEY"] = "your-api-key"
또는 tool을 초기화할 때 직접 전달할 수 있습니다:
from langchain_brightdata import BrightDataWebScraperAPI

scraper_tool = BrightDataWebScraperAPI(bright_data_api_key="your-api-key")

Instantiation

여기서는 BrightDataWebScraperAPI tool의 인스턴스를 생성하는 방법을 보여줍니다. 이 tool을 사용하면 Bright Data의 Dataset API를 통해 Amazon 제품 상세 정보, LinkedIn 프로필 등 다양한 웹사이트에서 구조화된 데이터를 추출할 수 있습니다. 이 tool은 인스턴스 생성 시 다양한 parameter를 받습니다:
  • bright_data_api_key (필수, str): 인증을 위한 Bright Data API key입니다.
  • dataset_mapping (선택, Dict[str, str]): dataset 유형을 해당 Bright Data dataset ID에 매핑하는 dictionary입니다. 기본 매핑에는 다음이 포함됩니다:
    • “amazon_product”: “gd_l7q7dkf244hwjntr0”
    • “amazon_product_reviews”: “gd_le8e811kzy4ggddlq”
    • “linkedin_person_profile”: “gd_l1viktl72bvl7bjuj0”
    • “linkedin_company_profile”: “gd_l1vikfnt1wgvvqz95w”

Invocation

Basic Usage

from langchain_brightdata import BrightDataWebScraperAPI

# Initialize the tool
scraper_tool = BrightDataWebScraperAPI(
    bright_data_api_key="your-api-key"  # Optional if set in environment variables
)

# Extract Amazon product data
results = scraper_tool.invoke(
    {"url": "https://www.amazon.com/dp/B08L5TNJHG", "dataset_type": "amazon_product"}
)

print(results)

Advanced Usage with Parameters

from langchain_brightdata import BrightDataWebScraperAPI

# Initialize with default parameters
scraper_tool = BrightDataWebScraperAPI(bright_data_api_key="your-api-key")

# Extract Amazon product data with location-specific pricing
results = scraper_tool.invoke(
    {
        "url": "https://www.amazon.com/dp/B08L5TNJHG",
        "dataset_type": "amazon_product",
        "zipcode": "10001",  # Get pricing for New York City
    }
)

print(results)

# Extract LinkedIn profile data
linkedin_results = scraper_tool.invoke(
    {
        "url": "https://www.linkedin.com/in/satyanadella/",
        "dataset_type": "linkedin_person_profile",
    }
)

print(linkedin_results)

Customization Options

BrightDataWebScraperAPI tool은 커스터마이징을 위한 여러 parameter를 받습니다:
ParameterTypeDescription
urlstr데이터를 추출할 URL
dataset_typestr사용할 dataset 유형 (예: “amazon_product”)
zipcodestr위치별 데이터를 위한 선택적 우편번호

Available Dataset Types

이 tool은 구조화된 데이터 추출을 위해 다음 dataset 유형을 지원합니다:
Dataset TypeDescription
amazon_productAmazon 제품의 상세 데이터 추출
amazon_product_reviewsAmazon 제품 리뷰 추출
linkedin_person_profileLinkedIn 개인 프로필 데이터 추출
linkedin_company_profileLinkedIn 회사 프로필 데이터 추출

Use within an agent

from langchain_brightdata import BrightDataWebScraperAPI
from langchain_google_genai import ChatGoogleGenerativeAI
from langchain.agents import create_agent


# Initialize the LLM
llm = ChatGoogleGenerativeAI(model="gemini-2.5-flash", google_api_key="your-api-key")

# Initialize the Bright Data Web Scraper API tool
scraper_tool = BrightDataWebScraperAPI(bright_data_api_key="your-api-key")

# Create the agent with the tool
agent = create_agent(llm, [scraper_tool])

# Provide a user query
user_input = "Scrape Amazon product data for https://www.amazon.com/dp/B0D2Q9397Y?th=1 in New York (zipcode 10001)."

# Stream the agent's step-by-step output
for step in agent.stream(
    {"messages": user_input},
    stream_mode="values",
):
    step["messages"][-1].pretty_print()

API reference


Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.
I