FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Releases · brightdata/sdk-python · GitHub

Releases: brightdata/sdk-python

v2.5.2 — Safer CSV exports

Choose a tag to compare

Filter
artemo-brd released this 12 Aug 18:35

Highlights

  • CSV exports (export_csv() / export()) are now safer by default: values that spreadsheet apps like Excel, Google Sheets, or LibreOffice could misinterpret as formulas are automatically escaped when the file is opened.
  • New sanitize option (defaults to True) — pass sanitize=False to export_csv() if you need the previous raw export behavior.

What's Changed

  • chore: fix ruff import-sort lint drift in #50
  • fix: sanitize CSV formula injection in export_csv (CWE-1236) in #52

Full Changelog: v2.5.0...v2.5.2

v2.5.0 — CLI-credentials auth + scraper-core dedup

Choose a tag to compare

Filter
artemo-brd released this 30 Jul 17:59

Highlights

CLI-credentials auth fallback — one brightdata login now authenticates the SDK too. With no token given, the client falls back to the token already saved by the Bright Data CLI:

client = BrightDataClient()   # zero configuration on a logged-in machine

Resolution order: token= parameter → BRIGHTDATA_API_TOKEN / BRIGHTDATA_API_KEY env vars → CLI login → actionable error mentioning brightdata login.

Every request now reports how the token was obtained via the User-Agent header (auth=param / env / cli_credentials) — the token itself is never logged.

Internal: shared ScraperCore — the 7 search scrapers (Amazon, ChatGPT, Instagram, LinkedIn, Pinterest, TikTok, YouTube) now share one construction core instead of hand-copied __init__s, fixing drift where Amazon/ChatGPT/LinkedIn search were missing the BRIGHTDATA_API_TOKEN environment fallback that the others already had.

Changes

  • BrightDataClient / SyncBrightDataClient: new token resolution precedence + auth_source reporting
  • AsyncEngine: User-Agent now brightdata-sdk-python/{version} (auth=...) (was brightdata-sdk/{version})
  • ScraperCore: shared base for search-scraper construction (−174 lines of duplicated code)
  • README: documents the CLI login fallback

Full diff: v2.4.1...main

v2.4.1 - small fixes

Choose a tag to compare

Filter
shahar-brd released this 20 Jul 10:37
a4a81a0
Merge pull request #44 from omri-rulf/update_API_key_URL_to_current_C…

v2.4.0 — Sync parity, colorless job verbs, dataset error reporting

Choose a tag to compare

Filter
shahar-brd released this 17 Jun 13:53
e55918b

Highlights

  • Sync client parity — SyncBrightDataClient now mirrors the async surface. Adds client.datasets (fixes the
    AttributeError), the 5 missing scrapers (scrape.tiktok / youtube / reddit / perplexity / digikey), the 2 missing
    search verticals (search.tiktok / youtube), Pinterest trigger/status/fetch, and Instagram-search profiles / reels_all.
  • Service-level job verbs (colorless pattern) — every scraper now exposes generic status / wait / fetch /
    to_result(snapshot_id) (on BaseWebScraper), and DiscoverService gains status / wait / fetch / to_result(task_id).
    A triggered job can be driven by its id alone, like the crawler. Purely additive — existing job.fetch() etc. are unchanged.
  • Discover sync manual path — SyncBrightDataClient adds discover_status / discover_wait / discover_fetch /
    discover_to_result(task_id) plus a colorless DiscoverSnapshot handle.
  • Better dataset errors — failed snapshots now expose the API failure reason (and the raw status response as a fallback)
    plus the snapshot_id, instead of DatasetError: Snapshot failed: None. SnapshotStatus retains the full response (.raw)
    and matches more reason keys (error / error_message / message / failure_reason). The sync path inherits the fix.

⚠️ Breaking / Contract change

  • Sync discover_trigger() now returns a DiscoverSnapshot (a typed, drivable handle) instead of the async-only DiscoverJob,
    which couldn't be used from sync.
    Migration: poll via client.discover_status(snap.task_id) / client.discover_fetch(snap.task_id).

Full changelog: https://github.com/brightdata/sdk-python/blob/main/CHANGELOG.md

v2.3.1

Choose a tag to compare

Filter
shahar-brd released this 23 Apr 08:17

Add browser-api to readme & various fixes to discovery api and scrapers

v2.3.0 — Scraper Studio, Cleanup & Test Suite Rewrite

Choose a tag to compare

Filter
shahar-brd released this 09 Mar 15:23
43504e6

Bright Data SDK Release Notes (v2.3.0)

We are excited to announce the latest release of the Bright Data SDK! This update brings major new capabilities to our Web Scraper API, introduces new supported targets, and includes a massive under-the-hood cleanup to improve stability, maintainability, and test coverage.

New Features

  • Scraper Studio Integration: You can now seamlessly trigger and fetch results directly from your custom scrapers built within Bright Data's IDE.
  • New Built-in Scrapers: Added official out-of-the-box support for DigiKey and Reddit scrapers.

Bug Fixes

  • Scraping Reliability: Resolved a critical issue that caused a crash when calling ScrapeJob.to_result(), ensuring smoother data extraction workflows.

Maintenance & Code Quality

  • Codebase Cleanup: We've performed a major spring cleaning, removing dead code and deprecating legacy modules. This resulted in a significantly leaner SDK with a net reduction of 12,000 lines of code.
  • Enhanced Test Coverage: Added 365 new unit tests utilizing shared fixtures. Our key modules now boast robust test coverage ranging from 87% to 98%, ensuring greater reliability for future updates.

v2.2.1 — Datasets API with 100+ Integrations

Choose a tag to compare

Filter
shahar-brd released this 23 Feb 09:38

What's New

Datasets API

Access 100+ ready-made datasets from Bright Data — pre-collected, structured data from popular platforms.

  • Callable datasets — trigger snapshots directly: ⁠ await client.datasets.imdb_movies(filter=..., records_limit=5) ⁠
  • ⁠ sample() ⁠ method — quick data sampling without specifying filters
  • ⁠ get_metadata() ⁠ — discover available fields and types per dataset
  • Export utilities — ⁠ export_json() ⁠, ⁠ export_csv() ⁠, ⁠ export_jsonl() ⁠

Supported Categories

E-commerce (Amazon, Walmart, Shopee, Zalando, Zara, H&M, IKEA, Shein, Sephora), Social media (Instagram, TikTok, Pinterest,
YouTube, Facebook), Business intelligence (ZoomInfo, PitchBook, Owler, Slintel, G2, Trustpilot), Jobs & HR (Glassdoor, Indeed,
Xing), Real estate (Zillow, Airbnb + 8 regional), Luxury brands (Chanel, Dior, Prada, Hermes, YSL), Entertainment (IMDB, NBA,
Goodreads), and more.

Fixes

  • LinkedIn search tests updated to match pythonic parameter names (⁠ first_name ⁠/⁠ last_name ⁠ instead of ⁠ firstName ⁠/⁠ lastName ⁠)

v2.1.1 - Instagram Scrapers & Version Centralization

Choose a tag to compare

Filter
shahar-brd released this 20 Jan 11:58

What's New

Instagram Scraper Support

Method Description
⁠ client.scrape.instagram.profiles/posts/reels/comments(url) ⁠ Extract data from URL
⁠ client.search.instagram.profiles(user_name) ⁠ Find profile by username
⁠ client.search.instagram.posts/reels/reels_all(url, ...) ⁠ Discover content with filters

Improvements

  • Version centralization - Single source of truth in ⁠ pyproject.toml ⁠
  • Bug fix - Discovery endpoints now correctly include ⁠ type=discover_new&discover_by=... ⁠ query params

Full Changelog: v2.1.0...v2.1.1

v2.1.0 - Async Mode for SERP and Web Unlocker

Choose a tag to compare

Filter
shahar-brd released this 07 Jan 11:53

What's New

Async Mode

Non-blocking async mode for SERP and Web Unlocker APIs using mode="async":

SERP

result = await client.search.google(query="python", mode="async")

Web Unlocker

result = await client.scrape_url(url="https://example.com", mode="async")

How it works: Triggers request → gets response_id → polls until ready

Bug Fixes

  • Fix SyncBrightDataClient: remove unused customer_id parameter
  • Fix default poll_timeout for Web Unlocker async mode

API Changes

  • Remove _async suffix from method names (products() instead of products_async())
  • Remove GenericScraper - use client.scrape_url() directly

Documentation

  • Added docs/async_mode_guide.md

Full Changelog: https://github.com/brightdata/sdk-python/blob/main/CHANGELOG.md

v2.0.0 - Breaking Changes

Choose a tag to compare

Filter
shahar-brd released this 01 Dec 17:51
4108b23

🚀 v2.0.0 - Complete Architecture Rewrite

⚠️ Breaking Changes - Migration Required

This is a major breaking release requiring code changes. Python 3.9+ now required.

