Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.brightdata.com/llms.txt

Use this file to discover all available pages before exploring further.

This guide shows how to install the Bright Data Python SDK and call every feature it exposes: URL scraping, search engines, platform-specific scrapers (LinkedIn, Amazon, Instagram, TikTok, YouTube, Reddit, Pinterest, ChatGPT, Perplexity, Digikey), the Discover API, Scraper Studio, datasets, and the Browser API. Final Banner Pn

Installation and setup

Install the package via pip:
pip install brightdata-sdk

Configuration

You must provide your API token. You can find it in your Bright Data Control Panel. Option 1: Environment variable (recommended)
export BRIGHTDATA_API_TOKEN="your_api_token_here"
Option 2: Direct initialization
# Async client
from brightdata import BrightDataClient

async with BrightDataClient(token="your_api_token_here") as client:
    ...

# Sync client
from brightdata import SyncBrightDataClient

with SyncBrightDataClient(token="your_api_token_here") as client:
    ...

Basic usage

Use SyncBrightDataClient for simple scripts. Use BrightDataClient with asyncio for high-concurrency workloads.
from brightdata import SyncBrightDataClient

with SyncBrightDataClient() as client:
    # Scrape a URL
    data = client.scrape_url("https://example.com")
    print(f"Result: {data.data}")

    # Search Google
    search = client.search.google(query="Bright Data")
    print(f"Found: {len(search.data)}")

Launch scrapes and web searches

from brightdata import BrightDataClient

client = BrightDataClient()

# Google search
results = client.search.google(
    query="best shoes of 2025",
    location="United States",
    language="en",
    num_results=20
)

# Bing search
results = client.search.bing(
    query="python tutorial",
    location="United States"
)

# Yandex search
results = client.search.yandex(
    query="latest news",
    location="Germany"
)

if results.success:
    print(f"Cost: ${results.cost:.4f}")
    print(f"Time: {results.elapsed_ms():.2f}ms")
When working with multiple queries or URLs, requests are handled concurrently for optimal performance.

Use platform-specific scrapers for structured data

Extract structured data from Amazon, LinkedIn, Facebook, Instagram, TikTok, YouTube, Reddit, Pinterest, ChatGPT, Perplexity, and Digikey.
# Async
from brightdata import BrightDataClient

async with BrightDataClient() as client:
    products = await client.scrape.amazon.products(url="https://amazon.com/dp/B0CRMZHDG8")
    reviews = await client.scrape.amazon.reviews(
        url="https://amazon.com/dp/B0CRMZHDG8",
        pastDays=30,
        keyWord="quality"
    )
    sellers = await client.scrape.amazon.sellers(
        url="https://amazon.com/sp?seller=AXXXXXXXXXXX"
    )

# Sync
from brightdata import SyncBrightDataClient

with SyncBrightDataClient() as client:
    products = client.scrape.amazon.products(url="https://amazon.com/dp/B0CRMZHDG8")
    reviews = client.scrape.amazon.reviews(
        url="https://amazon.com/dp/B0CRMZHDG8",
        pastDays=30,
        keyWord="quality"
    )
    sellers = client.scrape.amazon.sellers(
        url="https://amazon.com/sp?seller=AXXXXXXXXXXX"
    )

Search the web with AI-powered ranking (Discover API)

# Async
from brightdata import BrightDataClient

async with BrightDataClient() as client:
    result = await client.discover(
        query="AI trends 2026",
        intent="latest technology developments"
    )
    # result.data is [{ title, link, description, relevance_score }]

    # Manual: trigger, wait, fetch
    job = await client.discover_trigger(
        query="SaaS pricing",
        intent="competitor pricing strategies"
    )
    await job.wait(timeout=60)
    data = await job.fetch()

# Sync
from brightdata import SyncBrightDataClient

with SyncBrightDataClient() as client:
    result = client.discover(
        query="AI trends 2026",
        intent="latest technology developments"
    )

Run your custom Scraper Studio scrapers

# Async
from brightdata import BrightDataClient

async with BrightDataClient() as client:
    data = await client.scraper_studio.run(
        collector="c_abc123",
        input={"url": "https://example.com/product/1"}
    )
    job = await client.scraper_studio.trigger(
        "c_abc123", {"url": "https://example.com/product/1"}
    )
    data = await job.wait_and_fetch(timeout=120)
    status = await client.scraper_studio.status("j_abc123")

# Sync
from brightdata import SyncBrightDataClient

