scrapebadger-cli 0.31.1__tar.gz → 0.35.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 (87) hide show
  1. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/.gitignore +18 -0
  2. scrapebadger_cli-0.35.0/CHANGELOG.md +50 -0
  3. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/PKG-INFO +30 -11
  4. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/README.md +29 -10
  5. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/pyproject.toml +1 -1
  6. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/client.py +3 -1
  7. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/agent.py +2 -30
  8. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/amazon.py +10 -0
  9. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/auth.py +11 -5
  10. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/google.py +83 -9
  11. scrapebadger_cli-0.35.0/src/scrapebadger_cli/commands/grok.py +67 -0
  12. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/linkedin.py +12 -0
  13. scrapebadger_cli-0.35.0/src/scrapebadger_cli/commands/meta_ai.py +35 -0
  14. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/onboarding.py +1 -1
  15. scrapebadger_cli-0.35.0/src/scrapebadger_cli/commands/rufus.py +30 -0
  16. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/stream.py +0 -12
  17. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/wallapop.py +22 -4
  18. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/main.py +6 -1
  19. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/results.py +0 -2
  20. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/tests/test_agent_features.py +24 -2
  21. scrapebadger_cli-0.35.0/tests/test_google_resolve.py +94 -0
  22. scrapebadger_cli-0.35.0/tests/test_grok_commands.py +59 -0
  23. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/uv.lock +1 -1
  24. scrapebadger_cli-0.31.1/CHANGELOG.md +0 -12
  25. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/__init__.py +0 -0
  26. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/availability.py +0 -0
  27. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/__init__.py +0 -0
  28. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/airbnb.py +0 -0
  29. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/aliexpress.py +0 -0
  30. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/apartments.py +0 -0
  31. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/app_store.py +0 -0
  32. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/asos.py +0 -0
  33. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/autoscout24.py +0 -0
  34. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/baidu.py +0 -0
  35. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/bestbuy.py +0 -0
  36. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/bing.py +0 -0
  37. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/booking.py +0 -0
  38. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/brave.py +0 -0
  39. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/chatgpt.py +0 -0
  40. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/copilot.py +0 -0
  41. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/depop.py +0 -0
  42. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/duckduckgo.py +0 -0
  43. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/ebay.py +0 -0
  44. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/etsy.py +0 -0
  45. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/facebook.py +0 -0
  46. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/gemini.py +0 -0
  47. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/github.py +0 -0
  48. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/google_play.py +0 -0
  49. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/gumtree.py +0 -0
  50. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/idealista.py +0 -0
  51. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/immobiliare.py +0 -0
  52. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/init.py +0 -0
  53. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/instagram.py +0 -0
  54. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/leboncoin.py +0 -0
  55. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/loopnet.py +0 -0
  56. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/naver.py +0 -0
  57. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/perplexity.py +0 -0
  58. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/realtor.py +0 -0
  59. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/reddit.py +0 -0
  60. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/redfin.py +0 -0
  61. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/target.py +0 -0
  62. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/tiktok.py +0 -0
  63. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/twitter.py +0 -0
  64. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/vinted.py +0 -0
  65. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/walmart.py +0 -0
  66. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/web.py +0 -0
  67. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/yahoo.py +0 -0
  68. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/yandex.py +0 -0
  69. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/yelp.py +0 -0
  70. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/youtube.py +0 -0
  71. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/commands/zillow.py +0 -0
  72. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/config.py +0 -0
  73. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/output.py +0 -0
  74. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/src/scrapebadger_cli/views.py +0 -0
  75. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/tests/conftest.py +0 -0
  76. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/tests/test_autoscout24_commands.py +0 -0
  77. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/tests/test_brave.py +0 -0
  78. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/tests/test_cli_availability.py +0 -0
  79. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/tests/test_copilot_commands.py +0 -0
  80. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/tests/test_github.py +0 -0
  81. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/tests/test_google_light_search.py +0 -0
  82. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/tests/test_marketplace_monitor.py +0 -0
  83. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/tests/test_naver.py +0 -0
  84. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/tests/test_perplexity_strict_country.py +0 -0
  85. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/tests/test_tiktok_pagination.py +0 -0
  86. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/tests/test_vinted_image_search.py +0 -0
  87. {scrapebadger_cli-0.31.1 → scrapebadger_cli-0.35.0}/tests/test_yelp_commands.py +0 -0
