brightdata-cli
brightdata/skills
Guide d'utilisation de l'interface CLI de Bright Data (`brightdata` / `bdata`) pour effectuer du scraping de sites web, effectuer des recherches sur Internet, extraire des données structurées de plus de 40 plateformes, gérer des zones de proxy et vérifier le solde de son compte. Utilisez cette compétence chaque fois que l'utilisateur souhaite extraire le contenu d'une URL, effectuer une recherche sur Google/Bing/Yandex, extraire des données d'Amazon/LinkedIn/Instagram/TikTok/YouTube/Reddit ou de toute autre plateforme, vérifier son solde Bright Data ou ses zones, ou effectuer toute autre opération impliquant la collecte de données Web depuis le terminal. Déclenchez-la également lorsque l'utilisateur mentionne
...Développer toutÀ propos brightdata-cli
La CLI Bright Data est un outil en ligne de commande qui offre un accès direct depuis un terminal à la plateforme de données Web de Bright Data. Elle simplifie considérablement le scraping Web en gérant automatiquement l’authentification, la gestion des proxys, le contournement des mesures anti-bot, la résolution des CAPTCHA et le rendu JavaScript. Il suffit aux utilisateurs de se connecter une seule fois via OAuth pour que la CLI gère de manière transparente toutes les opérations suivantes, sans configuration manuelle ni gestion de clés API.
Cette fonctionnalité permet d’extraire les données de n’importe quelle URL dans plusieurs formats (Markdown, HTML, JSON, capture d’écran), d’effectuer des recherches sur Google, Bing et Yandex avec des résultats structurés, et d’extraire des données de plus de 40 plateformes, notamment Amazon, LinkedIn, Instagram, TikTok, YouTube et Reddit. L’interface en ligne de commande prend en charge les opérations synchrones et asynchrones, le scraping géolocalisé depuis des pays spécifiques, et offre des fonctionnalités de gestion de compte telles que la vérification du budget et la configuration de la zone de proxy. Toutes les opérations s’effectuent à l’aide de commandes simples telles que « bdata scrape » ou « bdata search ».
Cet outil est conçu pour les développeurs, les analystes de données et les chercheurs qui ont besoin d’une collecte fiable de données Web sans surcoût lié à l’infrastructure. Qu'il s'agisse de recueillir des informations sur la concurrence, de surveiller du contenu, d’effectuer des analyses SEO ou de collecter des données d’entraînement, l’interface CLI de Bright Data gère les complexités techniques tout en offrant une interface de commande intuitive. Elle fonctionne sous macOS, Linux et Windows, ne nécessite que Node.js 20+ et peut même s’exécuter sans installation via npx pour des tâches ponctuelles.
FAQ
Comment s'authentifier avec la CLI Bright Data ?
Exécutez une seule fois la commande « bdata login » pour vous authentifier via OAuth dans votre navigateur. Cela permet d'enregistrer vos identifiants localement et de configurer automatiquement les zones de proxy requises. Pour les environnements sans interface graphique, utilisez « bdata login --device » ou « bdata login --api-key
De quelles plateformes puis-je extraire des données ?
L'interface CLI prend en charge l'extraction de données structurées à partir de plus de 40 plateformes via des pipelines, notamment Amazon, LinkedIn, Instagram, TikTok, YouTube, Reddit et bien d'autres. Utilisez la commande « bdata pipelines list » pour afficher tous les types de plateformes disponibles.
Quels formats de sortie sont pris en charge pour le scraping ?
Le scraping prend en charge plusieurs formats : Markdown (par défaut), HTML, JSON pour les données structurées et les captures d’écran. Spécifiez le format à l’aide de l’option -f, par exemple « bdata scrape
Dois-je gérer moi-même les proxys ou les CAPTCHA ?
Non. L’interface en ligne de commande (CLI) gère automatiquement les proxys, le contournement des systèmes anti-bot, la résolution des CAPTCHA et le rendu JavaScript. Une fois la commande initiale « bdata login » exécutée, toute la complexité technique est masquée.
Puis-je effectuer un scraping à partir d’emplacements géographiques spécifiques ?
Oui. Utilisez l’option --country pour spécifier un scraping géolocalisé, par exemple « bdata scrape https://amazon.com --country us » pour effectuer le scraping à partir d’une adresse IP américaine.
Bright Data CLI
The Bright Data CLI (brightdata or bdata) gives you full access to Bright Data's web data platform from the terminal. It handles authentication, proxy zones, anti-bot bypass, CAPTCHA solving, and JavaScript rendering automatically — the user just needs to log in once.
Installation
If the CLI is not installed yet, guide the user:
macOS / Linux:
curl -fsSL https://cli.brightdata.com/install.sh | bashWindows or manual install (any platform):
npm install -g @brightdata/cli
Without installing (one-off usage):
npx --yes --package @brightdata/cli brightdata <command>
Requires Node.js >= 20. After install, both brightdata and bdata (shorthand) are available.
First-Time Setup
Before anything else, check if the user is authenticated. If they haven't logged in yet, guide them through the one-time setup:
# One-time login — opens the browser for OAuth, then everything is automaticbdata loginThis single command:
- Opens the browser for secure OAuth authentication
- Saves the API key locally (never needs to be entered again)
- Auto-creates required proxy zones (
cli_unlocker,cli_browser) - Sets default configuration
After login, every subsequent command works without any manual intervention.
For headless/SSH environments where no browser is available:
bdata login --device
For direct API key authentication (non-interactive):
bdata login --api-key <key>
To verify setup is complete, run:
bdata config
Command Reference
Read references/commands.md for the full command reference with all flags, options, and examples for every command.
Read references/pipelines.md for the complete list of 40+ pipeline types (Amazon, LinkedIn, Instagram, TikTok, YouTube, Reddit, and more) with their specific parameters.
Quick Command Overview
bdata is the shorthand for brightdata. Both work identically.
| Command | Purpose |
|---|---|
bdata scrape <url> | Scrape any URL as markdown, HTML, JSON, or screenshot |
bdata search "<query>" | Search Google/Bing/Yandex with structured results |
bdata pipelines <type> [params] | Extract structured data from 40+ platforms |
bdata pipelines list | List all 40+ available pipeline types |
bdata status <job-id> | Check async job status |
bdata zones | List proxy zones |
bdata budget | View account balance and costs |
bdata skill add | Install AI agent skills |
bdata skill list | List available skills |
bdata config | View/set configuration |
bdata login | Authenticate with Bright Data |
bdata version | Show CLI version and system info |
How to Use Each Command
Scraping
Scrape any URL with automatic bot bypass, CAPTCHA handling, and JS rendering:
# Default: returns clean markdownbdata scrape https://example.com# Get raw HTMLbdata scrape https://example.com -f html# Get structured JSONbdata scrape https://example.com -f json# Take a screenshotbdata scrape https://example.com -f screenshot -o page.png# Geo-targeted scrape from the USbdata scrape https://amazon.com --country us# Save to filebdata scrape https://example.com -o page.md# Async mode for heavy pagesbdata scrape https://example.com --async
Searching
Search engines with structured JSON output (Google returns parsed organic results, ads, People Also Ask, and related searches):
# Google search with formatted tablebdata search "web scraping best practices"# Get raw JSON for pipingbdata search "typescript tutorials" --json# Search Bingbdata search "bright data pricing" --engine bing# Localized searchbdata search "restaurants berlin" --country de --language de# News searchbdata search "AI regulation" --type news# Extract just URLsbdata search "open source tools" --json | jq -r '.organic[].link'
Pipelines (Structured Data Extraction)
Extract structured data from 40+ platforms. These trigger async jobs that poll until results are ready:
# LinkedIn profilebdata pipelines linkedin_person_profile "https://linkedin.com/in/username"# Amazon productbdata pipelines amazon_product "https://amazon.com/dp/B09V3KXJPB"# Instagram profilebdata pipelines instagram_profiles "https://instagram.com/username"# Amazon searchbdata pipelines amazon_product_search "laptop" "https://amazon.com"# YouTube comments (top 50)bdata pipelines youtube_comments "https://youtube.com/watch?v=..." 50# Google Maps reviews (last 7 days)bdata pipelines google_maps_reviews "https://maps.google.com/..." 7# Output as CSVbdata pipelines amazon_product "https://amazon.com/dp/..." --format csv -o product.csv# List all available pipeline typesbdata pipelines list
Checking Status
For async jobs (from --async scrapes or pipelines):
# Quick status checkbdata status <job-id># Wait until completebdata status <job-id> --wait# With custom timeoutbdata status <job-id> --wait --timeout 300
Budget & Zones
# Quick account balancebdata budget# Detailed balance with pending chargesbdata budget balance# All zones cost/bandwidthbdata budget zones# Specific zone costsbdata budget zone my_zone# Date range filterbdata budget zones --from 2024-01-01T00:00:00 --to 2024-02-01T00:00:00# List all zonesbdata zones# Zone detailsbdata zones info cli_unlocker
Configuration
# View all configbdata config# Set defaultsbdata config set default_zone_unlocker my_zonebdata config set default_format json
Installing AI Agent Skills
# Interactive picker — choose skills and target agentsbdata skill add# Install a specific skillbdata skill add scrape# List available skillsbdata skill list
Output Modes
Every command supports multiple output formats:
| Flag | Effect |
|---|---|
| (none) | Human-readable formatted output with colors |
--json | Compact JSON to stdout |
--pretty | Indented JSON to stdout |
-o <path> | Write to file (format auto-detected from extension) |
When piped (stdout is not a TTY), colors and spinners are automatically disabled.
Chaining Commands
The CLI is pipe-friendly:
# Search → extract first URL → scrape itbdata search "top open source projects" --json \ | jq -r '.organic[0].link' \ | xargs bdata scrape# Scrape and view with markdown readerbdata scrape https://docs.github.com | glow -# Amazon product data to CSVbdata pipelines amazon_product "https://amazon.com/dp/xxx" --format csv > product.csv
Environment Variables
These override stored configuration:
| Variable | Purpose |
|---|---|
BRIGHTDATA_API_KEY | API key (skips login entirely) |
BRIGHTDATA_UNLOCKER_ZONE | Default Web Unlocker zone |
BRIGHTDATA_SERP_ZONE | Default SERP zone |
BRIGHTDATA_POLLING_TIMEOUT | Polling timeout in seconds |
Troubleshooting
| Error | Fix |
|---|---|
| CLI not found | Install with npm i -g @brightdata/cli or curl -fsSL https://cli.brightdata.com/install.sh | bash |
| "No Web Unlocker zone specified" | bdata config set default_zone_unlocker <zone> or re-run bdata login |
| "Invalid or expired API key" | bdata login |
| "Access denied" | Check zone permissions in the Bright Data control panel |
| "Rate limit exceeded" | Wait and retry, or use --async for large jobs |
| Async job timeout | Increase with --timeout 1200 or BRIGHTDATA_POLLING_TIMEOUT=1200 |
Key Design Principles
- One-time auth: After
bdata login, everything is automatic. No tokens to manage, no keys to pass. - Zones auto-created: Login creates
cli_unlockerandcli_browserzones automatically. - Smart defaults: Markdown output, auto-detected formats from file extensions, colors only in TTY.
- Pipe-friendly: JSON output + jq for automation. Colors/spinners disabled in pipes.
- Async support: Heavy jobs can run in background with
--async+status --wait. - npm package:
@brightdata/cli— install globally or use vianpx.
Tous les fichiers
3 fichiersInstaller brightdata-cli
Téléchargez et décompressez les fichiers de compétences dans votre répertoire .claude/skills/.
Télécharger le ZIPClonez le dépôt et copiez les fichiers de compétence dans votre projet.
git clone https://github.com/brightdata/skills/blob/main/skills/brightdata-cli/SKILL.md # Copy SKILL.md to your .claude/skills/ directory
Copier





Maison
