Skip to main content

Command-line client for the ScrapingBee API: scrape pages (single or batch), crawl sites, check usage/credits, and use Google Search, Fast Search, Amazon, Walmart, YouTube, and ChatGPT from the terminal.

Project description

ScrapingBee CLI

Command-line client for the ScrapingBee API: scrape URLs (single or batch), crawl sites, check usage and credits, and use Google, Fast Search, Amazon, Walmart, YouTube, and ChatGPT from the terminal.

Requirements

  • Python 3.10+

Installation

pip install scrapingbee-cli
# or (isolated): pipx install scrapingbee-cli

From source: clone the repo and run pip install -e . in the project root.

Configuration

You need a ScrapingBee API key:

  1. scrapingbee auth – Save the key to config (use --api-key KEY for non-interactive; --show to print config path).
  2. Environmentexport SCRAPINGBEE_API_KEY=your_key
  3. .env file – In the current directory or ~/.config/scrapingbee-cli/.env

Remove the stored key with scrapingbee logout. Get your API key from the ScrapingBee dashboard.

Usage

scrapingbee [command] [arguments] [options]
  • scrapingbee --help – List all commands.
  • scrapingbee [command] --help – Options and parameters for that command.

Global flags (must appear before the subcommand): --output-file, --verbose, --output-dir, --input-file, --concurrency, --retries, --backoff. For details, run scrapingbee --help or see the documentation.

Commands

Command Description
usage Check credits and max concurrency
auth / logout Save or remove API key
docs Print docs URL; --open to open in browser
scrape [url] Scrape a URL (HTML, JS, screenshot, extract)
crawl Crawl with Scrapy or from URL(s)
google / fast-search Search SERP APIs
amazon-product / amazon-search Amazon product and search
walmart-search / walmart-product Walmart search and product
youtube-search / youtube-metadata YouTube search and video metadata
chatgpt ChatGPT API

Batch mode: Commands that take a single input support --input-file (one line per input) and --output-dir. Run scrapingbee usage before large batches.

Parameters and options: Use space-separated values (e.g. --render-js false), not --option=value. For full parameter lists, response formats, and credit costs, see scrapingbee [command] --help and the ScrapingBee API documentation.

Examples

scrapingbee usage
scrapingbee docs --open
scrapingbee --output-file page.html scrape "https://example.com"
scrapingbee --output-dir out --input-file urls.txt scrape
scrapingbee --output-file serp.json google "pizza new york"

More information

Testing

Pytest is configured in pyproject.toml ([tool.pytest.ini_options]). From the project root:

1. Install the package with dev dependencies

pip install -e ".[dev]"

2. Run tests

Command What runs
pytest Full suite (integration tests require SCRAPINGBEE_API_KEY)
pytest tests/unit Unit tests only (no API key needed)
pytest -m "not integration" All except integration (no API key needed)
pytest -v Same as above with verbose output (default in config)

Integration tests call the live ScrapingBee API and are marked with @pytest.mark.integration.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scrapingbee_cli-1.0.1.tar.gz (34.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scrapingbee_cli-1.0.1-py3-none-any.whl (45.8 kB view details)

Uploaded Python 3

File details

Details for the file scrapingbee_cli-1.0.1.tar.gz.

File metadata

  • Download URL: scrapingbee_cli-1.0.1.tar.gz
  • Upload date:
  • Size: 34.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for scrapingbee_cli-1.0.1.tar.gz
Algorithm Hash digest
SHA256 3a721dd31d20fc3567d802252123daf2e524f164ebdf4ac03699ab0cbe33d163
MD5 03951cd40971733ff7abd653d4e55a18
BLAKE2b-256 aa7e7e62abe28727a0d813ca1d54699e6c0eab620ef1282a6713d521cfbdef4b

See more details on using hashes here.

Provenance

The following attestation bundles were made for scrapingbee_cli-1.0.1.tar.gz:

Publisher: publish.yml on ScrapingBee/scrapingbee-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scrapingbee_cli-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for scrapingbee_cli-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4c401bc970d36c1dc5e85619dcce3fc7416124d32d1b894ab99ef55847b6df4d
MD5 136eccb71ca4885425abdf746245adea
BLAKE2b-256 2ce6a725b8b868ae4da99f5e05038572196f3757ddace88bc391ace1b46d610b

See more details on using hashes here.

Provenance

The following attestation bundles were made for scrapingbee_cli-1.0.1-py3-none-any.whl:

Publisher: publish.yml on ScrapingBee/scrapingbee-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page