scrapingbee-cli 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. scrapingbee_cli-1.0.0/LICENSE +21 -0
  2. scrapingbee_cli-1.0.0/PKG-INFO +128 -0
  3. scrapingbee_cli-1.0.0/README.md +92 -0
  4. scrapingbee_cli-1.0.0/pyproject.toml +90 -0
  5. scrapingbee_cli-1.0.0/setup.cfg +4 -0
  6. scrapingbee_cli-1.0.0/src/scrapingbee_cli/__init__.py +3 -0
  7. scrapingbee_cli-1.0.0/src/scrapingbee_cli/batch.py +366 -0
  8. scrapingbee_cli-1.0.0/src/scrapingbee_cli/cli.py +152 -0
  9. scrapingbee_cli-1.0.0/src/scrapingbee_cli/cli_utils.py +223 -0
  10. scrapingbee_cli-1.0.0/src/scrapingbee_cli/client.py +612 -0
  11. scrapingbee_cli-1.0.0/src/scrapingbee_cli/commands/__init__.py +29 -0
  12. scrapingbee_cli-1.0.0/src/scrapingbee_cli/commands/amazon.py +295 -0
  13. scrapingbee_cli-1.0.0/src/scrapingbee_cli/commands/auth.py +94 -0
  14. scrapingbee_cli-1.0.0/src/scrapingbee_cli/commands/chatgpt.py +94 -0
  15. scrapingbee_cli-1.0.0/src/scrapingbee_cli/commands/crawl.py +446 -0
  16. scrapingbee_cli-1.0.0/src/scrapingbee_cli/commands/fast_search.py +109 -0
  17. scrapingbee_cli-1.0.0/src/scrapingbee_cli/commands/google.py +158 -0
  18. scrapingbee_cli-1.0.0/src/scrapingbee_cli/commands/scrape.py +504 -0
  19. scrapingbee_cli-1.0.0/src/scrapingbee_cli/commands/usage.py +37 -0
  20. scrapingbee_cli-1.0.0/src/scrapingbee_cli/commands/walmart.py +264 -0
  21. scrapingbee_cli-1.0.0/src/scrapingbee_cli/commands/youtube.py +248 -0
  22. scrapingbee_cli-1.0.0/src/scrapingbee_cli/config.py +124 -0
  23. scrapingbee_cli-1.0.0/src/scrapingbee_cli/crawl.py +430 -0
  24. scrapingbee_cli-1.0.0/src/scrapingbee_cli.egg-info/PKG-INFO +128 -0
  25. scrapingbee_cli-1.0.0/src/scrapingbee_cli.egg-info/SOURCES.txt +27 -0
  26. scrapingbee_cli-1.0.0/src/scrapingbee_cli.egg-info/dependency_links.txt +1 -0
  27. scrapingbee_cli-1.0.0/src/scrapingbee_cli.egg-info/entry_points.txt +2 -0
  28. scrapingbee_cli-1.0.0/src/scrapingbee_cli.egg-info/requires.txt +13 -0
  29. scrapingbee_cli-1.0.0/src/scrapingbee_cli.egg-info/top_level.txt +1 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ScrapingBee
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,128 @@
1
+ Metadata-Version: 2.4
2
+ Name: scrapingbee-cli
3
+ Version: 1.0.0
4
+ Summary: 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.
5
+ Author: ScrapingBee
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://www.scrapingbee.com/
8
+ Project-URL: Documentation, https://www.scrapingbee.com/documentation/
9
+ Project-URL: Repository, https://github.com/ScrapingBee/scrapingbee-cli
10
+ Keywords: scrapingbee,scraping,crawl,scrapy,batch,google-search,amazon,walmart,youtube,chatgpt,cli,api
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Internet :: WWW/HTTP
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: aiohttp>=3.9
24
+ Requires-Dist: click>=8.0
25
+ Requires-Dist: click-option-group>=0.5.6
26
+ Requires-Dist: scrapy>=2.11
27
+ Requires-Dist: scrapy-scrapingbee>=0.0.5
28
+ Provides-Extra: dev
29
+ Requires-Dist: pytest>=7; extra == "dev"
30
+ Requires-Dist: pytest-cov>=4; extra == "dev"
31
+ Requires-Dist: ruff>=0.8; extra == "dev"
32
+ Requires-Dist: ty>=0.0.17; extra == "dev"
33
+ Requires-Dist: build; extra == "dev"
34
+ Requires-Dist: twine; extra == "dev"
35
+ Dynamic: license-file
36
+
37
+ # ScrapingBee CLI
38
+
39
+ Command-line client for the [ScrapingBee](https://www.scrapingbee.com/) 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.
40
+
41
+ ## Requirements
42
+
43
+ - **Python 3.10+**
44
+
45
+ ## Installation
46
+
47
+ ```bash
48
+ pip install scrapingbee-cli
49
+ # or (isolated): pipx install scrapingbee-cli
50
+ ```
51
+
52
+ From source: clone the repo and run `pip install -e .` in the project root.
53
+
54
+ ## Configuration
55
+
56
+ You need a ScrapingBee API key:
57
+
58
+ 1. **`scrapingbee auth`** – Save the key to config (use `--api-key KEY` for non-interactive; `--show` to print config path).
59
+ 2. **Environment** – `export SCRAPINGBEE_API_KEY=your_key`
60
+ 3. **`.env` file** – In the current directory or `~/.config/scrapingbee-cli/.env`
61
+
62
+ Remove the stored key with `scrapingbee logout`. Get your API key from the [ScrapingBee dashboard](https://app.scrapingbee.com/).
63
+
64
+ ## Usage
65
+
66
+ ```bash
67
+ scrapingbee [command] [arguments] [options]
68
+ ```
69
+
70
+ - **`scrapingbee --help`** – List all commands.
71
+ - **`scrapingbee [command] --help`** – Options and parameters for that command.
72
+
73
+ **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](https://www.scrapingbee.com/documentation/).
74
+
75
+ ### Commands
76
+
77
+ | Command | Description |
78
+ |---------|-------------|
79
+ | `usage` | Check credits and max concurrency |
80
+ | `auth` / `logout` | Save or remove API key |
81
+ | `docs` | Print docs URL; `--open` to open in browser |
82
+ | `scrape [url]` | Scrape a URL (HTML, JS, screenshot, extract) |
83
+ | `crawl` | Crawl with Scrapy or from URL(s) |
84
+ | `google` / `fast-search` | Search SERP APIs |
85
+ | `amazon-product` / `amazon-search` | Amazon product and search |
86
+ | `walmart-search` / `walmart-product` | Walmart search and product |
87
+ | `youtube-search` / `youtube-metadata` | YouTube search and video metadata |
88
+ | `chatgpt` | ChatGPT API |
89
+
90
+ **Batch mode:** Commands that take a single input support `--input-file` (one line per input) and `--output-dir`. Run `scrapingbee usage` before large batches.
91
+
92
+ **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](https://www.scrapingbee.com/documentation/).
93
+
94
+ ### Examples
95
+
96
+ ```bash
97
+ scrapingbee usage
98
+ scrapingbee docs --open
99
+ scrapingbee --output-file page.html scrape "https://example.com"
100
+ scrapingbee --output-dir out --input-file urls.txt scrape
101
+ scrapingbee --output-file serp.json google "pizza new york"
102
+ ```
103
+
104
+ ## More information
105
+
106
+ - **[ScrapingBee API documentation](https://www.scrapingbee.com/documentation/)** – Parameters, response formats, credit costs, and best practices.
107
+ - **Claude / AI agents:** This repo includes a [Claude Skill](https://github.com/ScrapingBee/scrapingbee-cli/tree/main/skills/scrapingbee-cli) and [Claude Plugin](.claude-plugin/) for agent use with file-based output and security rules.
108
+
109
+ ## Testing
110
+
111
+ Pytest is configured in `pyproject.toml` (`[tool.pytest.ini_options]`). From the project root:
112
+
113
+ **1. Install the package with dev dependencies**
114
+
115
+ ```bash
116
+ pip install -e ".[dev]"
117
+ ```
118
+
119
+ **2. Run tests**
120
+
121
+ | Command | What runs |
122
+ |---------|------------|
123
+ | `pytest` | Full suite (integration tests require `SCRAPINGBEE_API_KEY`) |
124
+ | `pytest tests/unit` | Unit tests only (no API key needed) |
125
+ | `pytest -m "not integration"` | All except integration (no API key needed) |
126
+ | `pytest -v` | Same as above with verbose output (default in config) |
127
+
128
+ Integration tests call the live ScrapingBee API and are marked with `@pytest.mark.integration`.
@@ -0,0 +1,92 @@
1
+ # ScrapingBee CLI
2
+
3
+ Command-line client for the [ScrapingBee](https://www.scrapingbee.com/) 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.
4
+
5
+ ## Requirements
6
+
7
+ - **Python 3.10+**
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ pip install scrapingbee-cli
13
+ # or (isolated): pipx install scrapingbee-cli
14
+ ```
15
+
16
+ From source: clone the repo and run `pip install -e .` in the project root.
17
+
18
+ ## Configuration
19
+
20
+ You need a ScrapingBee API key:
21
+
22
+ 1. **`scrapingbee auth`** – Save the key to config (use `--api-key KEY` for non-interactive; `--show` to print config path).
23
+ 2. **Environment** – `export SCRAPINGBEE_API_KEY=your_key`
24
+ 3. **`.env` file** – In the current directory or `~/.config/scrapingbee-cli/.env`
25
+
26
+ Remove the stored key with `scrapingbee logout`. Get your API key from the [ScrapingBee dashboard](https://app.scrapingbee.com/).
27
+
28
+ ## Usage
29
+
30
+ ```bash
31
+ scrapingbee [command] [arguments] [options]
32
+ ```
33
+
34
+ - **`scrapingbee --help`** – List all commands.
35
+ - **`scrapingbee [command] --help`** – Options and parameters for that command.
36
+
37
+ **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](https://www.scrapingbee.com/documentation/).
38
+
39
+ ### Commands
40
+
41
+ | Command | Description |
42
+ |---------|-------------|
43
+ | `usage` | Check credits and max concurrency |
44
+ | `auth` / `logout` | Save or remove API key |
45
+ | `docs` | Print docs URL; `--open` to open in browser |
46
+ | `scrape [url]` | Scrape a URL (HTML, JS, screenshot, extract) |
47
+ | `crawl` | Crawl with Scrapy or from URL(s) |
48
+ | `google` / `fast-search` | Search SERP APIs |
49
+ | `amazon-product` / `amazon-search` | Amazon product and search |
50
+ | `walmart-search` / `walmart-product` | Walmart search and product |
51
+ | `youtube-search` / `youtube-metadata` | YouTube search and video metadata |
52
+ | `chatgpt` | ChatGPT API |
53
+
54
+ **Batch mode:** Commands that take a single input support `--input-file` (one line per input) and `--output-dir`. Run `scrapingbee usage` before large batches.
55
+
56
+ **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](https://www.scrapingbee.com/documentation/).
57
+
58
+ ### Examples
59
+
60
+ ```bash
61
+ scrapingbee usage
62
+ scrapingbee docs --open
63
+ scrapingbee --output-file page.html scrape "https://example.com"
64
+ scrapingbee --output-dir out --input-file urls.txt scrape
65
+ scrapingbee --output-file serp.json google "pizza new york"
66
+ ```
67
+
68
+ ## More information
69
+
70
+ - **[ScrapingBee API documentation](https://www.scrapingbee.com/documentation/)** – Parameters, response formats, credit costs, and best practices.
71
+ - **Claude / AI agents:** This repo includes a [Claude Skill](https://github.com/ScrapingBee/scrapingbee-cli/tree/main/skills/scrapingbee-cli) and [Claude Plugin](.claude-plugin/) for agent use with file-based output and security rules.
72
+
73
+ ## Testing
74
+
75
+ Pytest is configured in `pyproject.toml` (`[tool.pytest.ini_options]`). From the project root:
76
+
77
+ **1. Install the package with dev dependencies**
78
+
79
+ ```bash
80
+ pip install -e ".[dev]"
81
+ ```
82
+
83
+ **2. Run tests**
84
+
85
+ | Command | What runs |
86
+ |---------|------------|
87
+ | `pytest` | Full suite (integration tests require `SCRAPINGBEE_API_KEY`) |
88
+ | `pytest tests/unit` | Unit tests only (no API key needed) |
89
+ | `pytest -m "not integration"` | All except integration (no API key needed) |
90
+ | `pytest -v` | Same as above with verbose output (default in config) |
91
+
92
+ Integration tests call the live ScrapingBee API and are marked with `@pytest.mark.integration`.
@@ -0,0 +1,90 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "scrapingbee-cli"
7
+ version = "1.0.0"
8
+ description = "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."
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ requires-python = ">=3.10"
12
+ authors = [{ name = "ScrapingBee" }]
13
+ keywords = [
14
+ "scrapingbee",
15
+ "scraping",
16
+ "crawl",
17
+ "scrapy",
18
+ "batch",
19
+ "google-search",
20
+ "amazon",
21
+ "walmart",
22
+ "youtube",
23
+ "chatgpt",
24
+ "cli",
25
+ "api",
26
+ ]
27
+ classifiers = [
28
+ "Development Status :: 4 - Beta",
29
+ "Environment :: Console",
30
+ "Intended Audience :: Developers",
31
+ "Programming Language :: Python :: 3",
32
+ "Programming Language :: Python :: 3.10",
33
+ "Programming Language :: Python :: 3.11",
34
+ "Programming Language :: Python :: 3.12",
35
+ "Programming Language :: Python :: 3.13",
36
+ "Topic :: Internet :: WWW/HTTP",
37
+ ]
38
+ dependencies = [
39
+ "aiohttp>=3.9",
40
+ "click>=8.0",
41
+ "click-option-group>=0.5.6",
42
+ "scrapy>=2.11",
43
+ "scrapy-scrapingbee>=0.0.5",
44
+ ]
45
+
46
+ [project.urls]
47
+ Homepage = "https://www.scrapingbee.com/"
48
+ Documentation = "https://www.scrapingbee.com/documentation/"
49
+ Repository = "https://github.com/ScrapingBee/scrapingbee-cli"
50
+
51
+ [project.optional-dependencies]
52
+ dev = [
53
+ "pytest>=7",
54
+ "pytest-cov>=4",
55
+ "ruff>=0.8",
56
+ "ty>=0.0.17",
57
+ "build",
58
+ "twine",
59
+ ]
60
+
61
+ [project.scripts]
62
+ scrapingbee = "scrapingbee_cli.cli:main"
63
+
64
+ [tool.setuptools.packages.find]
65
+ where = ["src"]
66
+
67
+ [tool.ruff]
68
+ target-version = "py310"
69
+ line-length = 100
70
+ src = ["src", "tests"]
71
+
72
+ [tool.ruff.lint]
73
+ select = ["E", "F", "I", "N", "W", "UP"]
74
+
75
+ [tool.ruff.format]
76
+ quote-style = "double"
77
+
78
+ [tool.ty]
79
+ [tool.ty.environment]
80
+ python-version = "3.10"
81
+ [tool.ty.src]
82
+ include = ["src", "tests"]
83
+
84
+ [tool.pytest.ini_options]
85
+ testpaths = ["tests"]
86
+ pythonpath = ["src"]
87
+ markers = [
88
+ "integration: marks tests that call the live API (deselect with '-m \"not integration\"')",
89
+ ]
90
+ addopts = "-v --tb=short"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ """ScrapingBee CLI - Command-line client for the ScrapingBee API."""
2
+
3
+ __version__ = "1.0.0"