本文へスキップ
Skillpedia
Webスクレイピング33k · #9095

bright-data-best-practices

できること

このスキルは、Bright DataのWebデータAPIについての参考ガイドをAIに与えます。スクレイピング、検索、ブラウザ自動化の機能を作る開発者向けです。

使う場面

  • ✓多くのWebページから信頼性高くコンテンツを取得する機能を作っているとき。
  • ✓GoogleやBing、Yandexの検索結果を、構造化データとして取得したいとき。
  • ✓ブラウザAPIを使って、Webサイトのクリック、スクロール、フォーム操作を自動化したいとき。

スキルのリンク

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

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/web-data/bright-data-best-practices/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“Googleの検索結果をアプリに取り込むには、どのBright Data APIを使うべきですか?”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、あなたの用途に合ったBright Data APIを選び、そのための認証とコードの設定を手伝います。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)を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
よくある質問

どのBright Data APIが対象ですか?

Web Unlocker、SERP、Web Scraper、Browser APIを扱います。

設定に何が必要ですか?

Bright DataのAPIキーとゾーン名が必要で、それらは環境変数として設定します。

ツールの選択を手伝いますか?

はい。スキル内の表が、それぞれの用途に最も適したAPIを示しています。

詳細

作者による元の説明

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

人気

GitHubのスター
33k
ランキング
#9095
ライセンス
MIT
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル