Skip to content

brightdata-cli

brightdata1.9K installs

Guide for using the Bright Data CLI (`brightdata` / `bdata`) to scrape websites, search the web, extract structured data from 40+ platforms, manage proxy zones, and check account budget. Use this skill whenever the user wants to scrape a URL, search Google/Bing/Yandex, extract data from Amazon/LinkedIn/Instagram/TikTok/YouTube/Reddit or any other platform, check their Bright Data balance or zones, or do anything involving web data collection from the terminal. Also trigger when the user...

Install

npx skills add https://github.com/brightdata/skills --skill brightdata-cli
SKILL.md

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 | bash

Windows 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 automatic
bdata login

This single command:

  1. Opens the browser for secure OAuth authentication
  2. Saves the API key locally (never needs to be entered again)
  3. Auto-creates required proxy zones (cli_unlocker, cli_browser)
  4. 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 pipelines workflow: find a scraper, read its input fields, run it.

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 search <query> Find a pre-built scraper for a site or data type
bdata pipelines info <id> [method] Show a scraper's methods and input fields
bdata pipelines run <id> <method> ... Run a scraper and get structured records
bdata pipelines status <snapshot_id> Check a run's progress
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 markdown
bdata scrape https://example.com

# Get raw HTML
bdata scrape https://example.com -f html

# Get structured JSON
bdata scrape https://example.com -f json

# Take a screenshot
bdata scrape https://example.com -f screenshot -o page.png

# Geo-targeted scrape from the US
bdata scrape https://amazon.com --country us

# Save to file
bdata scrape https://example.com -o page.md

# Async mode for heavy pages
bdata 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 table
bdata search "web scraping best practices"

# Get raw JSON for piping
bdata search "typescript tutorials" --json

# Search Bing
bdata search "bright data pricing" --engine bing

# Localized search
bdata search "restaurants berlin" --country de --language de

# News search
bdata search "AI regulation" --type news

# Extract just URLs
bdata search "open source tools" --json | jq -r '.organic[].link'

Pipelines (Structured Data Extraction)

Run any of thousands of pre-built scrapers. Always look the scraper up first; never guess a dataset_id or field names:

# 1. Find a scraper
bdata pipelines search <site or data type>

# 2. Its methods, then one method's input fields and a ready-to-run command
bdata pipelines info <dataset_id>
bdata pipelines info <dataset_id> <method>

# 3. Run it: URLs as arguments, other input fields as --<field> flags
bdata pipelines run <dataset_id> collect_by_url "<url>"
bdata pipelines run <dataset_id> <discover_method> --<field> <value> --limit-per-input 5

# Output as CSV
bdata pipelines run <dataset_id> <method> "<url>" --format csv -o out.csv

Every record is billed: start with one input. Unknown or missing required fields fail before the run starts.

Checking Status

For long runs started with --async:

bdata pipelines status <snapshot_id>
bdata pipelines status <snapshot_id> --wait --timeout 300
bdata pipelines results <snapshot_id>

Budget & Zones

# Quick account balance
bdata budget

# Detailed balance with pending charges
bdata budget balance

# All zones cost/bandwidth
bdata budget zones

# Specific zone costs
bdata budget zone my_zone

# Date range filter
bdata budget zones --from 2024-01-01T00:00:00 --to 2024-02-01T00:00:00

# List all zones
bdata zones

# Zone details
bdata zones info cli_unlocker

Configuration

# View all config
bdata config

# Set defaults
bdata config set default_zone_unlocker my_zone
bdata config set default_format json

Installing AI Agent Skills

# Interactive picker — choose skills and target agents
bdata skill add

# Install a specific skill
bdata skill add scrape

# List available skills
bdata 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 it
bdata search "top open source projects" --json \
  | jq -r '.organic[0].link' \
  | xargs bdata scrape

# Scrape and view with markdown reader
bdata scrape https://docs.github.com | glow -

# Scraper records to CSV
bdata pipelines run <dataset_id> collect_by_url "<url>" --format csv > out.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_unlocker and cli_browser zones 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 + pipelines status --wait.
  • npm package: @brightdata/cli — install globally or use via npx.

Related skills

scrapebrightdata11KScrape web content as clean markdown/HTML/JSON via the Bright Data CLI (`bdata scrape`). Use when the user wants to fetch a page, extract content from a list of URLs, or crawl paginated listings. Hands off to `data-feeds` for supported platforms (Amazon, LinkedIn, TikTok, Instagram, YouTube, Reddit, etc.) and to `search` when URLs must be discovered first. Requires the Bright Data CLI; proactively guides install + login if missing.searchbrightdata7.4KSearch the web via the Bright Data CLI — `bdata search` for Google/Bing/Yandex SERP, `bdata discover` for intent-ranked semantic results. Use when the user wants SERP results, needs URLs to feed into scraping, or wants semantic web discovery with optional page content. Hands off to `scrape` once target URLs are chosen, and to `data-feeds` when the user wants structured data from a known platform. Requires the Bright Data CLI; proactively guides install + login if missing.seo-auditbrightdata1.8KWhen the user wants to audit, review, or diagnose SEO issues on their site. Uses live web data via the Bright Data CLI for accurate detection of JS-injected schema, hreflang, canonicals, and live SERP-based ranking checks. Also use when the user mentions "SEO audit," "technical SEO," "why am I not ranking," "SEO issues," "on-page SEO," "meta tags review," "SEO health check," "my traffic dropped," "lost rankings," "not showing up in Google," "site isn't ranking," "Google update hit me," "page spebright-data-best-practicesbrightdata1.7KBuild 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).

← All skills

Search skills and MCP servers

Search across 31,816 skills and MCPs