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がスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
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).
人気
- GitHubのスター
- 33k
- ランキング
- #9095
- ライセンス
- MIT
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
owasp-security
33kエージェントがWebアプリ、API、モバイル、コンテナ、AIエージェント向けの OWASP のセキュリティ指針を理解し、よくある弱点を見つけて修正案を出せるよう支援します。
agent-management
33kエージェントが、AI Maestro のコマンドラインを使って AI エージェントを作成、一覧表示、休止、再開、名前変更、削除できるよう支援します。各エージェントのライフサイクルを管理します。
agent-messaging
33kエージェントが、主に自分のマシン上で Agent Messaging Protocol を使い、AIエージェント同士の署名付きメッセージを送信、受信、返信できるよう支援します。
docs-search
33kエージェントが、自動生成されたコードのドキュメントから関数の署名、クラスの定義、コメントを検索できるよう支援します。コードを変更する前に、実際のAPIを確認できます。
似ているスキル
tavily
394kTavilyでウェブを検索し、特定のWebページから本文を取り出すようエージェントを支援します。深さ、ドメイン、日付のオプションも使えます。
blogwatcher
394kブログやRSS・Atomフィードを追跡し、新しい記事を確認して、読んだ記事に印を付けるようエージェントを支援します。
data-scraper-agent
280kエージェントが公開されているさまざまな情報源からデータを自動で収集できるよう支援します。スケジュール実行、情報の補強、結果の保存が可能です。オンラインデータの監視や追跡に役立ちます。