Client Initialization

# ❌ Old
from brightdata import bdclient
client = bdclient(api_token="your_token")

# ✅ New
from brightdata import BrightDataClient
client = BrightDataClient(token="your_token")

API Structure - Hierarchical Methods

# ❌ Old - Flat API
client.scrape_linkedin.profiles(url)
client.search_linkedin.jobs()
result = client.scrape(url, zone="my_zone")

# ✅ New - Hierarchical API
client.scrape.linkedin.profiles(url)
client.search.linkedin.jobs()
result = client.scrape_url(url, zone="my_zone")

Platform-Specific Scraping

# ✅ New - Recommended approach
client.scrape.amazon.products(url)
client.scrape.amazon.reviews(url)
client.scrape.amazon.sellers(url)
client.scrape.linkedin.profiles(url)
client.scrape.instagram.profiles(url)
client.scrape.facebook.posts(url)

Search Operations

# ❌ Old
results = client.search(query, search_engine="google")

# ✅ New - Dedicated methods
client.search.google(query)
client.search.bing(query)
client.search.yandex(query)

Async Support (New)

# ✅ Sync (still supported)
client = BrightDataClient(token="...")
result = client.scrape_url(url)

# ✅ Async (recommended for performance)
async with BrightDataClient(token="...") as client:
    result = await client.scrape_url_async(url)
    
# ✅ Async batch operations
async def scrape_multiple():
    async with BrightDataClient(token="...") as client:
        tasks = [client.scrape_url_async(url) for url in urls]
        results = await asyncio.gather(*tasks)

Manual Job Control (New)

# ✅ Fine-grained control
job = await scraper.trigger(url)
# Do other work...
status = await job.status_async()
if status == "ready":
    data = await job.fetch_async()

Type-Safe Payloads (New)

# ❌ Old - untyped dicts
payload = {"url": "...", "reviews_count": 100}

# ✅ New - structured with validation
from brightdata import AmazonProductPayload
payload = AmazonProductPayload(
    url="https://amazon.com/dp/B123",
    reviews_count=100
)
result = client.scrape.amazon.products(payload)

Return Types

# ✅ New - structured objects with metadata
result = client.scrape.amazon.products(url)
print(result.data)        # Actual scraped data
print(result.timing)      # Performance metrics
print(result.cost)        # Cost tracking
print(result.snapshot_id) # Job identifier

CLI Tool (New)

# ✅ Command-line interface
brightdata scrape amazon products --url https://amazon.com/dp/B123
brightdata search google --query "python sdk"
brightdata search linkedin jobs --location "Paris"
brightdata crawler discover --url https://example.com --depth 3

Configuration Changes

# ❌ Old
client = bdclient(
    api_token="token",              # Changed parameter name
    auto_create_zones=True,          # Default changed to False
    web_unlocker_zone="sdk_unlocker", # Default changed
    serp_zone="sdk_serp",            # Default changed
    browser_zone="sdk_browser"       # Default changed
)

# ✅ New
client = BrightDataClient(
    token="token",                   # Renamed from api_token
    auto_create_zones=False,         # New default
    web_unlocker_zone="web_unlocker1", # New default name
    serp_zone="serp_api1",           # New default name
    browser_zone="browser_api1",     # New default name
    timeout=30,                      # New parameter
    rate_limit=10,                   # New parameter (optional)
    rate_period=1.0                  # New parameter
)

✨ New Features

Platform Coverage

Platform Status Methods
Amazon ✅ NEW products(), reviews(), sellers()
Instagram ✅ NEW profiles(), posts(), comments(), reels()
Facebook ✅ NEW posts(), comments(), groups()
LinkedIn ✅ Enhanced Full scraping and search
ChatGPT ✅ Enhanced Improved interaction
Google/Bing/Yandex ✅ Enhanced Dedicated services

Performance

  • 10x better concurrency - Event loop-based architecture
  • 🔌 Advanced connection pooling - 100 total, 30 per host
  • 🎯 Built-in rate limiting - Configurable request throttling

✅ Upgrade Checklist

  • Update Python to 3.9+
  • Change imports: bdclient → BrightDataClient
  • Update parameter: api_token= → token=
  • Migrate method calls to hierarchical structure
  • Handle new ScrapeResult/SearchResult return types
  • Review zone configuration defaults
  • Consider async for better performance
  • Test in staging environment

📚 Resources

Full Changelog: v1.1.3...v2.0.0


Back | FazBrowse Home | New Git URL