scrapebadger 0.76.1 → 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 +2 -8
- package/dist/index.cjs +24 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -14
- package/dist/index.d.ts +33 -14
- package/dist/index.mjs +24 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1200,7 +1200,10 @@ interface GoogleSearchParams {
|
|
|
1200
1200
|
tbm?: string;
|
|
1201
1201
|
/** Google result filter: 14 web, 18 forums. Other verticals require output=html. */
|
|
1202
1202
|
udm?: string;
|
|
1203
|
-
/**
|
|
1203
|
+
/**
|
|
1204
|
+
* No effect: ScrapeBadger no longer caches responses, so every call is a
|
|
1205
|
+
* fresh Google fetch. Kept for compatibility.
|
|
1206
|
+
*/
|
|
1204
1207
|
no_cache?: boolean;
|
|
1205
1208
|
/** Site restriction mode: i includes, e excludes as_sitesearch. */
|
|
1206
1209
|
as_dt?: string;
|
|
@@ -5567,7 +5570,7 @@ declare class AccountClient {
|
|
|
5567
5570
|
/**
|
|
5568
5571
|
* TypeScript types for the agent platform endpoints.
|
|
5569
5572
|
*
|
|
5570
|
-
* Quote, feedback
|
|
5573
|
+
* Quote, feedback and async-request polling — the
|
|
5571
5574
|
* account-level helpers an agent uses around the scraper APIs. None of these
|
|
5572
5575
|
* calls is ever billed.
|
|
5573
5576
|
*/
|
|
@@ -5681,7 +5684,10 @@ interface AsyncRequest<T = unknown> {
|
|
|
5681
5684
|
status: number;
|
|
5682
5685
|
/** Suggested wait before the next poll (running only). */
|
|
5683
5686
|
retryAfterSeconds: number | null;
|
|
5684
|
-
/**
|
|
5687
|
+
/**
|
|
5688
|
+
* @deprecated Always `null`: the API stopped sending `X-Result-ID` (and
|
|
5689
|
+
* storing results for re-reads) on 2026-11-09.
|
|
5690
|
+
*/
|
|
5685
5691
|
resultId: string | null;
|
|
5686
5692
|
/** `X-Credits-Used` of the finished call. */
|
|
5687
5693
|
creditsUsed: number | null;
|
|
@@ -5746,8 +5752,9 @@ interface AgentTrial {
|
|
|
5746
5752
|
* Agent platform API clients.
|
|
5747
5753
|
*
|
|
5748
5754
|
* Free helpers around the scraper APIs: quote a call before making it, report
|
|
5749
|
-
* a bug,
|
|
5750
|
-
* `
|
|
5755
|
+
* a bug, and poll a call made with `Prefer: respond-async`. None of these calls
|
|
5756
|
+
* is ever billed. (`results.get` is deprecated: the API stopped storing results
|
|
5757
|
+
* on 2026-11-09.)
|
|
5751
5758
|
*/
|
|
5752
5759
|
|
|
5753
5760
|
/**
|
|
@@ -5797,22 +5804,31 @@ declare class AgentClient$1 {
|
|
|
5797
5804
|
reportBug(summary: string, options?: Omit<FeedbackOptions, "type">): Promise<FeedbackReceipt>;
|
|
5798
5805
|
}
|
|
5799
5806
|
/**
|
|
5800
|
-
*
|
|
5807
|
+
* Deprecated client for the removed `GET /v1/results/{id}` re-read.
|
|
5801
5808
|
*
|
|
5802
|
-
*
|
|
5803
|
-
*
|
|
5804
|
-
*
|
|
5809
|
+
* ScrapeBadger no longer stores results: responses carry no `X-Result-ID` and
|
|
5810
|
+
* `GET /v1/results/{id}` answers 410 Gone since 2026-11-09. To get a different
|
|
5811
|
+
* shape of a result, re-run the call with the `jq`, `fields` or `max_items`
|
|
5812
|
+
* view parameters (billed as a normal call).
|
|
5813
|
+
*
|
|
5814
|
+
* @deprecated The API no longer stores results; this client will be removed.
|
|
5805
5815
|
*/
|
|
5806
5816
|
declare class ResultsClient {
|
|
5807
5817
|
private readonly client;
|
|
5808
5818
|
constructor(client: BaseClient);
|
|
5809
5819
|
/**
|
|
5810
|
-
*
|
|
5820
|
+
* Deprecated: the API no longer stores results, so there is nothing to re-read.
|
|
5821
|
+
*
|
|
5822
|
+
* `GET /v1/results/{id}` was removed from the API on 2026-11-09 and answers
|
|
5823
|
+
* 410 Gone, which this method throws as `ScrapeBadgerError`. Re-run the
|
|
5824
|
+
* original call with the `jq`, `fields` or `max_items` view parameters instead
|
|
5825
|
+
* (billed as a normal call). Kept only so existing code fails with a clear
|
|
5826
|
+
* error; it will be removed in a future release.
|
|
5811
5827
|
*
|
|
5812
|
-
* @
|
|
5828
|
+
* @deprecated The API no longer stores results; re-run the call with view params.
|
|
5829
|
+
* @param resultId - ID of a stored result (no longer issued by the API).
|
|
5813
5830
|
* @param options - `jq`, `fields`, `maxItems`, `summary` view params.
|
|
5814
|
-
* @
|
|
5815
|
-
* @throws NotFoundError - Unknown result, or it expired (~15 minutes).
|
|
5831
|
+
* @throws ScrapeBadgerError - Always (410 Gone `results_removed`) against the current API.
|
|
5816
5832
|
*/
|
|
5817
5833
|
get<T = unknown>(resultId: string, options?: ResultViewOptions): Promise<T>;
|
|
5818
5834
|
}
|
|
@@ -20332,7 +20348,10 @@ declare class ScrapeBadger {
|
|
|
20332
20348
|
readonly account: AccountClient;
|
|
20333
20349
|
/** Quote a call before making it, and report bugs or send feedback. Free. */
|
|
20334
20350
|
readonly agent: AgentClient$1;
|
|
20335
|
-
/**
|
|
20351
|
+
/**
|
|
20352
|
+
* @deprecated The API no longer stores results (`GET /v1/results/{id}` answers
|
|
20353
|
+
* 410 Gone since 2026-11-09); see `ResultsClient.get`.
|
|
20354
|
+
*/
|
|
20336
20355
|
readonly results: ResultsClient;
|
|
20337
20356
|
/** Poll a call made with `Prefer: respond-async`. Free. */
|
|
20338
20357
|
readonly requests: RequestsClient;
|
package/dist/index.d.ts
CHANGED
|
@@ -1200,7 +1200,10 @@ interface GoogleSearchParams {
|
|
|
1200
1200
|
tbm?: string;
|
|
1201
1201
|
/** Google result filter: 14 web, 18 forums. Other verticals require output=html. */
|
|
1202
1202
|
udm?: string;
|
|
1203
|
-
/**
|
|
1203
|
+
/**
|
|
1204
|
+
* No effect: ScrapeBadger no longer caches responses, so every call is a
|
|
1205
|
+
* fresh Google fetch. Kept for compatibility.
|
|
1206
|
+
*/
|
|
1204
1207
|
no_cache?: boolean;
|
|
1205
1208
|
/** Site restriction mode: i includes, e excludes as_sitesearch. */
|
|
1206
1209
|
as_dt?: string;
|
|
@@ -5567,7 +5570,7 @@ declare class AccountClient {
|
|
|
5567
5570
|
/**
|
|
5568
5571
|
* TypeScript types for the agent platform endpoints.
|
|
5569
5572
|
*
|
|
5570
|
-
* Quote, feedback
|
|
5573
|
+
* Quote, feedback and async-request polling — the
|
|
5571
5574
|
* account-level helpers an agent uses around the scraper APIs. None of these
|
|
5572
5575
|
* calls is ever billed.
|
|
5573
5576
|
*/
|
|
@@ -5681,7 +5684,10 @@ interface AsyncRequest<T = unknown> {
|
|
|
5681
5684
|
status: number;
|
|
5682
5685
|
/** Suggested wait before the next poll (running only). */
|
|
5683
5686
|
retryAfterSeconds: number | null;
|
|
5684
|
-
/**
|
|
5687
|
+
/**
|
|
5688
|
+
* @deprecated Always `null`: the API stopped sending `X-Result-ID` (and
|
|
5689
|
+
* storing results for re-reads) on 2026-11-09.
|
|
5690
|
+
*/
|
|
5685
5691
|
resultId: string | null;
|
|
5686
5692
|
/** `X-Credits-Used` of the finished call. */
|
|
5687
5693
|
creditsUsed: number | null;
|
|
@@ -5746,8 +5752,9 @@ interface AgentTrial {
|
|
|
5746
5752
|
* Agent platform API clients.
|
|
5747
5753
|
*
|
|
5748
5754
|
* Free helpers around the scraper APIs: quote a call before making it, report
|
|
5749
|
-
* a bug,
|
|
5750
|
-
* `
|
|
5755
|
+
* a bug, and poll a call made with `Prefer: respond-async`. None of these calls
|
|
5756
|
+
* is ever billed. (`results.get` is deprecated: the API stopped storing results
|
|
5757
|
+
* on 2026-11-09.)
|
|
5751
5758
|
*/
|
|
5752
5759
|
|
|
5753
5760
|
/**
|
|
@@ -5797,22 +5804,31 @@ declare class AgentClient$1 {
|
|
|
5797
5804
|
reportBug(summary: string, options?: Omit<FeedbackOptions, "type">): Promise<FeedbackReceipt>;
|
|
5798
5805
|
}
|
|
5799
5806
|
/**
|
|
5800
|
-
*
|
|
5807
|
+
* Deprecated client for the removed `GET /v1/results/{id}` re-read.
|
|
5801
5808
|
*
|
|
5802
|
-
*
|
|
5803
|
-
*
|
|
5804
|
-
*
|
|
5809
|
+
* ScrapeBadger no longer stores results: responses carry no `X-Result-ID` and
|
|
5810
|
+
* `GET /v1/results/{id}` answers 410 Gone since 2026-11-09. To get a different
|
|
5811
|
+
* shape of a result, re-run the call with the `jq`, `fields` or `max_items`
|
|
5812
|
+
* view parameters (billed as a normal call).
|
|
5813
|
+
*
|
|
5814
|
+
* @deprecated The API no longer stores results; this client will be removed.
|
|
5805
5815
|
*/
|
|
5806
5816
|
declare class ResultsClient {
|
|
5807
5817
|
private readonly client;
|
|
5808
5818
|
constructor(client: BaseClient);
|
|
5809
5819
|
/**
|
|
5810
|
-
*
|
|
5820
|
+
* Deprecated: the API no longer stores results, so there is nothing to re-read.
|
|
5821
|
+
*
|
|
5822
|
+
* `GET /v1/results/{id}` was removed from the API on 2026-11-09 and answers
|
|
5823
|
+
* 410 Gone, which this method throws as `ScrapeBadgerError`. Re-run the
|
|
5824
|
+
* original call with the `jq`, `fields` or `max_items` view parameters instead
|
|
5825
|
+
* (billed as a normal call). Kept only so existing code fails with a clear
|
|
5826
|
+
* error; it will be removed in a future release.
|
|
5811
5827
|
*
|
|
5812
|
-
* @
|
|
5828
|
+
* @deprecated The API no longer stores results; re-run the call with view params.
|
|
5829
|
+
* @param resultId - ID of a stored result (no longer issued by the API).
|
|
5813
5830
|
* @param options - `jq`, `fields`, `maxItems`, `summary` view params.
|
|
5814
|
-
* @
|
|
5815
|
-
* @throws NotFoundError - Unknown result, or it expired (~15 minutes).
|
|
5831
|
+
* @throws ScrapeBadgerError - Always (410 Gone `results_removed`) against the current API.
|
|
5816
5832
|
*/
|
|
5817
5833
|
get<T = unknown>(resultId: string, options?: ResultViewOptions): Promise<T>;
|
|
5818
5834
|
}
|
|
@@ -20332,7 +20348,10 @@ declare class ScrapeBadger {
|
|
|
20332
20348
|
readonly account: AccountClient;
|
|
20333
20349
|
/** Quote a call before making it, and report bugs or send feedback. Free. */
|
|
20334
20350
|
readonly agent: AgentClient$1;
|
|
20335
|
-
/**
|
|
20351
|
+
/**
|
|
20352
|
+
* @deprecated The API no longer stores results (`GET /v1/results/{id}` answers
|
|
20353
|
+
* 410 Gone since 2026-11-09); see `ResultsClient.get`.
|
|
20354
|
+
*/
|
|
20336
20355
|
readonly results: ResultsClient;
|
|
20337
20356
|
/** Poll a call made with `Prefer: respond-async`. Free. */
|
|
20338
20357
|
readonly requests: RequestsClient;
|
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { EventEmitter } from 'events';
|
|
|
3
3
|
import WebSocket from 'ws';
|
|
4
4
|
|
|
5
5
|
// src/internal/version.ts
|
|
6
|
-
var SDK_VERSION = "0.76.
|
|
6
|
+
var SDK_VERSION = "0.76.2";
|
|
7
7
|
|
|
8
8
|
// src/internal/exceptions.ts
|
|
9
9
|
var ScrapeBadgerError = class _ScrapeBadgerError extends Error {
|
|
@@ -5060,19 +5060,32 @@ var AgentClient = class {
|
|
|
5060
5060
|
return this.feedback(summary, { ...options, type: "bug" });
|
|
5061
5061
|
}
|
|
5062
5062
|
};
|
|
5063
|
+
var resultsGetWarned = false;
|
|
5063
5064
|
var ResultsClient = class {
|
|
5064
5065
|
constructor(client) {
|
|
5065
5066
|
this.client = client;
|
|
5066
5067
|
}
|
|
5067
5068
|
/**
|
|
5068
|
-
*
|
|
5069
|
+
* Deprecated: the API no longer stores results, so there is nothing to re-read.
|
|
5069
5070
|
*
|
|
5070
|
-
*
|
|
5071
|
+
* `GET /v1/results/{id}` was removed from the API on 2026-11-09 and answers
|
|
5072
|
+
* 410 Gone, which this method throws as `ScrapeBadgerError`. Re-run the
|
|
5073
|
+
* original call with the `jq`, `fields` or `max_items` view parameters instead
|
|
5074
|
+
* (billed as a normal call). Kept only so existing code fails with a clear
|
|
5075
|
+
* error; it will be removed in a future release.
|
|
5076
|
+
*
|
|
5077
|
+
* @deprecated The API no longer stores results; re-run the call with view params.
|
|
5078
|
+
* @param resultId - ID of a stored result (no longer issued by the API).
|
|
5071
5079
|
* @param options - `jq`, `fields`, `maxItems`, `summary` view params.
|
|
5072
|
-
* @
|
|
5073
|
-
* @throws NotFoundError - Unknown result, or it expired (~15 minutes).
|
|
5080
|
+
* @throws ScrapeBadgerError - Always (410 Gone `results_removed`) against the current API.
|
|
5074
5081
|
*/
|
|
5075
5082
|
async get(resultId, options = {}) {
|
|
5083
|
+
if (!resultsGetWarned) {
|
|
5084
|
+
resultsGetWarned = true;
|
|
5085
|
+
console.warn(
|
|
5086
|
+
"[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."
|
|
5087
|
+
);
|
|
5088
|
+
}
|
|
5076
5089
|
const { jq, fields, maxItems, summary } = options;
|
|
5077
5090
|
return this.client.request(`/v1/results/${encodeURIComponent(resultId)}`, {
|
|
5078
5091
|
params: {
|
|
@@ -5108,7 +5121,8 @@ var RequestsClient = class {
|
|
|
5108
5121
|
running,
|
|
5109
5122
|
status: status ?? 200,
|
|
5110
5123
|
retryAfterSeconds: retryAfter ?? null,
|
|
5111
|
-
resultId:
|
|
5124
|
+
resultId: null,
|
|
5125
|
+
// deprecated: the API no longer sends X-Result-ID
|
|
5112
5126
|
creditsUsed: credits && /^\d+$/.test(credits) ? Number(credits) : null,
|
|
5113
5127
|
data
|
|
5114
5128
|
};
|
|
@@ -10706,7 +10720,10 @@ var ScrapeBadger = class {
|
|
|
10706
10720
|
account;
|
|
10707
10721
|
/** Quote a call before making it, and report bugs or send feedback. Free. */
|
|
10708
10722
|
agent;
|
|
10709
|
-
/**
|
|
10723
|
+
/**
|
|
10724
|
+
* @deprecated The API no longer stores results (`GET /v1/results/{id}` answers
|
|
10725
|
+
* 410 Gone since 2026-11-09); see `ResultsClient.get`.
|
|
10726
|
+
*/
|
|
10710
10727
|
results;
|
|
10711
10728
|
/** Poll a call made with `Prefer: respond-async`. Free. */
|
|
10712
10729
|
requests;
|