scrapebadger 0.76.1 → 0.76.3

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
 
@@ -2832,10 +2832,18 @@ declare class StreamClient {
2832
2832
  */
2833
2833
  deleteMonitor(monitorId: string): Promise<void>;
2834
2834
  /**
2835
- * List tweet delivery logs.
2835
+ * Deprecated: ScrapeBadger no longer stores delivered tweets.
2836
2836
  *
2837
+ * `GET /v1/twitter/stream/logs` was removed from the API on 2026-11-09 and
2838
+ * answers 410 Gone (`delivery_logs_removed`), which this method throws as
2839
+ * `ScrapeBadgerError`. Each tweet is delivered to your webhook (or WebSocket)
2840
+ * only; keep your own log there. Kept only so existing code fails with a clear
2841
+ * error; it will be removed in a future release.
2842
+ *
2843
+ * @deprecated Delivered tweets are no longer stored; keep your own log at your webhook receiver.
2837
2844
  * @param options - Filter and pagination options.
2838
2845
  * @returns DeliveryLogList with pagination metadata.
2846
+ * @throws ScrapeBadgerError - Always (410 Gone `delivery_logs_removed`) against the current API.
2839
2847
  */
2840
2848
  listDeliveryLogs(options?: {
2841
2849
  monitorId?: string;
@@ -2958,8 +2966,16 @@ declare class StreamClient {
2958
2966
  */
2959
2967
  validateFilterRuleQuery(query: string): Promise<FilterRuleValidateResponse>;
2960
2968
  /**
2961
- * List tweet delivery logs for a specific filter rule.
2969
+ * Deprecated: ScrapeBadger no longer stores delivered tweets.
2970
+ *
2971
+ * `GET /v1/twitter/stream/filter-rules/{id}/logs` was removed from the API on
2972
+ * 2026-11-09 and answers 410 Gone (`delivery_logs_removed`), which this method
2973
+ * throws as `ScrapeBadgerError`. Each tweet is delivered to your webhook only;
2974
+ * keep your own log there. Kept only so existing code fails with a clear error;
2975
+ * it will be removed in a future release.
2962
2976
  *
2977
+ * @deprecated Delivered tweets are no longer stored; keep your own log at your webhook receiver.
2978
+ * @throws ScrapeBadgerError - Always (410 Gone `delivery_logs_removed`) against the current API.
2963
2979
  * @param ruleId - UUID of the filter rule.
2964
2980
  * @param options - Filter and pagination options.
2965
2981
  * @returns FilterRuleDeliveryLogListResponse with pagination metadata.
@@ -2832,10 +2832,18 @@ declare class StreamClient {
2832
2832
  */
2833
2833
  deleteMonitor(monitorId: string): Promise<void>;
2834
2834
  /**
2835
- * List tweet delivery logs.
2835
+ * Deprecated: ScrapeBadger no longer stores delivered tweets.
2836
2836
  *
2837
+ * `GET /v1/twitter/stream/logs` was removed from the API on 2026-11-09 and
2838
+ * answers 410 Gone (`delivery_logs_removed`), which this method throws as
2839
+ * `ScrapeBadgerError`. Each tweet is delivered to your webhook (or WebSocket)
2840
+ * only; keep your own log there. Kept only so existing code fails with a clear
2841
+ * error; it will be removed in a future release.
2842
+ *
2843
+ * @deprecated Delivered tweets are no longer stored; keep your own log at your webhook receiver.
2837
2844
  * @param options - Filter and pagination options.
2838
2845
  * @returns DeliveryLogList with pagination metadata.
2846
+ * @throws ScrapeBadgerError - Always (410 Gone `delivery_logs_removed`) against the current API.
2839
2847
  */
2840
2848
  listDeliveryLogs(options?: {
2841
2849
  monitorId?: string;
@@ -2958,8 +2966,16 @@ declare class StreamClient {
2958
2966
  */
2959
2967
  validateFilterRuleQuery(query: string): Promise<FilterRuleValidateResponse>;
2960
2968
  /**
2961
- * List tweet delivery logs for a specific filter rule.
2969
+ * Deprecated: ScrapeBadger no longer stores delivered tweets.
2970
+ *
2971
+ * `GET /v1/twitter/stream/filter-rules/{id}/logs` was removed from the API on
2972
+ * 2026-11-09 and answers 410 Gone (`delivery_logs_removed`), which this method
2973
+ * throws as `ScrapeBadgerError`. Each tweet is delivered to your webhook only;
2974
+ * keep your own log there. Kept only so existing code fails with a clear error;
2975
+ * it will be removed in a future release.
2962
2976
  *
2977
+ * @deprecated Delivered tweets are no longer stored; keep your own log at your webhook receiver.
2978
+ * @throws ScrapeBadgerError - Always (410 Gone `delivery_logs_removed`) against the current API.
2963
2979
  * @param ruleId - UUID of the filter rule.
2964
2980
  * @param options - Filter and pagination options.
2965
2981
  * @returns FilterRuleDeliveryLogListResponse with pagination metadata.
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.1";
12
+ var SDK_VERSION = "0.76.3";
13
13
 
14
14
  // src/internal/exceptions.ts
15
15
  var ScrapeBadgerError = class _ScrapeBadgerError extends Error {
@@ -1872,6 +1872,8 @@ function parseEvent(raw) {
1872
1872
  };
1873
1873
  }
1874
1874
  }
1875
+ var deliveryLogsWarned = false;
1876
+ var filterRuleLogsWarned = false;
1875
1877
  var StreamClient = class {
1876
1878
  client;
1877
1879
  constructor(client) {
@@ -2027,12 +2029,26 @@ var StreamClient = class {
2027
2029
  // Delivery and Billing Logs
2028
2030
  // ===========================================================================
2029
2031
  /**
2030
- * List tweet delivery logs.
2032
+ * Deprecated: ScrapeBadger no longer stores delivered tweets.
2031
2033
  *
2034
+ * `GET /v1/twitter/stream/logs` was removed from the API on 2026-11-09 and
2035
+ * answers 410 Gone (`delivery_logs_removed`), which this method throws as
2036
+ * `ScrapeBadgerError`. Each tweet is delivered to your webhook (or WebSocket)
2037
+ * only; keep your own log there. Kept only so existing code fails with a clear
2038
+ * error; it will be removed in a future release.
2039
+ *
2040
+ * @deprecated Delivered tweets are no longer stored; keep your own log at your webhook receiver.
2032
2041
  * @param options - Filter and pagination options.
2033
2042
  * @returns DeliveryLogList with pagination metadata.
2043
+ * @throws ScrapeBadgerError - Always (410 Gone `delivery_logs_removed`) against the current API.
2034
2044
  */
2035
2045
  async listDeliveryLogs(options) {
2046
+ if (!deliveryLogsWarned) {
2047
+ deliveryLogsWarned = true;
2048
+ console.warn(
2049
+ "[scrapebadger] listDeliveryLogs() is deprecated: ScrapeBadger stopped storing delivered tweets on 2026-11-09 and GET /v1/twitter/stream/logs answers 410 Gone. Keep your own log at your webhook receiver."
2050
+ );
2051
+ }
2036
2052
  const params = {
2037
2053
  page: options?.page ?? 1,
2038
2054
  page_size: options?.pageSize ?? 20,
@@ -2209,8 +2225,16 @@ var StreamClient = class {
2209
2225
  );
2210
2226
  }
2211
2227
  /**
2212
- * List tweet delivery logs for a specific filter rule.
2228
+ * Deprecated: ScrapeBadger no longer stores delivered tweets.
2213
2229
  *
2230
+ * `GET /v1/twitter/stream/filter-rules/{id}/logs` was removed from the API on
2231
+ * 2026-11-09 and answers 410 Gone (`delivery_logs_removed`), which this method
2232
+ * throws as `ScrapeBadgerError`. Each tweet is delivered to your webhook only;
2233
+ * keep your own log there. Kept only so existing code fails with a clear error;
2234
+ * it will be removed in a future release.
2235
+ *
2236
+ * @deprecated Delivered tweets are no longer stored; keep your own log at your webhook receiver.
2237
+ * @throws ScrapeBadgerError - Always (410 Gone `delivery_logs_removed`) against the current API.
2214
2238
  * @param ruleId - UUID of the filter rule.
2215
2239
  * @param options - Filter and pagination options.
2216
2240
  * @returns FilterRuleDeliveryLogListResponse with pagination metadata.
@@ -2224,6 +2248,12 @@ var StreamClient = class {
2224
2248
  * ```
2225
2249
  */
2226
2250
  async listFilterRuleLogs(ruleId, options) {
2251
+ if (!filterRuleLogsWarned) {
2252
+ filterRuleLogsWarned = true;
2253
+ console.warn(
2254
+ "[scrapebadger] listFilterRuleLogs() is deprecated: ScrapeBadger stopped storing delivered tweets on 2026-11-09 and GET /v1/twitter/stream/filter-rules/{id}/logs answers 410 Gone. Keep your own log at your webhook receiver."
2255
+ );
2256
+ }
2227
2257
  const params = {
2228
2258
  limit: options?.limit ?? 20,
2229
2259
  offset: options?.offset ?? 0,
@@ -5066,19 +5096,32 @@ var AgentClient = class {
5066
5096
  return this.feedback(summary, { ...options, type: "bug" });
5067
5097
  }
5068
5098
  };
5099
+ var resultsGetWarned = false;
5069
5100
  var ResultsClient = class {
5070
5101
  constructor(client) {
5071
5102
  this.client = client;
5072
5103
  }
5073
5104
  /**
5074
- * Replay a recent result, optionally trimmed. Free.
5105
+ * Deprecated: the API no longer stores results, so there is nothing to re-read.
5075
5106
  *
5076
- * @param resultId - `X-Result-ID` of the original call.
5107
+ * `GET /v1/results/{id}` was removed from the API on 2026-11-09 and answers
5108
+ * 410 Gone, which this method throws as `ScrapeBadgerError`. Re-run the
5109
+ * original call with the `jq`, `fields` or `max_items` view parameters instead
5110
+ * (billed as a normal call). Kept only so existing code fails with a clear
5111
+ * error; it will be removed in a future release.
5112
+ *
5113
+ * @deprecated The API no longer stores results; re-run the call with view params.
5114
+ * @param resultId - ID of a stored result (no longer issued by the API).
5077
5115
  * @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).
5116
+ * @throws ScrapeBadgerError - Always (410 Gone `results_removed`) against the current API.
5080
5117
  */
5081
5118
  async get(resultId, options = {}) {
5119
+ if (!resultsGetWarned) {
5120
+ resultsGetWarned = true;
5121
+ console.warn(
5122
+ "[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."
5123
+ );
5124
+ }
5082
5125
  const { jq, fields, maxItems, summary } = options;
5083
5126
  return this.client.request(`/v1/results/${encodeURIComponent(resultId)}`, {
5084
5127
  params: {
@@ -5114,7 +5157,8 @@ var RequestsClient = class {
5114
5157
  running,
5115
5158
  status: status ?? 200,
5116
5159
  retryAfterSeconds: retryAfter ?? null,
5117
- resultId: headers?.get("X-Result-ID") ?? null,
5160
+ resultId: null,
5161
+ // deprecated: the API no longer sends X-Result-ID
5118
5162
  creditsUsed: credits && /^\d+$/.test(credits) ? Number(credits) : null,
5119
5163
  data
5120
5164
  };
@@ -10712,7 +10756,10 @@ var ScrapeBadger = class {
10712
10756
  account;
10713
10757
  /** Quote a call before making it, and report bugs or send feedback. Free. */
10714
10758
  agent;
10715
- /** Re-read a recent result (`X-Result-ID`) for free, optionally trimmed. */
10759
+ /**
10760
+ * @deprecated The API no longer stores results (`GET /v1/results/{id}` answers
10761
+ * 410 Gone since 2026-11-09); see `ResultsClient.get`.
10762
+ */
10716
10763
  results;
10717
10764
  /** Poll a call made with `Prefer: respond-async`. Free. */
10718
10765
  requests;