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.0.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.0-py3-none-any.whl (45.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scrapingbee_cli-1.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 d2657c2fd361211d0d53271ad08441ee311637a356da9683f359afc3100e531e
MD5 415d03f817c4a272e6ac32b1d3f608b9
BLAKE2b-256 caadfc616131726538e0d44c928badff56533ecb04dff6c22f8de9c836ea3bb3

See more details on using hashes here.

Provenance

The following attestation bundles were made for scrapingbee_cli-1.0.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for scrapingbee_cli-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 daf396b6743889e3f0db027b9cf00888d7cf286c92f6dde97d9784c2ce546a85
MD5 ec021792900d2ba37c35002a6729dca8
BLAKE2b-256 9b87c45e4c3396257a0c72135bd290597081ef24460f8b13ef634f24ef9ea016

See more details on using hashes here.

Provenance

The following attestation bundles were made for scrapingbee_cli-1.0.0-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