with SyncBrightDataClient() as client:
    data = client.scraper_studio.run(
        collector="c_abc123",
        input={"url": "https://example.com/product/1"}
    )
    status = client.scraper_studio.status("j_abc123")

Datasets API

Access pre-collected data snapshots.
from brightdata import SyncBrightDataClient

with SyncBrightDataClient() as client:
    # 1. Request snapshot with filters
    print("Requesting snapshot...")
    snapshot_id = client.datasets.imdb_movies(
        filter={"name": "year", "operator": "=", "value": 2024},
        records_limit=10
    )

    # 2. Download (SDK polls automatically)
    print(f"Snapshot {snapshot_id} ready. Downloading...")
    data = client.datasets.imdb_movies.download(snapshot_id)
    print(f"Downloaded {len(data)} records.")
In your IDE, hover over the BrightDataClient class or any of its methods to view available parameters, type hints, and usage examples. The SDK provides full IntelliSense support.

Use dataclass payloads for type safety

The SDK includes dataclass payloads with runtime validation and helper properties.
from brightdata import BrightDataClient
from brightdata.payloads import (
    AmazonProductPayload,
    LinkedInJobSearchPayload,
    ChatGPTPromptPayload
)

client = BrightDataClient()

# Amazon product with validation
amazon_payload = AmazonProductPayload(
    url="https://amazon.com/dp/B123456789",
    reviews_count=50  # Runtime validated.
)
print(f"ASIN: {amazon_payload.asin}")  # Helper property
print(f"Domain: {amazon_payload.domain}")

# LinkedIn job search
linkedin_payload = LinkedInJobSearchPayload(
    keyword="python developer",
    location="San Francisco",
    remote=True
)
print(f"Remote search: {linkedin_payload.is_remote_search}")

# Use with client
result = client.scrape.amazon.products(**amazon_payload.to_dict())

Connect to scraping browser

Connect Playwright to Bright Data’s cloud browser via the Browser API.
from brightdata import BrightDataClient
from playwright.async_api import async_playwright

client = BrightDataClient(
    browser_username="brd-customer-xxxx-zone-scraping_browser1",
    browser_password="YOUR_ZONE_PASSWORD",
)

async with async_playwright() as pw:
    browser = await pw.chromium.connect_over_cdp(client.browser.get_connect_url())
    page = await browser.new_page()
    await page.goto("https://example.com", timeout=120000)
    print(await page.content())
    await browser.close()

Use the CLI tool

The SDK includes a command-line interface for terminal usage.
# Search operations
brightdata search google "python tutorial" --location "United States"
brightdata search linkedin jobs --keyword "python developer" --remote

# Scrape operations
brightdata scrape amazon products "https://amazon.com/dp/B123"
brightdata scrape linkedin profiles "https://linkedin.com/in/johndoe"

# Generic web scraping
brightdata scrape generic "https://example.com" --output-format pretty

# Save results to file
brightdata search google "AI news" --output-file results.json

Async usage for better performance

For concurrent operations, pass a list of URLs to scrape_url and run inside an async context manager.
import asyncio
from brightdata import BrightDataClient

async def main():
    async with BrightDataClient() as client:
        results = await client.scrape_url([
            "https://example1.com",
            "https://example2.com",
            "https://example3.com",
        ], mode="async", poll_timeout=180)

        for result in results:
            print(result.data)

asyncio.run(main())

Resources

GitHub repository

View source code, examples, and contribute

Examples directory

10+ working examples for all features

PyPI page

Package listing and release history

What’s new

FeatureDescription
Discover APIclient.discover() / client.discover_trigger(). AI-powered web search with intent-based relevance ranking. Available on both sync and async clients.
Scraper Studioclient.scraper_studio.run/trigger/status(). Trigger and fetch your custom Scraper Studio scrapers. Available on both sync and async clients.
Browser APIclient.browser.get_connect_url(). Connect Playwright/Puppeteer to Bright Data’s cloud browser. Replaces client.connect_browser().
New scrapersTikTok, YouTube, Reddit, Pinterest, Digikey, Perplexity added to client.scrape.*
Platform searchclient.search.linkedin / amazon / instagram / tiktok / youtube / pinterest / chatgpt. Discover content by parameters, not just URLs.
126+ DatasetsFull catalog via client.datasets.* with .sample() and .download()
Full sync paritySyncBrightDataClient now covers all features: scrapers, search, discover, scraper studio, browser