scrapebadger 0.76.0 → 0.76.2

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.
package/README.md CHANGED
@@ -126,7 +126,7 @@ Etsy and AliExpress category navigation is separate from search: their search me
126
126
  | **ChatGPT** | Prompt the real chatgpt.com anonymously — structured answer with citations anchored to character offsets, the full retrieved search trail, and AEO/GEO brand-visibility analysis | [ChatGPT Guide](docs/chatgpt.md) |
127
127
  | **Gemini** | Prompt the real gemini.google.com anonymously — structured answer with cited web sources, the full retrieved search trail, and AEO/GEO brand-visibility analysis | [Gemini Docs](https://docs.scrapebadger.com/gemini/overview) |
128
128
 
129
- ## Quotes, feedback and free re-reads
129
+ ## Quotes, feedback and async polling
130
130
 
131
131
  These calls are free and never billed.
132
132
 
@@ -139,12 +139,6 @@ const client = new ScrapeBadger({ apiKey: "your-api-key" });
139
139
  const quote = await client.agent.quote("GET", "/v1/google/search", { params: { q: "coffee" } });
140
140
  console.log(quote.valid, quote.errors, quote.credits.max, quote.usd, quote.latency);
141
141
 
142
- // Re-read a billed result for ~15 minutes, reshaped. The ID is the call's
143
- // X-Result-ID header (raw HTTP, the CLI) or AsyncRequest.resultId.
144
- const titles = await client.results.get<string[]>(resultId, { jq: "[.organic_results[].title]" });
145
- const outline = await client.results.get(resultId, { summary: true });
146
- const first5 = await client.results.get(resultId, { fields: ["title", "link"], maxItems: 5 });
147
-
148
142
  // Poll a call made with `Prefer: respond-async` (202 + request_id).
149
143
  const state = await client.requests.get(requestId);
150
144
  if (!state.running) console.log(state.status, state.creditsUsed, state.data);
@@ -158,7 +152,7 @@ const info = await client.account.getAccountInfo();
158
152
  const trial = info.agent_trial as AgentTrial | undefined;
159
153
  ```
160
154
 
161
- `results.get` returns the stored body as-is (any JSON value) and throws `NotFoundError` once it has expired. `requests.get` returns `running: true` while the call is in progress — wait `retryAfterSeconds` and poll again; never re-submit the call. Once finished it returns the original body, or throws the original call's error. The SDK's own methods never send `Prefer: respond-async`; `requests.get` polls a request ID obtained elsewhere (raw HTTP, the CLI or MCP server).
155
+ ScrapeBadger does not cache or store responses: every call is fetched fresh and billed, and `results.get` (the old free re-read) is deprecated because `GET /v1/results/{id}` was removed on 2026-11-09. To reshape a result, re-run the call with the `jq`, `fields` or `max_items` view parameters. `requests.get` returns `running: true` while the call is in progress — wait `retryAfterSeconds` and poll again; never re-submit the call. Once finished it returns the original body, or throws the original call's error. The SDK's own methods never send `Prefer: respond-async`; `requests.get` polls a request ID obtained elsewhere (raw HTTP, the CLI or MCP server).
162
156
 
163
157
  ## Error Handling
164
158
 
@@ -263,3 +257,18 @@ MIT License - see [LICENSE](LICENSE) for details.
263
257
  - [Discord](https://discord.com/invite/3WvwTyWVCx)
264
258
  - [GitHub](https://github.com/scrape-badger/scrapebadger-node)
265
259
  - [npm](https://www.npmjs.com/package/scrapebadger)
260
+
261
+ ### Verified public Facebook Marketplace
262
+
263
+ ```typescript
264
+ const page = await client.facebook.searchMarketplace({
265
+ query: "bicycle", location: "london", radius: 20, days_since_listed: 2,
266
+ sort_by: "creation_time_descend", strict_filters: true, include_details: true,
267
+ });
268
+ ```
269
+
270
+ No Facebook account is needed. Verified radius is in kilometres using approximate
271
+ listing coordinates. Follow `end_cursor` with the same filters, even after an empty
272
+ filtered page. Continuations explore price ranges (eight pages maximum, one-hour
273
+ expiry). Coverage and discovery freshness are partial; sort all collected pages by
274
+ `creation_time_utc` and persist IDs for daily deduplication.
package/dist/index.cjs CHANGED
@@ -9,7 +9,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
9
9
  var WebSocket__default = /*#__PURE__*/_interopDefault(WebSocket);
10
10
 
11
11
  // src/internal/version.ts
12
- var SDK_VERSION = "0.76.0";
12
+ var SDK_VERSION = "0.76.2";
13
13
 
14
14
  // src/internal/exceptions.ts
15
15
  var ScrapeBadgerError = class _ScrapeBadgerError extends Error {
@@ -5066,19 +5066,32 @@ var AgentClient = class {
5066
5066
  return this.feedback(summary, { ...options, type: "bug" });
5067
5067
  }
5068
5068
  };
5069
+ var resultsGetWarned = false;
5069
5070
  var ResultsClient = class {
5070
5071
  constructor(client) {
5071
5072
  this.client = client;
5072
5073
  }
5073
5074
  /**
5074
- * Replay a recent result, optionally trimmed. Free.
5075
+ * Deprecated: the API no longer stores results, so there is nothing to re-read.
5075
5076
  *
5076
- * @param resultId - `X-Result-ID` of the original call.
5077
+ * `GET /v1/results/{id}` was removed from the API on 2026-11-09 and answers
5078
+ * 410 Gone, which this method throws as `ScrapeBadgerError`. Re-run the
5079
+ * original call with the `jq`, `fields` or `max_items` view parameters instead
5080
+ * (billed as a normal call). Kept only so existing code fails with a clear
5081
+ * error; it will be removed in a future release.
5082
+ *
5083
+ * @deprecated The API no longer stores results; re-run the call with view params.
5084
+ * @param resultId - ID of a stored result (no longer issued by the API).
5077
5085
  * @param options - `jq`, `fields`, `maxItems`, `summary` view params.
5078
- * @returns The original response body, reshaped — any JSON value.
5079
- * @throws NotFoundError - Unknown result, or it expired (~15 minutes).
5086
+ * @throws ScrapeBadgerError - Always (410 Gone `results_removed`) against the current API.
5080
5087
  */
5081
5088
  async get(resultId, options = {}) {
5089
+ if (!resultsGetWarned) {
5090
+ resultsGetWarned = true;
5091
+ console.warn(
5092
+ "[scrapebadger] results.get() is deprecated: ScrapeBadger stopped storing results on 2026-11-09 and GET /v1/results/{id} answers 410 Gone. Re-run the call with jq/fields/max_items view parameters instead."
5093
+ );
5094
+ }
5082
5095
  const { jq, fields, maxItems, summary } = options;
5083
5096
  return this.client.request(`/v1/results/${encodeURIComponent(resultId)}`, {
5084
5097
  params: {
@@ -5114,7 +5127,8 @@ var RequestsClient = class {
5114
5127
  running,
5115
5128
  status: status ?? 200,
5116
5129
  retryAfterSeconds: retryAfter ?? null,
5117
- resultId: headers?.get("X-Result-ID") ?? null,
5130
+ resultId: null,
5131
+ // deprecated: the API no longer sends X-Result-ID
5118
5132
  creditsUsed: credits && /^\d+$/.test(credits) ? Number(credits) : null,
5119
5133
  data
5120
5134
  };
@@ -6579,7 +6593,9 @@ var FacebookClient = class {
6579
6593
  async resolveATownPostcodeToAMarketplaceLocation(params = {}) {
6580
6594
  return this.client.request("/v1/facebook/marketplace/locations/resolve", { params });
6581
6595
  }
6582
- /** Search Marketplace. Generated from the OpenAPI spec; returns the raw response object. */
6596
+ /** Search public Marketplace. Use strict_filters: true to enforce radius (km) and age,
6597
+ * include_details: true for descriptions/photos. Continuations cover price ranges;
6598
+ * search_info reports partial coverage. Sort all collected pages for newest first. */
6583
6599
  async searchMarketplace(params = {}) {
6584
6600
  return this.client.request("/v1/facebook/marketplace/search", { params });
6585
6601
  }
@@ -10710,7 +10726,10 @@ var ScrapeBadger = class {
10710
10726
  account;
10711
10727
  /** Quote a call before making it, and report bugs or send feedback. Free. */
10712
10728
  agent;
10713
- /** Re-read a recent result (`X-Result-ID`) for free, optionally trimmed. */
10729
+ /**
10730
+ * @deprecated The API no longer stores results (`GET /v1/results/{id}` answers
10731
+ * 410 Gone since 2026-11-09); see `ResultsClient.get`.
10732
+ */
10714
10733
  results;
10715
10734
  /** Poll a call made with `Prefer: respond-async`. Free. */
10716
10735
  requests;