scrapebadger 0.64.0 → 0.65.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/README.md +34 -0
- package/dist/{index-MBQ1Ksjt.d.cts → index-CQ1vFI8s.d.cts} +5 -1
- package/dist/{index-MBQ1Ksjt.d.ts → index-CQ1vFI8s.d.ts} +5 -1
- package/dist/index.d.cts +273 -131
- package/dist/index.d.ts +273 -131
- package/dist/index.js +157 -134
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +154 -134
- package/dist/index.mjs.map +1 -1
- package/dist/twitter/index.d.cts +1 -1
- package/dist/twitter/index.d.ts +1 -1
- package/package.json +1 -1
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.
|
|
6
|
+
var SDK_VERSION = "0.65.0";
|
|
7
7
|
|
|
8
8
|
// src/internal/exceptions.ts
|
|
9
9
|
var ScrapeBadgerError = class _ScrapeBadgerError extends Error {
|
|
@@ -207,7 +207,7 @@ var BaseClient = class _BaseClient {
|
|
|
207
207
|
};
|
|
208
208
|
}
|
|
209
209
|
/**
|
|
210
|
-
* Make an HTTP request and return
|
|
210
|
+
* Make an HTTP request and return the data with its rate limit, status and headers.
|
|
211
211
|
*/
|
|
212
212
|
async requestWithHeaders(path, options = {}) {
|
|
213
213
|
return this.requestRaw(path, options);
|
|
@@ -270,7 +270,7 @@ var BaseClient = class _BaseClient {
|
|
|
270
270
|
}
|
|
271
271
|
const data = await this.handleResponse(httpResponse);
|
|
272
272
|
const rateLimit = this.parseRateLimitHeaders(httpResponse.headers);
|
|
273
|
-
return { data, rateLimit };
|
|
273
|
+
return { data, rateLimit, status: httpResponse.status, headers: httpResponse.headers };
|
|
274
274
|
} catch (error) {
|
|
275
275
|
lastError = error;
|
|
276
276
|
if (!_BaseClient.isRetryable(error)) {
|
|
@@ -4585,17 +4585,11 @@ var UsersClient4 = class {
|
|
|
4585
4585
|
async get(username) {
|
|
4586
4586
|
return this.client.request(`/v1/instagram/users/${username}`);
|
|
4587
4587
|
}
|
|
4588
|
-
/**
|
|
4589
|
-
* Get "About this account" metadata for a user.
|
|
4590
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4591
|
-
*/
|
|
4588
|
+
/** Get "About this account" metadata for a user. */
|
|
4592
4589
|
async about(username) {
|
|
4593
4590
|
return this.client.request(`/v1/instagram/users/${username}/about`);
|
|
4594
4591
|
}
|
|
4595
|
-
/**
|
|
4596
|
-
* Get accounts related/suggested for a user.
|
|
4597
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4598
|
-
*/
|
|
4592
|
+
/** Get accounts related/suggested for a user. */
|
|
4599
4593
|
async related(username) {
|
|
4600
4594
|
return this.client.request(`/v1/instagram/users/${username}/related`);
|
|
4601
4595
|
}
|
|
@@ -4604,36 +4598,25 @@ var UsersClient4 = class {
|
|
|
4604
4598
|
return this.media(`/v1/instagram/users/${username}/posts`, options);
|
|
4605
4599
|
}
|
|
4606
4600
|
/**
|
|
4607
|
-
* Get a user's video posts
|
|
4608
|
-
*
|
|
4601
|
+
* Get a user's video posts from their feed. A page may hold slightly more than
|
|
4602
|
+
* `amount` items; pass `next_cursor` back as `cursor` to continue the feed.
|
|
4609
4603
|
*/
|
|
4610
4604
|
async videos(username, options = {}) {
|
|
4611
4605
|
return this.media(`/v1/instagram/users/${username}/videos`, options);
|
|
4612
4606
|
}
|
|
4613
|
-
/**
|
|
4614
|
-
* Get a user's reels.
|
|
4615
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4616
|
-
*/
|
|
4607
|
+
/** Get a user's reels. */
|
|
4617
4608
|
async reels(username, options = {}) {
|
|
4618
4609
|
return this.media(`/v1/instagram/users/${username}/reels`, options);
|
|
4619
4610
|
}
|
|
4620
|
-
/**
|
|
4621
|
-
* Get media a user is tagged in.
|
|
4622
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4623
|
-
*/
|
|
4611
|
+
/** Get media a user is tagged in. */
|
|
4624
4612
|
async tagged(username, options = {}) {
|
|
4625
4613
|
return this.media(`/v1/instagram/users/${username}/tagged`, options);
|
|
4626
4614
|
}
|
|
4627
|
-
/**
|
|
4628
|
-
* Get a user's pinned posts.
|
|
4629
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4630
|
-
*/
|
|
4615
|
+
/** Get a user's pinned posts. */
|
|
4631
4616
|
async pinned(username) {
|
|
4632
4617
|
return this.client.request(`/v1/instagram/users/${username}/pinned`);
|
|
4633
4618
|
}
|
|
4634
4619
|
/**
|
|
4635
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4636
|
-
*
|
|
4637
4620
|
* Get a user's followers.
|
|
4638
4621
|
*
|
|
4639
4622
|
* @param username - Instagram username.
|
|
@@ -4650,19 +4633,13 @@ var UsersClient4 = class {
|
|
|
4650
4633
|
}
|
|
4651
4634
|
});
|
|
4652
4635
|
}
|
|
4653
|
-
/**
|
|
4654
|
-
* Get the accounts a user follows.
|
|
4655
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4656
|
-
*/
|
|
4636
|
+
/** Get the accounts a user follows. */
|
|
4657
4637
|
async following(username, options = {}) {
|
|
4658
4638
|
return this.client.request(`/v1/instagram/users/${username}/following`, {
|
|
4659
4639
|
params: { amount: options.amount, cursor: options.cursor }
|
|
4660
4640
|
});
|
|
4661
4641
|
}
|
|
4662
|
-
/**
|
|
4663
|
-
* Search within a user's followers by name/username.
|
|
4664
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4665
|
-
*/
|
|
4642
|
+
/** Search within a user's followers by name/username. */
|
|
4666
4643
|
async searchFollowers(username, query, options = {}) {
|
|
4667
4644
|
return this.client.request(
|
|
4668
4645
|
`/v1/instagram/users/${username}/followers/search`,
|
|
@@ -4671,17 +4648,11 @@ var UsersClient4 = class {
|
|
|
4671
4648
|
}
|
|
4672
4649
|
);
|
|
4673
4650
|
}
|
|
4674
|
-
/**
|
|
4675
|
-
* Get a user's currently-live stories.
|
|
4676
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4677
|
-
*/
|
|
4651
|
+
/** Get a user's currently-live stories. */
|
|
4678
4652
|
async stories(username) {
|
|
4679
4653
|
return this.client.request(`/v1/instagram/users/${username}/stories`);
|
|
4680
4654
|
}
|
|
4681
|
-
/**
|
|
4682
|
-
* Get a user's story highlights.
|
|
4683
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4684
|
-
*/
|
|
4655
|
+
/** Get a user's story highlights. */
|
|
4685
4656
|
async highlights(username) {
|
|
4686
4657
|
return this.client.request(`/v1/instagram/users/${username}/highlights`);
|
|
4687
4658
|
}
|
|
@@ -4706,10 +4677,7 @@ var MediaClient = class {
|
|
|
4706
4677
|
async get(code) {
|
|
4707
4678
|
return this.client.request(`/v1/instagram/media/${code}`);
|
|
4708
4679
|
}
|
|
4709
|
-
/**
|
|
4710
|
-
* Get oEmbed metadata for a media permalink.
|
|
4711
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4712
|
-
*/
|
|
4680
|
+
/** Get oEmbed metadata for a media permalink. */
|
|
4713
4681
|
async oembed(code) {
|
|
4714
4682
|
return this.client.request(`/v1/instagram/media/${code}/oembed`);
|
|
4715
4683
|
}
|
|
@@ -4719,27 +4687,18 @@ var MediaClient = class {
|
|
|
4719
4687
|
params: { amount: options.amount, cursor: options.cursor }
|
|
4720
4688
|
});
|
|
4721
4689
|
}
|
|
4722
|
-
/**
|
|
4723
|
-
* Get the users who liked a media.
|
|
4724
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4725
|
-
*/
|
|
4690
|
+
/** Get the users who liked a media. */
|
|
4726
4691
|
async likers(code) {
|
|
4727
4692
|
return this.client.request(`/v1/instagram/media/${code}/likers`);
|
|
4728
4693
|
}
|
|
4729
|
-
/**
|
|
4730
|
-
* Get replies to a comment.
|
|
4731
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4732
|
-
*/
|
|
4694
|
+
/** Get replies to a comment. */
|
|
4733
4695
|
async replies(code, commentId, options = {}) {
|
|
4734
4696
|
return this.client.request(
|
|
4735
4697
|
`/v1/instagram/media/${code}/comments/${commentId}/replies`,
|
|
4736
4698
|
{ params: { amount: options.amount, cursor: options.cursor } }
|
|
4737
4699
|
);
|
|
4738
4700
|
}
|
|
4739
|
-
/**
|
|
4740
|
-
* Get the users who liked a comment.
|
|
4741
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4742
|
-
*/
|
|
4701
|
+
/** Get the users who liked a comment. */
|
|
4743
4702
|
async commentLikers(code, commentId) {
|
|
4744
4703
|
return this.client.request(
|
|
4745
4704
|
`/v1/instagram/media/${code}/comments/${commentId}/likers`
|
|
@@ -4753,64 +4712,43 @@ var SearchClient4 = class {
|
|
|
4753
4712
|
constructor(client) {
|
|
4754
4713
|
this.client = client;
|
|
4755
4714
|
}
|
|
4756
|
-
/**
|
|
4757
|
-
* Search accounts by name/username.
|
|
4758
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4759
|
-
*/
|
|
4715
|
+
/** Search accounts by name/username. */
|
|
4760
4716
|
async users(query) {
|
|
4761
4717
|
return this.client.request("/v1/instagram/search/users", {
|
|
4762
4718
|
params: { query }
|
|
4763
4719
|
});
|
|
4764
4720
|
}
|
|
4765
|
-
/**
|
|
4766
|
-
* Search hashtags.
|
|
4767
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4768
|
-
*/
|
|
4721
|
+
/** Search hashtags. */
|
|
4769
4722
|
async hashtags(query) {
|
|
4770
4723
|
return this.client.request("/v1/instagram/search/hashtags", {
|
|
4771
4724
|
params: { query }
|
|
4772
4725
|
});
|
|
4773
4726
|
}
|
|
4774
|
-
/**
|
|
4775
|
-
* Search places/locations.
|
|
4776
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4777
|
-
*/
|
|
4727
|
+
/** Search places/locations (global ranking). */
|
|
4778
4728
|
async places(query) {
|
|
4779
4729
|
return this.client.request("/v1/instagram/search/places", {
|
|
4780
4730
|
params: { query }
|
|
4781
4731
|
});
|
|
4782
4732
|
}
|
|
4783
|
-
/**
|
|
4784
|
-
* Search reels.
|
|
4785
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4786
|
-
*/
|
|
4733
|
+
/** Search reels. */
|
|
4787
4734
|
async reels(query) {
|
|
4788
4735
|
return this.client.request("/v1/instagram/search/reels", {
|
|
4789
4736
|
params: { query }
|
|
4790
4737
|
});
|
|
4791
4738
|
}
|
|
4792
|
-
/**
|
|
4793
|
-
* Search music/audio tracks.
|
|
4794
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4795
|
-
*/
|
|
4739
|
+
/** Search music/audio tracks. */
|
|
4796
4740
|
async music(query) {
|
|
4797
4741
|
return this.client.request("/v1/instagram/search/music", {
|
|
4798
4742
|
params: { query }
|
|
4799
4743
|
});
|
|
4800
4744
|
}
|
|
4801
|
-
/**
|
|
4802
|
-
* Get blended "top" results (users, hashtags, and places).
|
|
4803
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4804
|
-
*/
|
|
4745
|
+
/** Get blended "top" results (users, hashtags, and places). */
|
|
4805
4746
|
async top(query) {
|
|
4806
4747
|
return this.client.request("/v1/instagram/search/top", {
|
|
4807
4748
|
params: { query }
|
|
4808
4749
|
});
|
|
4809
4750
|
}
|
|
4810
|
-
/**
|
|
4811
|
-
* Get typeahead/autocomplete suggestions (mixed entity types).
|
|
4812
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4813
|
-
*/
|
|
4751
|
+
/** Get typeahead/autocomplete suggestions (mixed entity types). */
|
|
4814
4752
|
async autocomplete(query) {
|
|
4815
4753
|
return this.client.request("/v1/instagram/search/autocomplete", {
|
|
4816
4754
|
params: { query }
|
|
@@ -4829,31 +4767,19 @@ var HashtagsClient = class {
|
|
|
4829
4767
|
constructor(client) {
|
|
4830
4768
|
this.client = client;
|
|
4831
4769
|
}
|
|
4832
|
-
/**
|
|
4833
|
-
* Get a hashtag's info (media count, cover).
|
|
4834
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4835
|
-
*/
|
|
4770
|
+
/** Get a hashtag's info (media count, cover). */
|
|
4836
4771
|
async get(tag) {
|
|
4837
4772
|
return this.client.request(`/v1/instagram/hashtags/${tag}`);
|
|
4838
4773
|
}
|
|
4839
|
-
/**
|
|
4840
|
-
* Get the top/popular media for a hashtag.
|
|
4841
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4842
|
-
*/
|
|
4774
|
+
/** Get the top/popular media for a hashtag. */
|
|
4843
4775
|
async top(tag, options = {}) {
|
|
4844
4776
|
return mediaFeed(this.client, `/v1/instagram/hashtags/${tag}/top`, options);
|
|
4845
4777
|
}
|
|
4846
|
-
/**
|
|
4847
|
-
* Get the most recent media for a hashtag.
|
|
4848
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4849
|
-
*/
|
|
4778
|
+
/** Get the most recent media for a hashtag. */
|
|
4850
4779
|
async recent(tag, options = {}) {
|
|
4851
4780
|
return mediaFeed(this.client, `/v1/instagram/hashtags/${tag}/recent`, options);
|
|
4852
4781
|
}
|
|
4853
|
-
/**
|
|
4854
|
-
* Get reels for a hashtag.
|
|
4855
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4856
|
-
*/
|
|
4782
|
+
/** Get reels for a hashtag. */
|
|
4857
4783
|
async reels(tag, options = {}) {
|
|
4858
4784
|
return mediaFeed(this.client, `/v1/instagram/hashtags/${tag}/reels`, options);
|
|
4859
4785
|
}
|
|
@@ -4863,31 +4789,19 @@ var LocationsClient = class {
|
|
|
4863
4789
|
constructor(client) {
|
|
4864
4790
|
this.client = client;
|
|
4865
4791
|
}
|
|
4866
|
-
/**
|
|
4867
|
-
* Get a location's info.
|
|
4868
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4869
|
-
*/
|
|
4792
|
+
/** Get a location's info. */
|
|
4870
4793
|
async get(pk) {
|
|
4871
4794
|
return this.client.request(`/v1/instagram/locations/${pk}`);
|
|
4872
4795
|
}
|
|
4873
|
-
/**
|
|
4874
|
-
* Get the top/popular media for a location.
|
|
4875
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4876
|
-
*/
|
|
4796
|
+
/** Get the top/popular media for a location. */
|
|
4877
4797
|
async top(pk, options = {}) {
|
|
4878
4798
|
return mediaFeed(this.client, `/v1/instagram/locations/${pk}/top`, options);
|
|
4879
4799
|
}
|
|
4880
|
-
/**
|
|
4881
|
-
* Get the most recent media for a location.
|
|
4882
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4883
|
-
*/
|
|
4800
|
+
/** Get the most recent media for a location. */
|
|
4884
4801
|
async recent(pk, options = {}) {
|
|
4885
4802
|
return mediaFeed(this.client, `/v1/instagram/locations/${pk}/recent`, options);
|
|
4886
4803
|
}
|
|
4887
|
-
/**
|
|
4888
|
-
* Search locations by name.
|
|
4889
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4890
|
-
*/
|
|
4804
|
+
/** Search locations by name. */
|
|
4891
4805
|
async search(query) {
|
|
4892
4806
|
return this.client.request("/v1/instagram/locations/search", {
|
|
4893
4807
|
params: { query }
|
|
@@ -4899,24 +4813,15 @@ var AudioClient = class {
|
|
|
4899
4813
|
constructor(client) {
|
|
4900
4814
|
this.client = client;
|
|
4901
4815
|
}
|
|
4902
|
-
/**
|
|
4903
|
-
* Get an audio track's info.
|
|
4904
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4905
|
-
*/
|
|
4816
|
+
/** Get an audio track's info. */
|
|
4906
4817
|
async get(audioId) {
|
|
4907
4818
|
return this.client.request(`/v1/instagram/audio/${audioId}`);
|
|
4908
4819
|
}
|
|
4909
|
-
/**
|
|
4910
|
-
* Get media that use an audio track.
|
|
4911
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4912
|
-
*/
|
|
4820
|
+
/** Get media that use an audio track. */
|
|
4913
4821
|
async media(audioId, options = {}) {
|
|
4914
4822
|
return mediaFeed(this.client, `/v1/instagram/audio/${audioId}/media`, options);
|
|
4915
4823
|
}
|
|
4916
|
-
/**
|
|
4917
|
-
* Get currently-trending audio tracks.
|
|
4918
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4919
|
-
*/
|
|
4824
|
+
/** Get currently-trending audio tracks. */
|
|
4920
4825
|
async trending() {
|
|
4921
4826
|
return this.client.request("/v1/instagram/audio/trending");
|
|
4922
4827
|
}
|
|
@@ -5074,6 +4979,112 @@ var AccountClient = class {
|
|
|
5074
4979
|
}
|
|
5075
4980
|
};
|
|
5076
4981
|
|
|
4982
|
+
// src/agent/client.ts
|
|
4983
|
+
var AgentClient = class {
|
|
4984
|
+
constructor(client) {
|
|
4985
|
+
this.client = client;
|
|
4986
|
+
}
|
|
4987
|
+
/**
|
|
4988
|
+
* Quote a call: its cost, whether its parameters are valid, and its latency.
|
|
4989
|
+
* Free: nothing runs and nothing is charged.
|
|
4990
|
+
*
|
|
4991
|
+
* @param method - HTTP method of the call to quote.
|
|
4992
|
+
* @param path - Path of the call, e.g. "/v1/google/search" (the "/v1" prefix is optional).
|
|
4993
|
+
* @param options - The call's query `params` and JSON `body`.
|
|
4994
|
+
* @throws NotFoundError - No such endpoint.
|
|
4995
|
+
*/
|
|
4996
|
+
async quote(method, path, options = {}) {
|
|
4997
|
+
return this.client.request("/v1/quote", {
|
|
4998
|
+
method: "POST",
|
|
4999
|
+
body: { method, path, params: options.params, body: options.body }
|
|
5000
|
+
});
|
|
5001
|
+
}
|
|
5002
|
+
/**
|
|
5003
|
+
* Send feedback (an API or field you needed and couldn't find) or a bug
|
|
5004
|
+
* report. Free, never billed; rate limited per key (429 when over the limit).
|
|
5005
|
+
*
|
|
5006
|
+
* @param summary - One-line summary, 3-200 characters.
|
|
5007
|
+
* @param options - `type` ("feedback" default, or "bug"), `details`, `requestId`, `endpoint`, `contact`.
|
|
5008
|
+
*/
|
|
5009
|
+
async feedback(summary, options = {}) {
|
|
5010
|
+
return this.client.request("/v1/feedback", {
|
|
5011
|
+
method: "POST",
|
|
5012
|
+
body: {
|
|
5013
|
+
type: options.type ?? "feedback",
|
|
5014
|
+
summary,
|
|
5015
|
+
details: options.details,
|
|
5016
|
+
request_id: options.requestId,
|
|
5017
|
+
endpoint: options.endpoint,
|
|
5018
|
+
contact: options.contact
|
|
5019
|
+
}
|
|
5020
|
+
});
|
|
5021
|
+
}
|
|
5022
|
+
/**
|
|
5023
|
+
* Report a bug: a wrong or empty result for valid input, a misleading error,
|
|
5024
|
+
* or a price mismatch. Same as `feedback(summary, { ...options, type: "bug" })`.
|
|
5025
|
+
*
|
|
5026
|
+
* @param summary - One-line summary, 3-200 characters.
|
|
5027
|
+
* @param options - `details`, `requestId` (the failing call's X-Request-ID), `endpoint`, `contact`.
|
|
5028
|
+
*/
|
|
5029
|
+
async reportBug(summary, options = {}) {
|
|
5030
|
+
return this.feedback(summary, { ...options, type: "bug" });
|
|
5031
|
+
}
|
|
5032
|
+
};
|
|
5033
|
+
var ResultsClient = class {
|
|
5034
|
+
constructor(client) {
|
|
5035
|
+
this.client = client;
|
|
5036
|
+
}
|
|
5037
|
+
/**
|
|
5038
|
+
* Replay a recent result, optionally trimmed. Free.
|
|
5039
|
+
*
|
|
5040
|
+
* @param resultId - `X-Result-ID` of the original call.
|
|
5041
|
+
* @param options - `jq`, `fields`, `maxItems`, `summary` view params.
|
|
5042
|
+
* @returns The original response body, reshaped — any JSON value.
|
|
5043
|
+
* @throws NotFoundError - Unknown result, or it expired (~15 minutes).
|
|
5044
|
+
*/
|
|
5045
|
+
async get(resultId, options = {}) {
|
|
5046
|
+
const { jq, fields, maxItems, summary } = options;
|
|
5047
|
+
return this.client.request(`/v1/results/${encodeURIComponent(resultId)}`, {
|
|
5048
|
+
params: {
|
|
5049
|
+
jq,
|
|
5050
|
+
fields: Array.isArray(fields) ? fields.join(",") : fields,
|
|
5051
|
+
max_items: maxItems,
|
|
5052
|
+
summary: summary ? true : void 0
|
|
5053
|
+
}
|
|
5054
|
+
});
|
|
5055
|
+
}
|
|
5056
|
+
};
|
|
5057
|
+
var RequestsClient = class {
|
|
5058
|
+
constructor(client) {
|
|
5059
|
+
this.client = client;
|
|
5060
|
+
}
|
|
5061
|
+
/**
|
|
5062
|
+
* Poll an async request. Free.
|
|
5063
|
+
*
|
|
5064
|
+
* @param requestId - `request_id` from the 202 response.
|
|
5065
|
+
* @returns `running: true` while in progress; once done, `data` is the original body.
|
|
5066
|
+
* @throws NotFoundError - Unknown or expired request (one that never completed was not billed).
|
|
5067
|
+
* @throws ScrapeBadgerError - The original call finished with an error status (as the matching subclass).
|
|
5068
|
+
*/
|
|
5069
|
+
async get(requestId) {
|
|
5070
|
+
const { data, status, headers } = await this.client.requestWithHeaders(
|
|
5071
|
+
`/v1/requests/${encodeURIComponent(requestId)}`
|
|
5072
|
+
);
|
|
5073
|
+
const running = status === 202;
|
|
5074
|
+
const retryAfter = running ? data?.retry_after_seconds : void 0;
|
|
5075
|
+
const credits = headers?.get("X-Credits-Used");
|
|
5076
|
+
return {
|
|
5077
|
+
requestId,
|
|
5078
|
+
running,
|
|
5079
|
+
status: status ?? 200,
|
|
5080
|
+
retryAfterSeconds: retryAfter ?? null,
|
|
5081
|
+
resultId: headers?.get("X-Result-ID") ?? null,
|
|
5082
|
+
creditsUsed: credits && /^\d+$/.test(credits) ? Number(credits) : null,
|
|
5083
|
+
data
|
|
5084
|
+
};
|
|
5085
|
+
}
|
|
5086
|
+
};
|
|
5087
|
+
|
|
5077
5088
|
// src/airbnb/client.ts
|
|
5078
5089
|
var AirbnbClient = class {
|
|
5079
5090
|
client;
|
|
@@ -9394,7 +9405,7 @@ var PropertiesClient2 = class {
|
|
|
9394
9405
|
};
|
|
9395
9406
|
|
|
9396
9407
|
// src/zillow/agent.ts
|
|
9397
|
-
var
|
|
9408
|
+
var AgentClient2 = class {
|
|
9398
9409
|
client;
|
|
9399
9410
|
constructor(client) {
|
|
9400
9411
|
this.client = client;
|
|
@@ -9452,7 +9463,7 @@ var ZillowClient = class {
|
|
|
9452
9463
|
this._gen = client;
|
|
9453
9464
|
this.search = new SearchClient18(client);
|
|
9454
9465
|
this.properties = new PropertiesClient2(client);
|
|
9455
|
-
this.agent = new
|
|
9466
|
+
this.agent = new AgentClient2(client);
|
|
9456
9467
|
this.reference = new ReferenceClient14(client);
|
|
9457
9468
|
}
|
|
9458
9469
|
// --- BEGIN generated by sdk/codegen/facade — do not edit ---
|
|
@@ -10501,6 +10512,12 @@ var ScrapeBadger = class {
|
|
|
10501
10512
|
/** Amazon scraper API client — 14 endpoints */
|
|
10502
10513
|
/** Account API client. (Generated from the OpenAPI spec.) */
|
|
10503
10514
|
account;
|
|
10515
|
+
/** Quote a call before making it, and report bugs or send feedback. Free. */
|
|
10516
|
+
agent;
|
|
10517
|
+
/** Re-read a recent result (`X-Result-ID`) for free, optionally trimmed. */
|
|
10518
|
+
results;
|
|
10519
|
+
/** Poll a call made with `Prefer: respond-async`. Free. */
|
|
10520
|
+
requests;
|
|
10504
10521
|
/** Airbnb API client. (Generated from the OpenAPI spec.) */
|
|
10505
10522
|
airbnb;
|
|
10506
10523
|
/** Aliexpress API client. (Generated from the OpenAPI spec.) */
|
|
@@ -10609,6 +10626,9 @@ var ScrapeBadger = class {
|
|
|
10609
10626
|
this.instagram = new InstagramClient(this.baseClient);
|
|
10610
10627
|
this.redfin = new RedfinClient(this.baseClient);
|
|
10611
10628
|
this.account = new AccountClient(this.baseClient);
|
|
10629
|
+
this.agent = new AgentClient(this.baseClient);
|
|
10630
|
+
this.results = new ResultsClient(this.baseClient);
|
|
10631
|
+
this.requests = new RequestsClient(this.baseClient);
|
|
10612
10632
|
this.airbnb = new AirbnbClient(this.baseClient);
|
|
10613
10633
|
this.aliexpress = new AliexpressClient(this.baseClient);
|
|
10614
10634
|
this.amazon = new AmazonClient(this.baseClient);
|
|
@@ -10643,6 +10663,6 @@ var ScrapeBadger = class {
|
|
|
10643
10663
|
}
|
|
10644
10664
|
};
|
|
10645
10665
|
|
|
10646
|
-
export { AccountRestrictedError, AmazonClient, ListingsClient as AmazonListingsClient, ProductsClient2 as AmazonProductsClient, ReferenceClient2 as AmazonReferenceClient, SearchClient5 as AmazonSearchClient, SellersClient as AmazonSellersClient, ApartmentsClient, AuthenticationError, BaiduClient, BingClient, MediaClient3 as BingMediaClient, NewsClient2 as BingNewsClient, ReferenceClient8 as BingReferenceClient, SearchClient11 as BingSearchClient, BlockedError, AskClient as ChatGPTAskClient, BrandClient as ChatGPTBrandClient, ChatGPTClient, ReferenceClient16 as ChatGPTReferenceClient, CommunitiesClient, ConflictError, DepopClient, DuckDuckGoClient, MediaClient2 as DuckDuckGoMediaClient, ReferenceClient7 as DuckDuckGoReferenceClient, SearchClient10 as DuckDuckGoSearchClient, CategoriesClient as EbayCategoriesClient, EbayClient, ItemsClient2 as EbayItemsClient, ReferenceClient5 as EbayReferenceClient, SearchClient8 as EbaySearchClient, SellersClient2 as EbaySellersClient, AskClient2 as GeminiAskClient, BrandClient2 as GeminiBrandClient, GeminiClient, GeoClient, AdsClient as GoogleAdsClient, AiModeClient as GoogleAiModeClient, AutocompleteClient as GoogleAutocompleteClient, GoogleClient, FinanceClient as GoogleFinanceClient, FlightsClient as GoogleFlightsClient, HotelsClient as GoogleHotelsClient, ImagesClient as GoogleImagesClient, JobsClient as GoogleJobsClient, LensClient as GoogleLensClient, MapsClient as GoogleMapsClient, NewsClient as GoogleNewsClient, PatentsClient as GooglePatentsClient, ProductsClient as GoogleProductsClient, ScholarClient as GoogleScholarClient, SearchClient2 as GoogleSearchClient, ShoppingClient as GoogleShoppingClient, ShortsClient as GoogleShortsClient, TrendsClient2 as GoogleTrendsClient, VideosClient as GoogleVideosClient, GumtreeClient, IPNotAllowedError, ImmobiliareClient, AudioClient as InstagramAudioClient, InstagramClient, HashtagsClient as InstagramHashtagsClient, LocationsClient as InstagramLocationsClient, MediaClient as InstagramMediaClient, SearchClient4 as InstagramSearchClient, UsersClient4 as InstagramUsersClient, InsufficientCreditsError, AdsClient3 as LeboncoinAdsClient, LeboncoinClient, ReferenceClient13 as LeboncoinReferenceClient, SearchClient17 as LeboncoinSearchClient, SellersClient4 as LeboncoinSellersClient, LinkedInClient, ListsClient, BrokersClient as LoopNetBrokersClient, LoopNetClient, ListingsClient2 as LoopNetListingsClient, ReferenceClient15 as LoopNetReferenceClient, SearchClient19 as LoopNetSearchClient, NaverClient, ContentClient as NaverContentClient, PlacesClient as NaverPlacesClient, ProductsClient5 as NaverProductsClient, ReviewsClient2 as NaverReviewsClient, SearchClient12 as NaverSearchClient, ShoppingClient2 as NaverShoppingClient, ShoppingLiveClient as NaverShoppingLiveClient, StoresClient2 as NaverStoresClient, NotFoundError, PermissionDeniedError, RateLimitError, RealtorClient, PropertiesClient as RealtorPropertiesClient, ReferenceClient12 as RealtorReferenceClient, SearchClient16 as RealtorSearchClient, RedditClient, PostsClient as RedditPostsClient, SearchClient3 as RedditSearchClient, SubredditsClient as RedditSubredditsClient, UsersClient3 as RedditUsersClient, RedfinClient, ScrapeBadger, ScrapeBadgerError, ServerError, ShopeeClient, ProductsClient3 as ShopeeProductsClient, ReferenceClient3 as ShopeeReferenceClient, ReviewsClient as ShopeeReviewsClient, SearchClient6 as ShopeeSearchClient, SpacesClient, StreamClient, AdsClient2 as TikTokAdsClient, TikTokClient, HashtagsClient2 as TikTokHashtagsClient, MusicClient as TikTokMusicClient, ReferenceClient4 as TikTokReferenceClient, SearchClient7 as TikTokSearchClient, TrendingClient as TikTokTrendingClient, UsersClient5 as TikTokUsersClient, VideosClient2 as TikTokVideosClient, TimeoutError, TrendsClient, TweetsClient, TwitterClient, UsersClient, ValidationError, VintedClient, ItemsClient as VintedItemsClient, ReferenceClient as VintedReferenceClient, SearchClient as VintedSearchClient, UsersClient2 as VintedUsersClient, WallapopClient, WalmartClient, ProductsClient4 as WalmartProductsClient, ReferenceClient6 as WalmartReferenceClient, SearchClient9 as WalmartSearchClient, SellersClient3 as WalmartSellersClient, StoresClient as WalmartStoresClient, WebClient, WebSocketStreamError, YahooClient, MediaClient4 as YahooMediaClient, NewsClient3 as YahooNewsClient, ReferenceClient9 as YahooReferenceClient, SearchClient13 as YahooSearchClient, YandexClient, ImagesClient2 as YandexImagesClient, ReferenceClient10 as YandexReferenceClient, SearchClient14 as YandexSearchClient, ChannelsClient as YoutubeChannelsClient, YoutubeClient, CommunityClient as YoutubeCommunityClient, MusicClient2 as YoutubeMusicClient, PlaylistsClient as YoutubePlaylistsClient, ReferenceClient11 as YoutubeReferenceClient, SearchClient15 as YoutubeSearchClient, ShortsClient2 as YoutubeShortsClient, TrendingClient2 as YoutubeTrendingClient, VideosClient3 as YoutubeVideosClient,
|
|
10666
|
+
export { AccountRestrictedError, AgentClient, AmazonClient, ListingsClient as AmazonListingsClient, ProductsClient2 as AmazonProductsClient, ReferenceClient2 as AmazonReferenceClient, SearchClient5 as AmazonSearchClient, SellersClient as AmazonSellersClient, ApartmentsClient, AuthenticationError, BaiduClient, BingClient, MediaClient3 as BingMediaClient, NewsClient2 as BingNewsClient, ReferenceClient8 as BingReferenceClient, SearchClient11 as BingSearchClient, BlockedError, AskClient as ChatGPTAskClient, BrandClient as ChatGPTBrandClient, ChatGPTClient, ReferenceClient16 as ChatGPTReferenceClient, CommunitiesClient, ConflictError, DepopClient, DuckDuckGoClient, MediaClient2 as DuckDuckGoMediaClient, ReferenceClient7 as DuckDuckGoReferenceClient, SearchClient10 as DuckDuckGoSearchClient, CategoriesClient as EbayCategoriesClient, EbayClient, ItemsClient2 as EbayItemsClient, ReferenceClient5 as EbayReferenceClient, SearchClient8 as EbaySearchClient, SellersClient2 as EbaySellersClient, AskClient2 as GeminiAskClient, BrandClient2 as GeminiBrandClient, GeminiClient, GeoClient, AdsClient as GoogleAdsClient, AiModeClient as GoogleAiModeClient, AutocompleteClient as GoogleAutocompleteClient, GoogleClient, FinanceClient as GoogleFinanceClient, FlightsClient as GoogleFlightsClient, HotelsClient as GoogleHotelsClient, ImagesClient as GoogleImagesClient, JobsClient as GoogleJobsClient, LensClient as GoogleLensClient, MapsClient as GoogleMapsClient, NewsClient as GoogleNewsClient, PatentsClient as GooglePatentsClient, ProductsClient as GoogleProductsClient, ScholarClient as GoogleScholarClient, SearchClient2 as GoogleSearchClient, ShoppingClient as GoogleShoppingClient, ShortsClient as GoogleShortsClient, TrendsClient2 as GoogleTrendsClient, VideosClient as GoogleVideosClient, GumtreeClient, IPNotAllowedError, ImmobiliareClient, AudioClient as InstagramAudioClient, InstagramClient, HashtagsClient as InstagramHashtagsClient, LocationsClient as InstagramLocationsClient, MediaClient as InstagramMediaClient, SearchClient4 as InstagramSearchClient, UsersClient4 as InstagramUsersClient, InsufficientCreditsError, AdsClient3 as LeboncoinAdsClient, LeboncoinClient, ReferenceClient13 as LeboncoinReferenceClient, SearchClient17 as LeboncoinSearchClient, SellersClient4 as LeboncoinSellersClient, LinkedInClient, ListsClient, BrokersClient as LoopNetBrokersClient, LoopNetClient, ListingsClient2 as LoopNetListingsClient, ReferenceClient15 as LoopNetReferenceClient, SearchClient19 as LoopNetSearchClient, NaverClient, ContentClient as NaverContentClient, PlacesClient as NaverPlacesClient, ProductsClient5 as NaverProductsClient, ReviewsClient2 as NaverReviewsClient, SearchClient12 as NaverSearchClient, ShoppingClient2 as NaverShoppingClient, ShoppingLiveClient as NaverShoppingLiveClient, StoresClient2 as NaverStoresClient, NotFoundError, PermissionDeniedError, RateLimitError, RealtorClient, PropertiesClient as RealtorPropertiesClient, ReferenceClient12 as RealtorReferenceClient, SearchClient16 as RealtorSearchClient, RedditClient, PostsClient as RedditPostsClient, SearchClient3 as RedditSearchClient, SubredditsClient as RedditSubredditsClient, UsersClient3 as RedditUsersClient, RedfinClient, RequestsClient, ResultsClient, ScrapeBadger, ScrapeBadgerError, ServerError, ShopeeClient, ProductsClient3 as ShopeeProductsClient, ReferenceClient3 as ShopeeReferenceClient, ReviewsClient as ShopeeReviewsClient, SearchClient6 as ShopeeSearchClient, SpacesClient, StreamClient, AdsClient2 as TikTokAdsClient, TikTokClient, HashtagsClient2 as TikTokHashtagsClient, MusicClient as TikTokMusicClient, ReferenceClient4 as TikTokReferenceClient, SearchClient7 as TikTokSearchClient, TrendingClient as TikTokTrendingClient, UsersClient5 as TikTokUsersClient, VideosClient2 as TikTokVideosClient, TimeoutError, TrendsClient, TweetsClient, TwitterClient, UsersClient, ValidationError, VintedClient, ItemsClient as VintedItemsClient, ReferenceClient as VintedReferenceClient, SearchClient as VintedSearchClient, UsersClient2 as VintedUsersClient, WallapopClient, WalmartClient, ProductsClient4 as WalmartProductsClient, ReferenceClient6 as WalmartReferenceClient, SearchClient9 as WalmartSearchClient, SellersClient3 as WalmartSellersClient, StoresClient as WalmartStoresClient, WebClient, WebSocketStreamError, YahooClient, MediaClient4 as YahooMediaClient, NewsClient3 as YahooNewsClient, ReferenceClient9 as YahooReferenceClient, SearchClient13 as YahooSearchClient, YandexClient, ImagesClient2 as YandexImagesClient, ReferenceClient10 as YandexReferenceClient, SearchClient14 as YandexSearchClient, ChannelsClient as YoutubeChannelsClient, YoutubeClient, CommunityClient as YoutubeCommunityClient, MusicClient2 as YoutubeMusicClient, PlaylistsClient as YoutubePlaylistsClient, ReferenceClient11 as YoutubeReferenceClient, SearchClient15 as YoutubeSearchClient, ShortsClient2 as YoutubeShortsClient, TrendingClient2 as YoutubeTrendingClient, VideosClient3 as YoutubeVideosClient, AgentClient2 as ZillowAgentClient, ZillowClient, PropertiesClient2 as ZillowPropertiesClient, ReferenceClient14 as ZillowReferenceClient, SearchClient18 as ZillowSearchClient, collectAll, verifyWebhookSignature };
|
|
10647
10667
|
//# sourceMappingURL=index.mjs.map
|
|
10648
10668
|
//# sourceMappingURL=index.mjs.map
|