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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand Up@@ -666,7 +485,7 @@
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"display_name": ".venv (3.11.10)",
"language": "python",
"name": "python3"
},
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand Up@@ -666,7 +485,7 @@
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"display_name": ".venv (3.11.10)",
"language": "python",
"name": "python3"
},
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand Up@@ -666,7 +485,7 @@
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"display_name": ".venv (3.11.10)",
"language": "python",
"name": "python3"
},
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand Up@@ -666,7 +485,7 @@
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"display_name": ".venv (3.11.10)",
"language": "python",
"name": "python3"
},
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand Up@@ -666,7 +485,7 @@
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"display_name": ".venv (3.11.10)",
"language": "python",
"name": "python3"
},
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand Up@@ -666,7 +485,7 @@
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"display_name": ".venv (3.11.10)",
"language": "python",
"name": "python3"
},
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand Up@@ -666,7 +485,7 @@
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"display_name": ".venv (3.11.10)",
"language": "python",
"name": "python3"
},
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 numberDiff line numberDiff 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand 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 DownExpand Up@@ -666,7 +485,7 @@
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"display_name": ".venv (3.11.10)",
"language": "python",
"name": "python3"
},
Expand Down
Loading
Loading