scrapebadger 0.67.0 → 0.68.0

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/dist/index.mjs CHANGED
@@ -5083,6 +5083,31 @@ var RequestsClient = class {
5083
5083
  data
5084
5084
  };
5085
5085
  }
5086
+ /**
5087
+ * Submit up to 100 GET reads as async requests in one call. Submitting is free.
5088
+ *
5089
+ * Each item runs under this key with the same auth, credit check, rate limit
5090
+ * and price as if sent alone; at most 10 of a batch run at a time.
5091
+ *
5092
+ * @example
5093
+ * ```typescript
5094
+ * const sub = await client.requests.batch(
5095
+ * prompts.map((prompt) => ({ path: "/v1/chatgpt/ask", query: { prompt } })),
5096
+ * { callbackUrl: "https://example.com/hook" }
5097
+ * );
5098
+ * const ids = sub.requests.filter((r) => r.accepted).map((r) => r.request_id);
5099
+ * ```
5100
+ *
5101
+ * @param items - `{ path: "/v1/...", query: {...} }` (method defaults to GET).
5102
+ * @param options - `callbackUrl` for one signed webhook per item.
5103
+ * @returns A request_id (or the refusal) for every item.
5104
+ */
5105
+ async batch(items, options = {}) {
5106
+ return this.client.request("/v1/batch", {
5107
+ method: "POST",
5108
+ body: { requests: items, callback_url: options.callbackUrl }
5109
+ });
5110
+ }
5086
5111
  };
5087
5112
 
5088
5113
  // src/airbnb/client.ts