Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,31 @@ async with BrightDataClient() as client:
- `client.scrape.instagram` - profiles, posts, comments, reels
- `client.scrape.facebook` - posts, comments, reels

### Browser API

Cloud-hosted Chrome instances accessible via the Chrome DevTools Protocol (CDP). The SDK builds the connection URL — you drive the browser with Playwright, Puppeteer, or Selenium.

```python
from brightdata import BrightDataClient
from playwright.async_api import async_playwright

client = BrightDataClient(
browser_username="brd-customer-<id>-zone-<zone>",
browser_password="<password>",
)

url = client.browser.get_connect_url(country="us") # country is optional

async with async_playwright() as pw:
browser = await pw.chromium.connect_over_cdp(url)
page = await browser.new_page()
await page.goto("https://example.com")
html = await page.content()
await browser.close()
```

**When to use:** sites that require full browser automation — JS rendering, login flows, interactive clicks. For plain HTML fetches, prefer `client.scrape_url()`.

## Datasets API

Access 100+ ready-made datasets from Bright Data — pre-collected, structured data from popular platforms.
Expand Down
2 changes: 1 addition & 1 deletion notebooks/01_quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"display_name": ".venv (3.11.10)",
"language": "python",
"name": "python3"
},
Expand Down
2 changes: 1 addition & 1 deletion notebooks/02_pandas_integration.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"display_name": ".venv (3.11.10)",
"language": "python",
"name": "python3"
},
Expand Down
235 changes: 27 additions & 208 deletions notebooks/03_serp.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"API Token: 7011787d-2...3336\n",
"API Token: 859a9772-4...4362\n",
"Setup complete!\n"
]
}
Expand All @@ -59,7 +59,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 2,
"metadata": {},
"outputs": [
{
Expand All @@ -85,27 +85,9 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Name: brightdata-sdk\n",
"Version: 2.1.2\n",
"Summary: Modern async-first Python SDK for Bright Data APIs\n",
"Home-page: https://github.com/brightdata/sdk-python\n",
"Author: Bright Data\n",
"Author-email: Bright Data <support@brightdata.com>\n",
"License: MIT\n",
"Location: /Users/ns/Desktop/projects/sdk-python/.venv/lib/python3.11/site-packages\n",
"Editable project location: /Users/ns/Desktop/projects/sdk-python\n",
"Requires: aiohttp, aiolimiter, click, pydantic, pydantic-settings, python-dotenv, requests, tldextract\n",
"Required-by: \n"
]
}
],
"outputs": [],
"source": [
"!pip show brightdata-sdk "
]
Expand All @@ -122,7 +104,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand All @@ -138,21 +120,21 @@
"\n",
"--- Top 5 Results ---\n",
"\n",
"1. The Python Tutorial — Python 3.14.3 documentation\n",
" URL: https://docs.python.org/3/tutorial/index.html...\n",
" Description: This tutorial introduces the reader informally to the basic concepts and feature...\n",
"\n",
"2. Python Tutorial\n",
"1. Python Tutorial\n",
" URL: https://www.w3schools.com/python/...\n",
" Description: Learn Python. Python is a popular programming language. Python can be used on a ...\n",
"\n",
"3. Python For Beginners\n",
"2. Python For Beginners\n",
" URL: https://www.python.org/about/gettingstarted/...\n",
" Description: Welcome! Are you completely new to programming? If not then we presume you will ...\n",
"\n",
"4. Best Python tutorial for beginners in 2024? : r/learnpython\n",
" URL: https://www.reddit.com/r/learnpython/comments/1ajlvog/best_p...\n",
" Description: I'm almost done with The Complete Python Bootcamp from Zero to Hero in Python th...\n",
"3. Python Tutorial\n",
" URL: https://www.geeksforgeeks.org/python/python-programming-lang...\n",
" Description: In this section, we'll cover the basics of Python programming, including install...\n",
"\n",
"4. Python Tutorials\n",
" URL: https://www.youtube.com/playlist?list=PL-osiE80TeTt2d9bfVyTi...\n",
" Description: An in-depth look at the Python programming language. Learn about Python developm...\n",
"\n",
"5. Learn Python - Free Interactive Python Tutorial\n",
" URL: https://www.learnpython.org/...\n",
Expand Down Expand Up @@ -200,43 +182,9 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Query: 'best restaurants near me'\n",
"Testing different locations...\n",
"\n",
"=== Location: New York, United States ===\n",
" 1. Best Restaurants Near Me\n",
" https://www.tripadvisor.com/Restaurants\n",
" 2. Best Restaurants Near Me - February 2026\n",
" https://www.yelp.com/nearme/restaurants\n",
" 3. The 10 Best Restaurants Near Me in New York City, NY\n",
" https://www.opentable.com/nearby/restaurants-near-me-new-york-city\n",
"\n",
"=== Location: London, United Kingdom ===\n",
" 1. Best Restaurants Near Me\n",
" https://www.tripadvisor.com/Restaurants\n",
" 2. TOP 10 BEST Restaurants near Bentonville, AR\n",
" https://www.yelp.com/c/bentonville-ar-us/restaurants\n",
" 3. The Best Restaurants Open Near Me - TheFork\n",
" https://www.thefork.com/near-me\n",
"\n",
"=== Location: Tokyo, Japan ===\n",
" 1. Best Restaurants Near Me\n",
" https://www.tripadvisor.com/Restaurants\n",
" 2. 10 Best Punta Gorda Restaurants that Prove it's a Foodie ...\n",
" https://rtwin30days.com/best-punta-gorda-restaurants/\n",
" 3. The Best Places to Eat in St. Augustine, Florida\n",
" https://currentlytraveling.com/the-best-places-to-eat-in-st-augustine-florida/\n",
"\n"
]
}
],
"outputs": [],
"source": [
"QUERY = \"best restaurants near me\"\n",
"\n",
Expand Down Expand Up @@ -277,44 +225,9 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Batch Google Search: 3 queries\n",
"\n",
"Results: 3 responses\n",
"\n",
"=== Query: 'python web scraping' ===\n",
"Success: True\n",
"Results found: 8\n",
" 1. Python Web Scraping Tutorial\n",
" https://www.geeksforgeeks.org/python/python-web-scraping-tutorial/\n",
" 2. Beautiful Soup: Build a Web Scraper With Python\n",
" https://realpython.com/beautiful-soup-web-scraper-python/\n",
"\n",
"=== Query: 'javascript async await' ===\n",
"Success: True\n",
"Results found: 10\n",
" 1. async function - JavaScript - MDN Web Docs\n",
" https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function\n",
" 2. JavaScript async and await\n",
" https://www.w3schools.com/js/js_async.asp\n",
"\n",
"=== Query: 'data science tools' ===\n",
"Success: True\n",
"Results found: 9\n",
" 1. 13 Essential Data Science Tools (And How to Use Them)\n",
" https://learning.linkedin.com/resources/learning-tech/how-to-use-13-essential-data-science-tools\n",
" 2. If you had to list a “tier list” of software that data scien\n",
" https://www.reddit.com/r/datascience/comments/184ezlq/if_you_had_to_list_a_tier_list_of_software_that/\n",
"\n"
]
}
],
"outputs": [],
"source": [
"QUERIES = [\n",
" \"python web scraping\",\n",
Expand Down Expand Up @@ -362,28 +275,9 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Query: 'weather today'\n",
"Comparing desktop vs mobile results...\n",
"\n",
"=== Desktop ===\n",
" 1. National and Local Weather Radar, Daily Forecast, \n",
" 2. Weather Forecast and Conditions for New York City,\n",
" 3. Weather Forecast and Conditions for Austin, Texas\n",
"\n",
"=== Mobile ===\n",
" 1. Spain Current Weather\n",
" 2. Weather forecast by locations\n",
" 3. 10-Day Weather Forecast for Valdeacederas, Tetuán \n"
]
}
],
"outputs": [],
"source": [
"QUERY = \"weather today\"\n",
"\n",
Expand Down Expand Up @@ -427,29 +321,9 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"=== Result Metadata ===\n",
"success: True\n",
"search_engine: google\n",
"query: {'q': 'weather today', 'location': None, 'language': 'en'}\n",
"country: None\n",
"results_per_page: 5\n",
"total_found: None\n",
"\n",
"=== Timing ===\n",
"trigger_sent_at: 2026-02-11 17:55:31.882102+00:00\n",
"data_fetched_at: 2026-02-11 17:55:36.380537+00:00\n",
"\n",
"Total time: 4.50 seconds\n"
]
}
],
"outputs": [],
"source": [
"# Check timing metadata from last result\n",
"print(\"=== Result Metadata ===\")\n",
Expand Down Expand Up @@ -478,18 +352,9 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Exported to: /Users/ns/Desktop/projects/sdk-python/notebooks/serp_results.json\n",
"Results count: 10\n"
]
}
],
"outputs": [],
"source": [
"import json\n",
"from pathlib import Path\n",
Expand Down Expand Up @@ -529,55 +394,9 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Query: 'machine learning frameworks'\n",
"Requesting 30 results (pagination will fetch ~3 pages)...\n",
"\n",
"Success: True\n",
"Results returned: 30\n",
"Total found (Google estimate): None\n",
"Results per page: 10\n",
"\n",
"--- All 30 Results ---\n",
" 1. Top 10 Machine Learning Frameworks in 2025\n",
" 2. Machine Learning Frameworks and Languages\n",
" 3. Machine Learning Framework Preferences in the Industry\n",
" 4. Machine and Deep Learning Frameworks\n",
" 5. What Are Machine Learning Frameworks?\n",
" 6. Top 10 Machine Learning Frameworks (2026)\n",
" 7. Machine learning frameworks\n",
" 8. Machine Learning Frameworks: Features, Use Cases ...\n",
" 9. Top Machine Learning Frameworks To Use\n",
"10. What Is a Machine Learning Pipeline?\n",
"11. josephmisiti/awesome-machine-learning: A curated list o\n",
"12. Effective Machine Learning Frameworks\n",
"13. The Top 16 AI Frameworks and Libraries: A Beginner's Gu\n",
"14. What Are Machine Learning Frameworks and How to Pick ..\n",
"15. YouTube\n",
"16. Top 20 Machine Learning Frameworks Of All Times\n",
"17. Comparison of ML Frameworks\n",
"18. Machine learning frameworks: Choosing the right one\n",
"19. 15 Popular Machine Learning Frameworks for Model ...\n",
"20. Best Machine Learning Frameworks(ML) for Experts in 202\n",
"21. PyTorch\n",
"22. Top Machine Learning Frameworks to Use\n",
"23. The State of Machine Learning Frameworks in 2019\n",
"24. Top 8 Deep Learning Frameworks You Should Know | 2025\n",
"25. Machine Learning and Deep Learning frameworks and ...\n",
"26. Deep Learning Frameworks\n",
"27. Machine Learning Frameworks: Features, Use Cases ...\n",
"28. Comparison of deep learning software\n",
"29. The Ultimate Guide to Machine Learning Frameworks\n",
"30. Machine learning frameworks: Choosing the right one\n"
]
}
],
"outputs": [],
"source": [
"QUERY = \"machine learning frameworks\"\n",
"NUM_RESULTS = 30 # Request 30 results (3 pages)\n",
Expand Down Expand Up @@ -666,7 +485,7 @@
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"display_name": ".venv (3.11.10)",
"language": "python",
"name": "python3"
},
Expand Down
Loading