@@ -194,3 +194,21 @@ apps/portal/public/uploads/support/*
194
194
 
195
195
  # Instagram account pool seed (purchased credentials — never commit)
196
196
  scrapers/instagram/.secrets/
197
+
198
+ # Account and proxy credential files (SCR-710): never commit them. accountd imports vendor files
199
+ # (POST /v1/files, sb-accounts import) and keeps them sealed; local copies stay untracked.
200
+ # Templates (*.example) and synthetic test fixtures (testdata/) stay tracked; the commit gate
201
+ # (tools/agent/secretscan --staged, account rules) checks those for real-looking values.
202
+ accounts*.txt
203
+ *accounts*.csv
204
+ *accounts*.xlsx
205
+ proxies.txt
206
+ *-vendor-accounts-*
207
+ !*.example
208
+ !**/testdata/**
209
+
210
+ # Agent kit (tools/agent): per-machine settings, launcher-written Kimi MCP file, local investigations
211
+ tools/agent/local.json
212
+ .kimi-code/
213
+ .investigations/
214
+ tools/agent/evals/out/
@@ -0,0 +1,50 @@
1
+ # Changelog
2
+
3
+ ## 0.35.0 — 2026-11-29
4
+
5
+ - Breaking: ScrapeBadger replaced rate tiers and per-minute rate limits with a per-account
6
+ max concurrency (SCR-736): how many requests an account can run at the same time, across
7
+ all of its API keys. `scrapebadger credits` no longer prints `Tier` or `Rate limit`; it
8
+ prints `Max concurrency: N (M running)` from `max_concurrency` / `concurrent_requests` on
9
+ `GET /v1/account/me`.
10
+ - A request over the limit gets HTTP 429 `concurrency_limit_exceeded`; the CLI prints the
11
+ API's message, which says how many are allowed and links the pricing page.
12
+ - `scrapebadger trial` says a trial key runs one request at a time instead of printing a
13
+ per-minute limit.
14
+
15
+ ## 0.34.1 — 2026-11-25
16
+
17
+ - `scrapebadger google maps-photos`: the help text says what the API returns. Photos
18
+ are one page, usually the first 8 that Google exposes, and `pagination.total_results`
19
+ is the place's total photo count on Google. `--next-page-token` is accepted but has
20
+ no effect (SCR-711).
21
+
22
+ ## 0.34.0 — 2026-11-23
23
+
24
+ - Add `scrapebadger google resolve`: get the real URLs of search results whose `link`
25
+ is a `google.com/goto` redirect (`POST /v1/google/resolve`, 0 credits). Pass
26
+ `link_token` values, or `--file` with a saved search or resolve response.
27
+
28
+ ## 0.33.0 — 2026-11-09
29
+
30
+ - Remove `scrapebadger stream delivery-logs`: ScrapeBadger no longer stores delivered
31
+ tweets (SCR-396), so `GET /v1/twitter/stream/logs` answers 410. Keep your own log
32
+ where your webhook or WebSocket receives the tweets.
33
+
34
+ ## 0.32.0 — 2026-11-09
35
+
36
+ - Remove `scrapebadger results get`: the API no longer keeps results after a call
37
+ (SCR-396), so `GET /v1/results/{id}` is gone. Local saves (`scrapebadger view`)
38
+ are unchanged; the saved line no longer prints a `result_id`.
39
+ - Google `--no-cache` is accepted and ignored: responses are never cached.
40
+
41
+ ## 0.30.0 — 2026-11-07
42
+
43
+ - Expose Google Search and Light targeting, advanced filters, and `--no-cache`.
44
+ - Add `--response-format html` for raw search pages, including Google verticals.
45
+
46
+
47
+ ## 0.29.0 — 2026-11-07
48
+
49
+ - Add AutoScout24 listing details and GitHub repository operations.
50
+ - Add Yelp business search and markets, preserving filters, pagination and response envelopes.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: scrapebadger-cli
3
- Version: 0.31.1
3
+ Version: 0.35.0
4
4
  Summary: ScrapeBadger CLI — Twitter, Vinted, Google, and Web Scraping from the command line
5
5
  Author: ScrapeBadger Team
6
6
  License: MIT
@@ -30,7 +30,7 @@ scrapebadger google light-search "vinted api" --gl us --hl en
30
30
  ```
31
31
 
32
32
  Light returns organic results and related searches for 10 credits per successful
33
- uncached request. Regular `scrapebadger google search` costs 20 credits and
33
+ request. Regular `scrapebadger google search` costs 20 credits and
34
34
  returns the full SERP. Cache hits and failed requests are free.
35
35
 
36
36
  Command-line access to ScrapeBadger APIs, including Etsy, AliExpress, Target, ASOS, Best Buy, search engines, social media and general web scraping.
@@ -77,17 +77,17 @@ so it gets the MCP server only.
77
77
 
78
78
  `trial` solves a short proof of work, saves the key and prints a notice to pass on
79
79
  to your human. A trial key works only from the IP that created it, on read APIs,
80
- at 10 requests/min, and not through the hosted MCP server. It refuses to replace an
80
+ one request at a time, and not through the hosted MCP server. It refuses to replace an
81
81
  account key unless you pass `--force`.
82
82
 
83
- ## Saved results and free re-reads
83
+ ## Saved results
84
84
 
85
85
  Every API command also writes its full JSON response to
86
86
  `~/.cache/scrapebadger/results/<api>-<command>-<UTC timestamp>.json` (honours
87
87
  `XDG_CACHE_HOME`; the newest 200 are kept) and prints one line to stderr:
88
88
 
89
89
  ```
90
- saved: ~/.cache/scrapebadger/results/google-search-20261023T101500123456Z.json · credits: 20 · result_id: 6f1c...
90
+ saved: ~/.cache/scrapebadger/results/google-search-20261023T101500123456Z.json · credits: 20
91
91
  ```
92
92
 
93
93
  stdout is unchanged. Disable with `scrapebadger --no-save ...` or `SCRAPEBADGER_SAVE=0`.
@@ -104,11 +104,9 @@ scrapebadger view path/to/result.json --jq '.organic_results[].link' # needs j
104
104
  top-level array, else the largest top-level list); truncation adds
105
105
  `"_truncated": {"path", "kept", "total"}`.
106
106
 
107
- Re-read a result from the server within ~15 minutes, free, sliced server-side:
108
-
109
- ```bash
110
- scrapebadger results get <result_id> --max-items 3 --fields id,text
111
- ```
107
+ ScrapeBadger keeps no copy of a result after the call, so this local file is
108
+ the only one: re-slicing it is free, while running the command again is a new,
109
+ billed request.
112
110
 
113
111
  ## Quotes, bug reports and feedback (all free)
114
112
 
@@ -132,6 +130,27 @@ upgrade or claim link when you are out of credits.
132
130
  | `SCRAPEBADGER_MCP_URL` | `https://mcp.scrapebadger.com/mcp` | MCP server `init` registers |
133
131
  | `SCRAPEBADGER_SAVE` | `1` | `0` disables saving results |
134
132
 
133
+ ## Google result links (0.34.0+)
134
+
135
+ Google hides a result's URL behind a redirect (`https://www.google.com/goto?url=...`)
136
+ and paces how fast a result page's links can be followed. `google search` and
137
+ `google light-search` give every organic result whose `link` is still such a redirect
138
+ a `link_token` and `retry_after_seconds` (0 means it can be resolved right away).
139
+ `google resolve` returns the real URLs. It costs 0 credits.
140
+
141
+ ```bash
142
+ scrapebadger google search "vinted api" # prints "saved: <file>" on stderr
143
+ scrapebadger google resolve --file <file> # sends the rows that carry a link_token
144
+ scrapebadger google resolve <link_token> <link_token>
145
+ ```
146
+
147
+ Each row comes back resolved (`link` is the result's own URL, no `link_token`), not
148
+ ready (`link_token` and `retry_after_seconds`) or failed (`link_token` and `error`;
149
+ do not send it again). The top-level `retry_after_seconds` is the smallest wait among
150
+ the rows that are not ready. Wait that long, then run `google resolve --file` on the
151
+ saved resolve response: only the rows that are not ready are sent, with their latest
152
+ `link_token`. `--file -` reads the JSON from stdin. At most 25 results per call.
153
+
135
154
  ## Vinted mobile data (0.14.0+)
136
155
 
137
156
  ```sh
@@ -180,7 +199,7 @@ public default branch and accepts no pagination, market or ref options.
180
199
  scrapebadger github repository cli cli
181
200
  ```
182
201
 
183
- A successful uncached detail response costs 10 credits. Errors are unbilled;
202
+ A successful detail response costs 10 credits. Errors are unbilled;
184
203
  cache hits can be free. The raw JSON retains README, root files, latest commit,
185
204
  metadata and additive fields. Reference: https://docs.scrapebadger.com/github/repositories.
186
205
 
@@ -7,7 +7,7 @@ scrapebadger google light-search "vinted api" --gl us --hl en
7
7
  ```
8
8
 
9
9
  Light returns organic results and related searches for 10 credits per successful
10
- uncached request. Regular `scrapebadger google search` costs 20 credits and
10
+ request. Regular `scrapebadger google search` costs 20 credits and
11
11
  returns the full SERP. Cache hits and failed requests are free.
12
12
 
13
13
  Command-line access to ScrapeBadger APIs, including Etsy, AliExpress, Target, ASOS, Best Buy, search engines, social media and general web scraping.
@@ -54,17 +54,17 @@ so it gets the MCP server only.
54
54
 
55
55
  `trial` solves a short proof of work, saves the key and prints a notice to pass on
56
56
  to your human. A trial key works only from the IP that created it, on read APIs,
57
- at 10 requests/min, and not through the hosted MCP server. It refuses to replace an
57
+ one request at a time, and not through the hosted MCP server. It refuses to replace an
58
58
  account key unless you pass `--force`.
59
59
 
60
- ## Saved results and free re-reads
60
+ ## Saved results
61
61
 
62
62
  Every API command also writes its full JSON response to
63
63
  `~/.cache/scrapebadger/results/<api>-<command>-<UTC timestamp>.json` (honours
64
64
  `XDG_CACHE_HOME`; the newest 200 are kept) and prints one line to stderr:
65
65
 
66
66
  ```
67
- saved: ~/.cache/scrapebadger/results/google-search-20261023T101500123456Z.json · credits: 20 · result_id: 6f1c...
67
+ saved: ~/.cache/scrapebadger/results/google-search-20261023T101500123456Z.json · credits: 20
68
68
  ```
69
69
 
70
70
  stdout is unchanged. Disable with `scrapebadger --no-save ...` or `SCRAPEBADGER_SAVE=0`.
@@ -81,11 +81,9 @@ scrapebadger view path/to/result.json --jq '.organic_results[].link' # needs j
81
81
  top-level array, else the largest top-level list); truncation adds
82
82
  `"_truncated": {"path", "kept", "total"}`.
83
83
 
84
- Re-read a result from the server within ~15 minutes, free, sliced server-side:
85
-
86
- ```bash
87
- scrapebadger results get <result_id> --max-items 3 --fields id,text
88
- ```
84
+ ScrapeBadger keeps no copy of a result after the call, so this local file is
85
+ the only one: re-slicing it is free, while running the command again is a new,
86
+ billed request.
89
87
 
90
88
  ## Quotes, bug reports and feedback (all free)
91
89
 
@@ -109,6 +107,27 @@ upgrade or claim link when you are out of credits.
109
107
  | `SCRAPEBADGER_MCP_URL` | `https://mcp.scrapebadger.com/mcp` | MCP server `init` registers |
110
108
  | `SCRAPEBADGER_SAVE` | `1` | `0` disables saving results |
111
109
 
110
+ ## Google result links (0.34.0+)
111
+
112
+ Google hides a result's URL behind a redirect (`https://www.google.com/goto?url=...`)
113
+ and paces how fast a result page's links can be followed. `google search` and
114
+ `google light-search` give every organic result whose `link` is still such a redirect
115
+ a `link_token` and `retry_after_seconds` (0 means it can be resolved right away).
116
+ `google resolve` returns the real URLs. It costs 0 credits.
117
+
118
+ ```bash
119
+ scrapebadger google search "vinted api" # prints "saved: <file>" on stderr
120
+ scrapebadger google resolve --file <file> # sends the rows that carry a link_token
121
+ scrapebadger google resolve <link_token> <link_token>
122
+ ```
123
+
124
+ Each row comes back resolved (`link` is the result's own URL, no `link_token`), not
125
+ ready (`link_token` and `retry_after_seconds`) or failed (`link_token` and `error`;
126
+ do not send it again). The top-level `retry_after_seconds` is the smallest wait among
127
+ the rows that are not ready. Wait that long, then run `google resolve --file` on the
128
+ saved resolve response: only the rows that are not ready are sent, with their latest
129
+ `link_token`. `--file -` reads the JSON from stdin. At most 25 results per call.
130
+
112
131
  ## Vinted mobile data (0.14.0+)
113
132
 
114
133
  ```sh
@@ -157,7 +176,7 @@ public default branch and accepts no pagination, market or ref options.
157
176
  scrapebadger github repository cli cli
158
177
  ```
159
178
 
160
- A successful uncached detail response costs 10 credits. Errors are unbilled;
179
+ A successful detail response costs 10 credits. Errors are unbilled;
161
180
  cache hits can be free. The raw JSON retains README, root files, latest commit,
162
181
  metadata and additive fields. Reference: https://docs.scrapebadger.com/github/repositories.
163
182
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "scrapebadger-cli"
3
- version = "0.31.1"
3
+ version = "0.35.0"
4
4
  description = "ScrapeBadger CLI — Twitter, Vinted, Google, and Web Scraping from the command line"
5
5
  requires-python = ">=3.10"
6
6
  license = {text = "MIT"}
@@ -12,7 +12,9 @@ from scrapebadger_cli.config import get_api_key
12
12
  BASE_URL = os.environ.get("SCRAPEBADGER_API_URL", "https://scrapebadger.com")
13
13
  _client: httpx.Client | None = None
14
14
 
15
- # Links an error body may carry (402 / zero-credit 429 / trial errors).
15
+ # Links an error body may carry (402 / zero-credit 429 / trial errors). The
16
+ # max-concurrency 429 (`concurrency_limit_exceeded`) names the pricing page in its
17
+ # `detail`, which is printed as is.
16
18
  _ERROR_LINKS = ("claim_url", "upgrade_url", "free_credits_url", "pricing_url", "signup_url")
17
19
 
18
20
 
@@ -1,4 +1,4 @@
1
- """Agent helpers: view saved results, re-read results, quote, feedback."""
1
+ """Agent helpers: view saved results, quote, feedback."""
2
2
 
3
3
  import json
4
4
  import shutil
@@ -10,12 +10,10 @@ from typing import Any
10
10
  import typer
11
11
 
12
12
  from scrapebadger_cli import results as saved
13
- from scrapebadger_cli.client import api_get, api_post
13
+ from scrapebadger_cli.client import api_post
14
14
  from scrapebadger_cli.output import console, render
15
15
  from scrapebadger_cli.views import apply_view, summary
16
16
 
17
- results_app = typer.Typer(no_args_is_help=True)
18
-
19
17
  FMT = typer.Option("json", "--output", "-o", help="Output format: json, csv, table, markdown")
20
18
  JQ = typer.Option(None, "--jq", help="jq expression to run on the result")
21
19
  FIELDS = typer.Option(None, "--fields", help="Comma-separated (dotted) fields of each item to keep")
@@ -103,32 +101,6 @@ def view(
103
101
  render(data, fmt)
104
102
 
105
103
 
106
- @results_app.command("get")
107
- def results_get(
108
- result_id: str = typer.Argument(..., help="X-Result-ID of an earlier call (kept ~15 min)"),
109
- jq: str | None = JQ,
110
- fields: str | None = FIELDS,
111
- max_items: int | None = MAX_ITEMS,
112
- show_summary: bool = SUMMARY,
113
- fmt: str = FMT,
114
- ) -> None:
115
- """Re-read an earlier result from the server, free, optionally sliced server-side."""
116
- data = api_get(
117
- f"/v1/results/{result_id}",
118
- {
119
- "jq": jq,
120
- "fields": fields,
121
- "max_items": max_items,
122
- "summary": "true" if show_summary else None,
123
- },
124
- save=False,
125
- )
126
- if fmt == "json":
127
- _print_json(data)
128
- else:
129
- render(data, fmt)
130
-
131
-
132
104
  def _parse_params(pairs: list[str]) -> dict[str, str]:
133
105
  params = {}
134
106
  for pair in pairs:
@@ -93,6 +93,12 @@ def reviews(
93
93
  star: str | None = typer.Option(None, "--star", help="e.g. five_star, critical"),
94
94
  verified_only: bool = typer.Option(False, "--verified-only"),
95
95
  media_only: bool = typer.Option(False, "--media-only"),
96
+ mode: str = typer.Option("public", "--mode", help="public with pool fallback, or full"),
97
+ max_pages: int = typer.Option(10, "--max-pages", help="Authenticated pages per star sweep"),
98
+ per_star: bool = typer.Option(
99
+ False, "--per-star", help="Sweep every star filter and deduplicate"
100
+ ),
101
+ limit: int | None = typer.Option(None, "--limit", help="Stop after this many distinct reviews"),
96
102
  fmt: str = FMT,
97
103
  fields: str | None = FIELDS,
98
104
  ) -> None:
@@ -106,6 +112,10 @@ def reviews(
106
112
  "star": star,
107
113
  "verified_only": verified_only,
108
114
  "media_only": media_only,
115
+ "mode": mode,
116
+ "max_pages": max_pages,
117
+ "per_star": per_star,
118
+ "limit": limit,
109
119
  },
110
120
  )
111
121
  render(data, fmt, fields)
@@ -33,19 +33,25 @@ def auth(
33
33
 
34
34
 
35
35
  def credits() -> None:
36
- """Check your credit balance."""
36
+ """Check your credit balance and max concurrency."""
37
37
  data = api_get("/v1/account/me", save=False)
38
38
  if isinstance(data, dict):
39
39
  balance = data.get("credits_balance", "unknown")
40
- tier = data.get("tier", "unknown")
41
- rate_limit = data.get("rate_limit_per_minute", "unknown")
42
40
  console.print(f"[green]Credits balance:[/green] {balance}")
43
- console.print(f"[dim]Tier:[/dim] {tier}")
44
- console.print(f"[dim]Rate limit:[/dim] {rate_limit}/min")
41
+ console.print(f"[dim]Max concurrency:[/dim] {_concurrency(data)}")
45
42
  else:
46
43
  console.print(data)
47
44
 
48
45
 
46
+ def _concurrency(account: dict) -> str:
47
+ """``N (M running)``: requests the account may run at once, and how many are running."""
48
+ limit = account.get("max_concurrency")
49
+ if limit is None:
50
+ return "unknown"
51
+ running = account.get("concurrent_requests")
52
+ return f"{limit} ({running} running)" if running is not None else str(limit)
53
+
54
+
49
55
  def logout() -> None:
50
56
  """Remove saved API key."""
51
57
  clear_api_key()
@@ -13,9 +13,13 @@ Typical workflow:
13
13
  scrapebadger google product-detail 7768723536481519578 --q "laptop" --include-offers
14
14
  """
15
15
 
16
+ import json
17
+ import sys
18
+ from pathlib import Path
19
+
16
20
  import typer
17
21
 
18
- from scrapebadger_cli.client import api_get, api_get_raw
22
+ from scrapebadger_cli.client import api_get, api_get_raw, api_post
19
23
  from scrapebadger_cli.output import render
20
24
 
21
25
  app = typer.Typer(no_args_is_help=True)
@@ -83,9 +87,7 @@ def search(
83
87
  "--udm",
84
88
  help="Google result filter: 14 web, 18 forums. Other verticals require output=html.",
85
89
  ),
86
- no_cache: bool = typer.Option(
87
- False, "--no-cache", help="Bypass result caches and request a fresh Google fetch."
88
- ),
90
+ no_cache: bool = typer.Option(False, "--no-cache", help="Ignored: responses are never cached."),
89
91
  as_dt: str | None = typer.Option(
90
92
  None, "--as-dt", help="Site restriction mode: i includes, e excludes as_sitesearch."
91
93
  ),
@@ -240,9 +242,7 @@ def light_search(
240
242
  "--udm",
241
243
  help="Google result filter: 14 web, 18 forums. Other verticals require output=html.",
242
244
  ),
243
- no_cache: bool = typer.Option(
244
- False, "--no-cache", help="Bypass result caches and request a fresh Google fetch."
245
- ),
245
+ no_cache: bool = typer.Option(False, "--no-cache", help="Ignored: responses are never cached."),
246
246
  as_dt: str | None = typer.Option(
247
247
  None, "--as-dt", help="Site restriction mode: i includes, e excludes as_sitesearch."
248
248
  ),
@@ -341,6 +341,75 @@ def light_search(
341
341
  render(data, fmt, fields)
342
342
 
343
343
 
344
+ # ---------------------------------------------------------------------------
345
+ # Resolve (result links that are still google.com/goto redirects)
346
+ # ---------------------------------------------------------------------------
347
+
348
+ RESOLVE_MAX_RESULTS = 25
349
+
350
+
351
+ def _rows_to_resolve(data: object) -> list[dict]:
352
+ """The rows of a search or resolve response (or a plain list) that still wait for a URL."""
353
+ if isinstance(data, dict):
354
+ data = data.get("organic_results", data.get("results"))
355
+ if not isinstance(data, list):
356
+ raise typer.BadParameter(
357
+ "expected a search response, a resolve response or a list of results",
358
+ param_hint="--file",
359
+ )
360
+ return [
361
+ row
362
+ for row in data
363
+ if isinstance(row, dict)
364
+ and isinstance(row.get("link_token"), str)
365
+ and row["link_token"]
366
+ and not row.get("error")
367
+ ]
368
+
369
+
370
+ @app.command()
371
+ def resolve(
372
+ link_tokens: list[str] | None = typer.Argument(
373
+ None, help="link_token values of organic results from search or light-search"
374
+ ),
375
+ file: str | None = typer.Option(
376
+ None,
377
+ "--file",
378
+ help="JSON file with a saved search or resolve response, or a list of results; - reads stdin",
379
+ ),
380
+ fmt: str = FMT,
381
+ fields: str | None = FIELDS,
382
+ ) -> None:
383
+ """Get the real URLs behind google.com/goto result links. Costs 0 credits.
384
+
385
+ Pass link_token values, or --file with a saved search or resolve response.
386
+ From a file, the rows that still carry a link_token are sent.
387
+ A row comes back resolved (link is the URL), not ready or failed (error).
388
+ Not ready: wait retry_after_seconds, then send the row's new link_token.
389
+ At most 25 results per call.
390
+ """
391
+ if bool(link_tokens) == bool(file):
392
+ raise typer.BadParameter("Pass link_token values or --file, one of the two")
393
+ if file:
394
+ try:
395
+ text = sys.stdin.read() if file == "-" else Path(file).expanduser().read_text()
396
+ rows = _rows_to_resolve(json.loads(text))
397
+ except (OSError, ValueError) as exc:
398
+ raise typer.BadParameter(f"cannot read {file}: {exc}", param_hint="--file") from exc
399
+ else:
400
+ rows = [{"link_token": token} for token in link_tokens or []]
401
+ if not rows:
402
+ typer.echo("Nothing to resolve: no result carries a link_token.", err=True)
403
+ raise typer.Exit(0)
404
+ if len(rows) > RESOLVE_MAX_RESULTS:
405
+ raise typer.BadParameter(
406
+ f"{len(rows)} results to resolve; at most {RESOLVE_MAX_RESULTS} per call"
407
+ )
408
+ data = api_post("/v1/google/resolve", {"results": rows})
409
+ # The envelope carries the top-level retry_after_seconds: keep it in the JSON output.
410
+ render(data, fmt, fields, preserve_envelope=True)
411
+
412
+
344
413
  # ---------------------------------------------------------------------------
345
414
  # Maps (5 endpoints)
346
415
  # ---------------------------------------------------------------------------
@@ -417,11 +486,16 @@ def maps_reviews(
417
486
  def maps_photos(
418
487
  data_id: str = typer.Argument(..., help="Google Maps data ID"),
419
488
  hl: str | None = typer.Option(None, "--hl", help="Language code"),
420
- next_page_token: str | None = typer.Option(None, "--next-page-token", help="Pagination token"),
489
+ next_page_token: str | None = typer.Option(
490
+ None, "--next-page-token", help="Accepted for compatibility; photos are a single page"
491
+ ),
421
492
  fmt: str = FMT,
422
493
  fields: str | None = FIELDS,
423
494
  ) -> None:
424
- """Maps photos for a place."""
495
+ """Maps photos for a place: one page, usually the first 8 that Google exposes.
496
+
497
+ pagination.total_results is the place's total photo count on Google.
498
+ """
425
499
  data = api_get(
426
500
  "/v1/google/maps/photos",
427
501
  {"data_id": data_id, "hl": hl, "next_page_token": next_page_token},
@@ -0,0 +1,67 @@
1
+ import typer
2
+
3
+ from scrapebadger_cli.client import api_get
4
+ from scrapebadger_cli.output import render
5
+
6
+ app = typer.Typer(no_args_is_help=True)
7
+
8
+ FMT = typer.Option("json", "--output", "-o", help="Output format: json, csv, table, markdown")
9
+ FIELDS = typer.Option(None, "--fields", "-f", help="Comma-separated fields to include")
10
+ MODE = typer.Option("auto", "--mode", "-m", help="Assistant mode: auto, fast, expert")
11
+ WEB_SEARCH = typer.Option("auto", "--web-search", "-w", help="Web and X search: auto, force, off")
12
+
13
+
14
+ @app.command()
15
+ def ask(
16
+ prompt: str = typer.Argument(..., help="Prompt to send to Grok (max 4000 chars)"),
17
+ conversation_id: str | None = typer.Option(None, "--conversation-id", "-c"),
18
+ mode: str = MODE,
19
+ web_search: str = WEB_SEARCH,
20
+ fmt: str = FMT,
21
+ fields: str | None = FIELDS,
22
+ ) -> None:
23
+ """Ask the real Grok assistant and get the answer, web sources, and X posts."""
24
+ params = {"prompt": prompt, "mode": mode, "web_search": web_search}
25
+ if conversation_id:
26
+ params["conversation_id"] = conversation_id
27
+ render(api_get("/v1/grok/ask", params), fmt, fields)
28
+
29
+
30
+ @app.command()
31
+ def models(fmt: str = FMT, fields: str | None = FIELDS) -> None:
32
+ """List Grok assistant modes."""
33
+ render(api_get("/v1/grok/models", {}), fmt, fields)
34
+
35
+
36
+ @app.command()
37
+ def conversation(
38
+ conversation_id: str = typer.Argument(...),
39
+ fmt: str = FMT,
40
+ fields: str | None = FIELDS,
41
+ ) -> None:
42
+ """Get messages in a Grok conversation."""
43
+ render(api_get(f"/v1/grok/conversations/{conversation_id}", {}), fmt, fields)
44
+
45
+
46
+ @app.command("brand-visibility")
47
+ def brand_visibility(
48
+ prompt: str = typer.Argument(...),
49
+ brand: str = typer.Option(..., "--brand", "-b"),
50
+ competitors: list[str] = typer.Option([], "--competitor", "-c"),
51
+ brand_domain: str | None = typer.Option(None, "--brand-domain", "-d"),
52
+ mode: str = MODE,
53
+ web_search: str = typer.Option("force", "--web-search", "-w"),
54
+ fmt: str = FMT,
55
+ fields: str | None = FIELDS,
56
+ ) -> None:
57
+ """Measure brand mentions and citations in a real Grok answer."""
58
+ params = {
59
+ "prompt": prompt,
60
+ "brand": brand,
61
+ "competitors": competitors,
62
+ "mode": mode,
63
+ "web_search": web_search,
64
+ }
65
+ if brand_domain:
66
+ params["brand_domain"] = brand_domain
67
+ render(api_get("/v1/grok/brand-visibility", params), fmt, fields)
@@ -122,6 +122,18 @@ def profile(
122
122
  render(data, fmt, fields)
123
123
 
124
124
 
125
+ @app.command("full-profile")
126
+ def full_profile(
127
+ public_id: str = typer.Argument(..., help="Profile public id (e.g. williamhgates)"),
128
+ country: str = COUNTRY,
129
+ fmt: str = FMT,
130
+ fields: str | None = FIELDS,
131
+ ) -> None:
132
+ """Get a full profile through the server-owned authenticated projection."""
133
+ data = api_get(f"/v1/linkedin/profiles/{public_id}/full", {"country": country})
134
+ render(data, fmt, fields)
135
+
136
+
125
137
  @app.command()
126
138
  def post(
127
139
  post_slug: str = typer.Argument(..., help="LinkedIn post slug"),
@@ -0,0 +1,35 @@
1
+ """Meta AI LLM scraping commands."""
2
+
3
+ import typer
4
+
5
+ from scrapebadger_cli.client import api_get
6
+ from scrapebadger_cli.output import render
7
+
8
+ app = typer.Typer(no_args_is_help=True)
9
+
10
+ FMT = typer.Option("json", "--output", "-o", help="Output format: json, csv, table, markdown")
11
+ FIELDS = typer.Option(None, "--fields", "-f", help="Comma-separated fields to include")
12
+ COUNTRY = typer.Option("US", "--country", "-c", help="ISO-3166 alpha-2 egress country")
13
+
14
+
15
+ @app.command()
16
+ def ask(
17
+ prompt: str = typer.Argument(..., help="Prompt to send to Meta AI (max 4000 chars)"),
18
+ country: str = COUNTRY,
19
+ fmt: str = FMT,
20
+ fields: str | None = FIELDS,
21
+ ) -> None:
22
+ """Ask the real meta.ai (Meta AI assistant) and get the answer (slow, tens of seconds)."""
23
+ data = api_get("/v1/meta-ai/ask", {"prompt": prompt, "country": country})
24
+ render(data, fmt, fields)
25
+
26
+
27
+ @app.command()
28
+ def models(
29
+ country: str = COUNTRY,
30
+ fmt: str = FMT,
31
+ fields: str | None = FIELDS,
32
+ ) -> None:
33
+ """List the assistant modes meta.ai exposes to anonymous users."""
34
+ data = api_get("/v1/meta-ai/models", {"country": country})
35
+ render(data, fmt, fields)
@@ -76,7 +76,7 @@ def trial(
76
76
  save_api_key(body["api_key"], key_type="trial")
77
77
  console.print(
78
78
  f"[green]Trial key saved.[/green] {body.get('credits')} credits, "
79
- f"{body.get('rate_limit_per_minute')} req/min, expires {body.get('expires_at')}."
79
+ f"one request at a time, expires {body.get('expires_at')}."
80
80
  )
81
81
  if notice := body.get("notice"):
82
82
  typer.echo(notice)