Skip to content
Skillpedia
Web scraping33k · #9095

bright-data-best-practices

What it does

This skill gives the AI agent reference guidance for Bright Data's web data APIs. It is for developers building scraping, search or browser automation features.

When to use it

  • ✓When you are building a feature that needs to pull content from many web pages reliably.
  • ✓When you need Google, Bing or Yandex search results as structured data.
  • ✓When you want to automate clicks, scrolling or forms on a website using a browser API.

Skill link

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/web-data/bright-data-best-practices/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/web-data/bright-data-best-practices/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Which Bright Data API should I use to pull Google search results into my app?”

5 new skills a week. 1 minute to read.

How it works

The agent matches your use case to the right Bright Data API, then helps set up the authentication and code for it.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Bright Data APIs

Bright Data provides infrastructure for web data extraction at scale. Four primary APIs cover different use cases — always pick the most specific tool for the job.

Choosing the Right API

Use Case API Why
Scrape any webpage by URL (no interaction) Web Unlocker HTTP-based, auto-bypasses bot detection, cheapest
Google / Bing / Yandex search results SERP API Specialized for SERP extraction, returns structured data
Structured data from Amazon, LinkedIn, Instagram, TikTok, etc. Web Scraper API Pre-built scrapers, no parsing needed
Click, scroll, fill forms, run JS, intercept XHR Browser API Full browser automation
Puppeteer / Playwright / Selenium automation Browser API Connects via CDP/WebDriver

Authentication Pattern (All APIs)

All APIs share the same authentication model:

export BRIGHTDATA_API_KEY="your-api-key"         # From Control Panel > Account Settings
export BRIGHTDATA_UNLOCKER_ZONE="zone-name"       # Web Unlocker zone name
export BRIGHTDATA_SERP_ZONE="serp-zone-name"      # SERP API zone name
export BROWSER_AUTH="brd-customer-ID-zone-NAME:PASSWORD"  # Browser API credentials

REST API authentication header for Web Unlocker and SERP API:

Authorization: Bearer YOUR_API_KEY

Web Unlocker API

HTTP-based scraping proxy. Best for simple page fetches without browser interaction.

Endpoint: POST https://api.brightdata.com/request

import requests

response = requests.post(
    "https://api.brightdata.com/request",
    headers={"Authorization": f"Bearer {API_KEY}"},
    json={
        "zone": "YOUR_ZONE_NAME",
        "url": "https://example.com/product/123",
        "format": "raw"
    }
)
html = response.text

Key Parameters

Parameter Type Description
zone string Zone name (required)
url string Target URL with http:// or https:// (required)
format string "raw" (HTML) or "json" (structured wrapper) (required)
method string HTTP verb, default "GET"
country string 2-letter ISO for geo-targeting (e.g., "us", "de")
data_format string Transform: "markdown" or "screenshot"
async boolean true for async mode

Quick Patterns

# Get markdown (best for LLM input)
response = requests.post(
    "https://api.brightdata.com/request",
    headers={"Authorization": f"Bearer {API_KEY}"},
    json={"zone": ZONE, "url": url, "format": "raw", "data_format": "markdown"}
)

# Geo-targeted request
json={"zone": ZONE, "url": url, "format": "raw", "country": "de"}

# Screenshot for debugging
json={"zone": ZONE, "url": url, "format": "raw", "data_format": "screenshot"}

# Async for bulk processing
json={"zone": ZONE, "url": url, "format": "raw", "async": True}

Critical rule: Never use Web Unlocker with Puppeteer, Playwright, Selenium, or anti-detect browsers. Use Browser API instead.

See references/web-unlocker.md for complete reference including proxy interface, special headers, async flow, features, and billing.


SERP API

Structured search engine result extraction for Google, Bing, Yandex, DuckDuckGo.

Endpoint: POST https://api.brightdata.com/request (same as Web Unlocker)

response = requests.post(
    "https://api.brightdata.com/request",
    headers={"Authorization": f"Bearer {API_KEY}"},
    json={
        "zone": "YOUR_SERP_ZONE",
        "url": "https://www.google.com/search?q=python+web+scraping&brd_json=1&gl=us&hl=en",
        "format": "raw"
    }
)
data = response.json()
for result in data.get("organic", []):
    print(result["rank"], result["title"], result["link"])

Essential Google URL Parameters

Parameter Description Example
q Search query q=python+web+scraping
brd_json Parsed JSON output brd_json=1 (always use for data pipelines)
gl Country for search gl=us
hl Language hl=en
start Pagination offset start=10 (page 2), start=20 (page 3)
tbm Search type tbm=nws (news), tbm=isch (images), tbm=vid (videos)
brd_mobile Device brd_mobile=1 (mobile), brd_mobile=ios
brd_browser Browser brd_browser=chrome
brd_ai_overview Trigger AI Overview brd_ai_overview=2
uule Encoded geo location for precise
FAQ

Which Bright Data APIs are covered?

The skill covers the Web Unlocker, SERP, Web Scraper and Browser APIs.

What do I need to set up?

You need a Bright Data API key and zone names, which are set as environment variables.

Does it help with choosing a tool?

Yes. A table in the skill matches each use case to the most suitable API.

Details

Original description by the author

Build production-ready Bright Data integrations with best practices baked in. Reference documentation for developers using coding assistants (Claude Code, Cursor, etc.) to implement web scraping, search, browser automation, and structured data extraction. Covers Web Unlocker API, SERP API, Web Scraper API, and Browser API (Scraping Browser).

repo: davila7/claude-code-templates

Popularity

GitHub stars
33k
Ranking position
#9095
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills