scrapebadger-cli 0.34.1__tar.gz → 0.36.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.34.1 → scrapebadger_cli-0.36.0}/CHANGELOG.md +21 -0
  2. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/PKG-INFO +2 -2
  3. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/README.md +1 -1
  4. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/pyproject.toml +1 -1
  5. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/client.py +3 -1
  6. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/auth.py +11 -5
  7. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/booking.py +4 -2
  8. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/onboarding.py +1 -1
  9. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/twitter.py +17 -0
  10. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/wallapop.py +22 -4
  11. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/tests/test_agent_features.py +22 -0
  12. scrapebadger_cli-0.36.0/tests/test_twitter_search_community_tweets.py +54 -0
  13. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/uv.lock +1 -1
  14. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/.gitignore +0 -0
  15. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/__init__.py +0 -0
  16. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/availability.py +0 -0
  17. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/__init__.py +0 -0
  18. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/agent.py +0 -0
  19. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/airbnb.py +0 -0
  20. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/aliexpress.py +0 -0
  21. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/amazon.py +0 -0
  22. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/apartments.py +0 -0
  23. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/app_store.py +0 -0
  24. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/asos.py +0 -0
  25. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/autoscout24.py +0 -0
  26. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/baidu.py +0 -0
  27. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/bestbuy.py +0 -0
  28. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/bing.py +0 -0
  29. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/brave.py +0 -0
  30. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/chatgpt.py +0 -0
  31. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/copilot.py +0 -0
  32. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/depop.py +0 -0
  33. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/duckduckgo.py +0 -0
  34. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/ebay.py +0 -0
  35. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/etsy.py +0 -0
  36. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/facebook.py +0 -0
  37. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/gemini.py +0 -0
  38. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/github.py +0 -0
  39. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/google.py +0 -0
  40. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/google_play.py +0 -0
  41. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/grok.py +0 -0
  42. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/gumtree.py +0 -0
  43. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/idealista.py +0 -0
  44. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/immobiliare.py +0 -0
  45. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/init.py +0 -0
  46. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/instagram.py +0 -0
  47. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/leboncoin.py +0 -0
  48. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/linkedin.py +0 -0
  49. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/loopnet.py +0 -0
  50. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/meta_ai.py +0 -0
  51. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/naver.py +0 -0
  52. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/perplexity.py +0 -0
  53. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/realtor.py +0 -0
  54. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/reddit.py +0 -0
  55. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/redfin.py +0 -0
  56. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/rufus.py +0 -0
  57. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/stream.py +0 -0
  58. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/target.py +0 -0
  59. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/tiktok.py +0 -0
  60. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/vinted.py +0 -0
  61. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/walmart.py +0 -0
  62. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/web.py +0 -0
  63. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/yahoo.py +0 -0
  64. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/yandex.py +0 -0
  65. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/yelp.py +0 -0
  66. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/youtube.py +0 -0
  67. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/commands/zillow.py +0 -0
  68. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/config.py +0 -0
  69. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/main.py +0 -0
  70. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/output.py +0 -0
  71. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/results.py +0 -0
  72. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/src/scrapebadger_cli/views.py +0 -0
  73. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/tests/conftest.py +0 -0
  74. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/tests/test_autoscout24_commands.py +0 -0
  75. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/tests/test_brave.py +0 -0
  76. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/tests/test_cli_availability.py +0 -0
  77. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/tests/test_copilot_commands.py +0 -0
  78. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/tests/test_github.py +0 -0
  79. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/tests/test_google_light_search.py +0 -0
  80. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/tests/test_google_resolve.py +0 -0
  81. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/tests/test_grok_commands.py +0 -0
  82. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/tests/test_marketplace_monitor.py +0 -0
  83. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/tests/test_naver.py +0 -0
  84. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/tests/test_perplexity_strict_country.py +0 -0
  85. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/tests/test_tiktok_pagination.py +0 -0
  86. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/tests/test_vinted_image_search.py +0 -0
  87. {scrapebadger_cli-0.34.1 → scrapebadger_cli-0.36.0}/tests/test_yelp_commands.py +0 -0
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.36.0 — 2026-11-30
4
+
5
+ - `scrapebadger twitter search-community-tweets <query>`: search tweets posted in
6
+ communities, across every community (`GET /v1/twitter/communities/search_tweets`, the Top
7
+ and Latest tabs of X's community search page). `--type Top|Latest` picks the tab (Top by
8
+ default), `--count` the number of tweets, `--cursor` the next page. Each tweet has
9
+ `community_id` and `community_name`, the community it was posted in (SCR-756).
10
+ `search-communities` still finds communities by name.
11
+
12
+ ## 0.35.0 — 2026-11-29
13
+
14
+ - Breaking: ScrapeBadger replaced rate tiers and per-minute rate limits with a per-account
15
+ max concurrency (SCR-736): how many requests an account can run at the same time, across
16
+ all of its API keys. `scrapebadger credits` no longer prints `Tier` or `Rate limit`; it
17
+ prints `Max concurrency: N (M running)` from `max_concurrency` / `concurrent_requests` on
18
+ `GET /v1/account/me`.
19
+ - A request over the limit gets HTTP 429 `concurrency_limit_exceeded`; the CLI prints the
20
+ API's message, which says how many are allowed and links the pricing page.
21
+ - `scrapebadger trial` says a trial key runs one request at a time instead of printing a
22
+ per-minute limit.
23
+
3
24
  ## 0.34.1 — 2026-11-25
4
25
 
5
26
  - `scrapebadger google maps-photos`: the help text says what the API returns. Photos
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: scrapebadger-cli
3
- Version: 0.34.1
3
+ Version: 0.36.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
@@ -77,7 +77,7 @@ 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
83
  ## Saved results
@@ -54,7 +54,7 @@ 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
60
  ## Saved results
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "scrapebadger-cli"
3
- version = "0.34.1"
3
+ version = "0.36.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
 
@@ -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()
@@ -27,7 +27,7 @@ def search(
27
27
  adults: int = typer.Option(2, "--adults"),
28
28
  children: str | None = typer.Option(None, "--children", help="Ages, e.g. '4,9'"),
29
29
  rooms: int = typer.Option(1, "--rooms"),
30
- offset: int = typer.Option(0, "--offset", help="Result offset to paginate"),
30
+ offset: int = typer.Option(0, "--offset", help="Result offset to paginate (max 1000)"),
31
31
  limit: int = typer.Option(25, "--limit"),
32
32
  sort: str | None = typer.Option(
33
33
  None,
@@ -36,7 +36,9 @@ def search(
36
36
  "distance_from_search | bayesian_review_score | review_score_and_price | upsort_bh",
37
37
  ),
38
38
  filters: str | None = typer.Option(
39
- None, "--filters", help="Semicolon-separated Booking filter ids, e.g. 'class=5'"
39
+ None,
40
+ "--filters",
41
+ help="Semicolon-separated Booking filter ids, e.g. 'class=5' (class takes 1-5)",
40
42
  ),
41
43
  currency: str | None = CURRENCY,
42
44
  language: str | None = LANGUAGE,
@@ -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)
@@ -201,6 +201,23 @@ def search_communities(
201
201
  render(data, fmt, fields)
202
202
 
203
203
 
204
+ @app.command(name="search-community-tweets")
205
+ def search_community_tweets(
206
+ query: str = typer.Argument(..., help="Search query"),
207
+ tweet_type: str | None = typer.Option(None, "--type", "-t", help="Tab: Top (default), Latest"),
208
+ count: int | None = typer.Option(None, "--count", "-n", help="Max results"),
209
+ cursor: str | None = CURSOR,
210
+ fmt: str = FMT,
211
+ fields: str | None = FIELDS,
212
+ ) -> None:
213
+ """Search tweets across all communities; each has community_id and community_name."""
214
+ data = api_get(
215
+ "/v1/twitter/communities/search_tweets",
216
+ {"query": query, "tweet_type": tweet_type, "count": count, "cursor": cursor},
217
+ )
218
+ render(data, fmt, fields)
219
+
220
+
204
221
  @app.command(name="list")
205
222
  def list_detail(
206
223
  list_id: str = typer.Argument(..., help="List ID"),
@@ -11,6 +11,9 @@ FMT = typer.Option("json", "--output", "-o", help="Output format: json, csv, tab
11
11
  FIELDS = typer.Option(None, "--fields", "-f", help="Comma-separated fields to include")
12
12
  MARKET = typer.Option("es", "--market", "-m", help="es, it, pt")
13
13
  NEXT_PAGE = typer.Option(None, "--next-page", help="Cursor from the previous page")
14
+ SUBCATEGORY_IDS = typer.Option(
15
+ None, "--subcategory-ids", help="CSV of subcategory ids from `categories` (e.g. 9447,10310)"
16
+ )
14
17
  USER_ID = typer.Argument(..., help="User id (dqjwdd53wwzo) or profile slug (alexc-25115753)")
15
18
 
16
19
 
@@ -19,6 +22,7 @@ def search(
19
22
  query: str | None = typer.Argument(None, help='Search text (e.g. "iphone 14")'),
20
23
  market: str = MARKET,
21
24
  category_id: int | None = typer.Option(None, "--category-id", help="See `categories`"),
25
+ subcategory_ids: str | None = SUBCATEGORY_IDS,
22
26
  min_price: float | None = typer.Option(None, "--min-price"),
23
27
  max_price: float | None = typer.Option(None, "--max-price"),
24
28
  condition: str | None = typer.Option(
@@ -54,13 +58,14 @@ def search(
54
58
  fmt: str = FMT,
55
59
  fields: str | None = FIELDS,
56
60
  ) -> None:
57
- """Search Wallapop listings (needs a query or --category-id)."""
61
+ """Search Wallapop listings (needs a query, --category-id or --subcategory-ids)."""
58
62
  data = api_get(
59
63
  "/v1/wallapop/search",
60
64
  {
61
65
  "query": query,
62
66
  "market": market,
63
67
  "category_id": category_id,
68
+ "subcategory_ids": subcategory_ids,
64
69
  "min_price": min_price,
65
70
  "max_price": max_price,
66
71
  "condition": condition,
@@ -156,7 +161,7 @@ def autocomplete(
156
161
 
157
162
  @app.command()
158
163
  def categories(market: str = MARKET, fmt: str = FMT, fields: str | None = FIELDS) -> None:
159
- """List the Wallapop category tree (ids usable as --category-id)."""
164
+ """List the Wallapop category tree (top-level ids for --category-id, nested for --subcategory-ids)."""
160
165
  data = api_get("/v1/wallapop/categories", {"market": market})
161
166
  render(data, fmt, fields)
162
167
 
@@ -164,6 +169,7 @@ def categories(market: str = MARKET, fmt: str = FMT, fields: str | None = FIELDS
164
169
  @app.command()
165
170
  def filters(
166
171
  category_id: int | None = typer.Option(None, "--category-id"),
172
+ subcategory_ids: str | None = SUBCATEGORY_IDS,
167
173
  query: str | None = typer.Option(None, "--query", "-q"),
168
174
  market: str = MARKET,
169
175
  fmt: str = FMT,
@@ -171,7 +177,13 @@ def filters(
171
177
  ) -> None:
172
178
  """List the search filters Wallapop offers for a category/query."""
173
179
  data = api_get(
174
- "/v1/wallapop/filters", {"category_id": category_id, "query": query, "market": market}
180
+ "/v1/wallapop/filters",
181
+ {
182
+ "category_id": category_id,
183
+ "subcategory_ids": subcategory_ids,
184
+ "query": query,
185
+ "market": market,
186
+ },
175
187
  )
176
188
  render(data, fmt, fields)
177
189
 
@@ -180,6 +192,7 @@ def filters(
180
192
  def filter_options(
181
193
  filter_id: str = typer.Argument(..., help="Filter id from `filters` (e.g. brand)"),
182
194
  category_id: int | None = typer.Option(None, "--category-id"),
195
+ subcategory_ids: str | None = SUBCATEGORY_IDS,
183
196
  query: str | None = typer.Option(None, "--query", "-q"),
184
197
  market: str = MARKET,
185
198
  fmt: str = FMT,
@@ -188,7 +201,12 @@ def filter_options(
188
201
  """List a Wallapop filter's long option list (brands, models)."""
189
202
  data = api_get(
190
203
  f"/v1/wallapop/filters/{filter_id}/options",
191
- {"category_id": category_id, "query": query, "market": market},
204
+ {
205
+ "category_id": category_id,
206
+ "subcategory_ids": subcategory_ids,
207
+ "query": query,
208
+ "market": market,
209
+ },
192
210
  )
193
211
  render(data, fmt, fields)
194
212
 
@@ -190,6 +190,7 @@ def test_trial_saves_key_and_prints_notice(monkeypatch):
190
190
  json={
191
191
  "api_key": "sb_live_trial",
192
192
  "credits": 50,
193
+ "max_concurrency": 1,
193
194
  "notice": "Tell your human [this].",
194
195
  "claim_url": "https://scrapebadger.com/claim-key?token=t",
195
196
  },
@@ -203,9 +204,30 @@ def test_trial_saves_key_and_prints_notice(monkeypatch):
203
204
  assert config.get_api_key() == "sb_live_trial" and config.active_key_is_trial()
204
205
  assert "Tell your human [this]." in result.stdout
205
206
  assert "claim-key?token=t" in result.stdout
207
+ assert "one request at a time" in result.stdout and "req/min" not in result.stdout
206
208
  assert "sb_live_trial" not in result.output
207
209
 
208
210
 
211
+ @pytest.mark.parametrize(
212
+ ("account", "line"),
213
+ [
214
+ ({"max_concurrency": 25, "concurrent_requests": 3}, "Max concurrency: 25 (3 running)"),
215
+ ({"max_concurrency": 5}, "Max concurrency: 5"),
216
+ ({}, "Max concurrency: unknown"),
217
+ ],
218
+ )
219
+ def test_credits_prints_max_concurrency_not_tier(monkeypatch, account, line):
220
+ """SCR-736: the account's one limit is max concurrency; tiers and rpm are gone."""
221
+ monkeypatch.setenv("SCRAPEBADGER_API_KEY", "sb_live_x")
222
+ body = {"credits_balance": 1200, **account}
223
+ mock_api(monkeypatch, lambda req: httpx.Response(200, json=body))
224
+ result = invoke("credits")
225
+ assert result.exit_code == 0, result.output
226
+ assert "Credits balance: 1200" in result.stdout
227
+ assert line in result.stdout
228
+ assert "Tier" not in result.stdout and "/min" not in result.stdout
229
+
230
+
209
231
  def test_trial_refuses_to_replace_account_key(monkeypatch):
210
232
  config.save_api_key("sb_live_real")
211
233
  mock_api(monkeypatch, lambda req: pytest.fail("no request expected"))
@@ -0,0 +1,54 @@
1
+ """scrapebadger twitter search-community-tweets: GET /v1/twitter/communities/search_tweets (SCR-756)."""
2
+
3
+ from unittest.mock import Mock
4
+
5
+ import pytest
6
+
7
+ CliRunner = pytest.importorskip("typer.testing").CliRunner
8
+ twitter = pytest.importorskip("scrapebadger_cli.commands.twitter")
9
+
10
+ PATH = "/v1/twitter/communities/search_tweets"
11
+
12
+
13
+ def _invoke(monkeypatch, args):
14
+ call = Mock(return_value={"data": [], "next_cursor": None})
15
+ monkeypatch.setattr(twitter, "api_get", call)
16
+ monkeypatch.setattr(twitter, "render", Mock())
17
+ result = CliRunner().invoke(twitter.app, args)
18
+ assert result.exit_code == 0, result.output
19
+ return call.call_args.args
20
+
21
+
22
+ def test_only_the_query_is_needed(monkeypatch):
23
+ path, params = _invoke(monkeypatch, ["search-community-tweets", "web 3"])
24
+ assert path == PATH
25
+ # The API picks the Top tab and 20 tweets when these are not sent.
26
+ assert params == {"query": "web 3", "tweet_type": None, "count": None, "cursor": None}
27
+
28
+
29
+ def test_the_tab_the_count_and_the_cursor_are_sent(monkeypatch):
30
+ path, params = _invoke(
31
+ monkeypatch,
32
+ ["search-community-tweets", "python", "-t", "Latest", "-n", "40", "-c", "DAAHCgAB=="],
33
+ )
34
+ assert path == PATH
35
+ assert params == {
36
+ "query": "python",
37
+ "tweet_type": "Latest",
38
+ "count": 40,
39
+ "cursor": "DAAHCgAB==",
40
+ }
41
+
42
+
43
+ def test_search_communities_still_searches_communities(monkeypatch):
44
+ path, params = _invoke(monkeypatch, ["search-communities", "python"])
45
+ assert path == "/v1/twitter/communities/search"
46
+ assert params == {"query": "python", "cursor": None}
47
+
48
+
49
+ def test_the_help_says_what_comes_back():
50
+ result = CliRunner().invoke(twitter.app, ["search-community-tweets", "--help"])
51
+ assert result.exit_code == 0
52
+ text = " ".join(result.output.split())
53
+ assert "across all communities" in text
54
+ assert "Top (default), Latest" in text
@@ -228,7 +228,7 @@ wheels = [
228
228
 
229
229
  [[package]]
230
230
  name = "scrapebadger-cli"
231
- version = "0.34.1"
231
+ version = "0.36.0"
232
232
  source = { editable = "." }
233
233
  dependencies = [
234
234
  { name = "click" },