scrapebadger 0.63.0 → 0.64.1
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.d.cts +60 -128
- package/dist/index.d.ts +60 -128
- package/dist/index.js +70 -129
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +70 -129
- package/dist/index.mjs.map +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.64.1";
|
|
7
7
|
|
|
8
8
|
// src/internal/exceptions.ts
|
|
9
9
|
var ScrapeBadgerError = class _ScrapeBadgerError extends Error {
|
|
@@ -3028,6 +3028,42 @@ var ReferenceClient = class {
|
|
|
3028
3028
|
}
|
|
3029
3029
|
});
|
|
3030
3030
|
}
|
|
3031
|
+
/**
|
|
3032
|
+
* Get Vinted's A-Z directory of popular brands.
|
|
3033
|
+
*
|
|
3034
|
+
* Returns about 240 of the most popular brands whose name starts with
|
|
3035
|
+
* `letter`, with ID, slug and item count. Loop `letter` over A-Z and "0"
|
|
3036
|
+
* (digits) for a reference list of roughly 6,000 brand IDs. `brands()`
|
|
3037
|
+
* stops at 10 matches per keyword. 1 credit per call.
|
|
3038
|
+
*
|
|
3039
|
+
* @param options - Optional parameters.
|
|
3040
|
+
* @param options.letter - First letter of the brand name, "A"-"Z", or "0"
|
|
3041
|
+
* for digits. Omit for the most popular brands overall.
|
|
3042
|
+
* @param options.market - Market code (default: "fr").
|
|
3043
|
+
* @returns Brands for that letter (no pagination; one page per letter).
|
|
3044
|
+
*
|
|
3045
|
+
* @example
|
|
3046
|
+
* ```typescript
|
|
3047
|
+
* const ids = new Map<string, number>();
|
|
3048
|
+
* for (const letter of [..."ABCDEFGHIJKLMNOPQRSTUVWXYZ", "0"]) {
|
|
3049
|
+
* const { brands } = await client.vinted.reference.popularBrands({ letter, market: "uk" });
|
|
3050
|
+
* for (const brand of brands) ids.set(brand.title, brand.id);
|
|
3051
|
+
* }
|
|
3052
|
+
* ```
|
|
3053
|
+
*/
|
|
3054
|
+
async popularBrands(options = {}) {
|
|
3055
|
+
const response = await this.client.request(
|
|
3056
|
+
"/v1/vinted/mobile/popular-brands",
|
|
3057
|
+
{
|
|
3058
|
+
method: "POST",
|
|
3059
|
+
body: {
|
|
3060
|
+
market: options.market ?? "fr",
|
|
3061
|
+
parameters: options.letter ? { letter: options.letter } : {}
|
|
3062
|
+
}
|
|
3063
|
+
}
|
|
3064
|
+
);
|
|
3065
|
+
return { brands: response.data?.brands ?? [], pagination: null };
|
|
3066
|
+
}
|
|
3031
3067
|
/**
|
|
3032
3068
|
* Get available colors for a market.
|
|
3033
3069
|
*
|
|
@@ -4549,17 +4585,11 @@ var UsersClient4 = class {
|
|
|
4549
4585
|
async get(username) {
|
|
4550
4586
|
return this.client.request(`/v1/instagram/users/${username}`);
|
|
4551
4587
|
}
|
|
4552
|
-
/**
|
|
4553
|
-
* Get "About this account" metadata for a user.
|
|
4554
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4555
|
-
*/
|
|
4588
|
+
/** Get "About this account" metadata for a user. */
|
|
4556
4589
|
async about(username) {
|
|
4557
4590
|
return this.client.request(`/v1/instagram/users/${username}/about`);
|
|
4558
4591
|
}
|
|
4559
|
-
/**
|
|
4560
|
-
* Get accounts related/suggested for a user.
|
|
4561
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4562
|
-
*/
|
|
4592
|
+
/** Get accounts related/suggested for a user. */
|
|
4563
4593
|
async related(username) {
|
|
4564
4594
|
return this.client.request(`/v1/instagram/users/${username}/related`);
|
|
4565
4595
|
}
|
|
@@ -4568,36 +4598,25 @@ var UsersClient4 = class {
|
|
|
4568
4598
|
return this.media(`/v1/instagram/users/${username}/posts`, options);
|
|
4569
4599
|
}
|
|
4570
4600
|
/**
|
|
4571
|
-
* Get a user's video posts
|
|
4572
|
-
*
|
|
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.
|
|
4573
4603
|
*/
|
|
4574
4604
|
async videos(username, options = {}) {
|
|
4575
4605
|
return this.media(`/v1/instagram/users/${username}/videos`, options);
|
|
4576
4606
|
}
|
|
4577
|
-
/**
|
|
4578
|
-
* Get a user's reels.
|
|
4579
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4580
|
-
*/
|
|
4607
|
+
/** Get a user's reels. */
|
|
4581
4608
|
async reels(username, options = {}) {
|
|
4582
4609
|
return this.media(`/v1/instagram/users/${username}/reels`, options);
|
|
4583
4610
|
}
|
|
4584
|
-
/**
|
|
4585
|
-
* Get media a user is tagged in.
|
|
4586
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4587
|
-
*/
|
|
4611
|
+
/** Get media a user is tagged in. */
|
|
4588
4612
|
async tagged(username, options = {}) {
|
|
4589
4613
|
return this.media(`/v1/instagram/users/${username}/tagged`, options);
|
|
4590
4614
|
}
|
|
4591
|
-
/**
|
|
4592
|
-
* Get a user's pinned posts.
|
|
4593
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4594
|
-
*/
|
|
4615
|
+
/** Get a user's pinned posts. */
|
|
4595
4616
|
async pinned(username) {
|
|
4596
4617
|
return this.client.request(`/v1/instagram/users/${username}/pinned`);
|
|
4597
4618
|
}
|
|
4598
4619
|
/**
|
|
4599
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4600
|
-
*
|
|
4601
4620
|
* Get a user's followers.
|
|
4602
4621
|
*
|
|
4603
4622
|
* @param username - Instagram username.
|
|
@@ -4614,19 +4633,13 @@ var UsersClient4 = class {
|
|
|
4614
4633
|
}
|
|
4615
4634
|
});
|
|
4616
4635
|
}
|
|
4617
|
-
/**
|
|
4618
|
-
* Get the accounts a user follows.
|
|
4619
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4620
|
-
*/
|
|
4636
|
+
/** Get the accounts a user follows. */
|
|
4621
4637
|
async following(username, options = {}) {
|
|
4622
4638
|
return this.client.request(`/v1/instagram/users/${username}/following`, {
|
|
4623
4639
|
params: { amount: options.amount, cursor: options.cursor }
|
|
4624
4640
|
});
|
|
4625
4641
|
}
|
|
4626
|
-
/**
|
|
4627
|
-
* Search within a user's followers by name/username.
|
|
4628
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4629
|
-
*/
|
|
4642
|
+
/** Search within a user's followers by name/username. */
|
|
4630
4643
|
async searchFollowers(username, query, options = {}) {
|
|
4631
4644
|
return this.client.request(
|
|
4632
4645
|
`/v1/instagram/users/${username}/followers/search`,
|
|
@@ -4635,17 +4648,11 @@ var UsersClient4 = class {
|
|
|
4635
4648
|
}
|
|
4636
4649
|
);
|
|
4637
4650
|
}
|
|
4638
|
-
/**
|
|
4639
|
-
* Get a user's currently-live stories.
|
|
4640
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4641
|
-
*/
|
|
4651
|
+
/** Get a user's currently-live stories. */
|
|
4642
4652
|
async stories(username) {
|
|
4643
4653
|
return this.client.request(`/v1/instagram/users/${username}/stories`);
|
|
4644
4654
|
}
|
|
4645
|
-
/**
|
|
4646
|
-
* Get a user's story highlights.
|
|
4647
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4648
|
-
*/
|
|
4655
|
+
/** Get a user's story highlights. */
|
|
4649
4656
|
async highlights(username) {
|
|
4650
4657
|
return this.client.request(`/v1/instagram/users/${username}/highlights`);
|
|
4651
4658
|
}
|
|
@@ -4670,10 +4677,7 @@ var MediaClient = class {
|
|
|
4670
4677
|
async get(code) {
|
|
4671
4678
|
return this.client.request(`/v1/instagram/media/${code}`);
|
|
4672
4679
|
}
|
|
4673
|
-
/**
|
|
4674
|
-
* Get oEmbed metadata for a media permalink.
|
|
4675
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4676
|
-
*/
|
|
4680
|
+
/** Get oEmbed metadata for a media permalink. */
|
|
4677
4681
|
async oembed(code) {
|
|
4678
4682
|
return this.client.request(`/v1/instagram/media/${code}/oembed`);
|
|
4679
4683
|
}
|
|
@@ -4683,27 +4687,18 @@ var MediaClient = class {
|
|
|
4683
4687
|
params: { amount: options.amount, cursor: options.cursor }
|
|
4684
4688
|
});
|
|
4685
4689
|
}
|
|
4686
|
-
/**
|
|
4687
|
-
* Get the users who liked a media.
|
|
4688
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4689
|
-
*/
|
|
4690
|
+
/** Get the users who liked a media. */
|
|
4690
4691
|
async likers(code) {
|
|
4691
4692
|
return this.client.request(`/v1/instagram/media/${code}/likers`);
|
|
4692
4693
|
}
|
|
4693
|
-
/**
|
|
4694
|
-
* Get replies to a comment.
|
|
4695
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4696
|
-
*/
|
|
4694
|
+
/** Get replies to a comment. */
|
|
4697
4695
|
async replies(code, commentId, options = {}) {
|
|
4698
4696
|
return this.client.request(
|
|
4699
4697
|
`/v1/instagram/media/${code}/comments/${commentId}/replies`,
|
|
4700
4698
|
{ params: { amount: options.amount, cursor: options.cursor } }
|
|
4701
4699
|
);
|
|
4702
4700
|
}
|
|
4703
|
-
/**
|
|
4704
|
-
* Get the users who liked a comment.
|
|
4705
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4706
|
-
*/
|
|
4701
|
+
/** Get the users who liked a comment. */
|
|
4707
4702
|
async commentLikers(code, commentId) {
|
|
4708
4703
|
return this.client.request(
|
|
4709
4704
|
`/v1/instagram/media/${code}/comments/${commentId}/likers`
|
|
@@ -4717,64 +4712,43 @@ var SearchClient4 = class {
|
|
|
4717
4712
|
constructor(client) {
|
|
4718
4713
|
this.client = client;
|
|
4719
4714
|
}
|
|
4720
|
-
/**
|
|
4721
|
-
* Search accounts by name/username.
|
|
4722
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4723
|
-
*/
|
|
4715
|
+
/** Search accounts by name/username. */
|
|
4724
4716
|
async users(query) {
|
|
4725
4717
|
return this.client.request("/v1/instagram/search/users", {
|
|
4726
4718
|
params: { query }
|
|
4727
4719
|
});
|
|
4728
4720
|
}
|
|
4729
|
-
/**
|
|
4730
|
-
* Search hashtags.
|
|
4731
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4732
|
-
*/
|
|
4721
|
+
/** Search hashtags. */
|
|
4733
4722
|
async hashtags(query) {
|
|
4734
4723
|
return this.client.request("/v1/instagram/search/hashtags", {
|
|
4735
4724
|
params: { query }
|
|
4736
4725
|
});
|
|
4737
4726
|
}
|
|
4738
|
-
/**
|
|
4739
|
-
* Search places/locations.
|
|
4740
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4741
|
-
*/
|
|
4727
|
+
/** Search places/locations (global ranking). */
|
|
4742
4728
|
async places(query) {
|
|
4743
4729
|
return this.client.request("/v1/instagram/search/places", {
|
|
4744
4730
|
params: { query }
|
|
4745
4731
|
});
|
|
4746
4732
|
}
|
|
4747
|
-
/**
|
|
4748
|
-
* Search reels.
|
|
4749
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4750
|
-
*/
|
|
4733
|
+
/** Search reels. */
|
|
4751
4734
|
async reels(query) {
|
|
4752
4735
|
return this.client.request("/v1/instagram/search/reels", {
|
|
4753
4736
|
params: { query }
|
|
4754
4737
|
});
|
|
4755
4738
|
}
|
|
4756
|
-
/**
|
|
4757
|
-
* Search music/audio tracks.
|
|
4758
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4759
|
-
*/
|
|
4739
|
+
/** Search music/audio tracks. */
|
|
4760
4740
|
async music(query) {
|
|
4761
4741
|
return this.client.request("/v1/instagram/search/music", {
|
|
4762
4742
|
params: { query }
|
|
4763
4743
|
});
|
|
4764
4744
|
}
|
|
4765
|
-
/**
|
|
4766
|
-
* Get blended "top" results (users, hashtags, and places).
|
|
4767
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4768
|
-
*/
|
|
4745
|
+
/** Get blended "top" results (users, hashtags, and places). */
|
|
4769
4746
|
async top(query) {
|
|
4770
4747
|
return this.client.request("/v1/instagram/search/top", {
|
|
4771
4748
|
params: { query }
|
|
4772
4749
|
});
|
|
4773
4750
|
}
|
|
4774
|
-
/**
|
|
4775
|
-
* Get typeahead/autocomplete suggestions (mixed entity types).
|
|
4776
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4777
|
-
*/
|
|
4751
|
+
/** Get typeahead/autocomplete suggestions (mixed entity types). */
|
|
4778
4752
|
async autocomplete(query) {
|
|
4779
4753
|
return this.client.request("/v1/instagram/search/autocomplete", {
|
|
4780
4754
|
params: { query }
|
|
@@ -4793,31 +4767,19 @@ var HashtagsClient = class {
|
|
|
4793
4767
|
constructor(client) {
|
|
4794
4768
|
this.client = client;
|
|
4795
4769
|
}
|
|
4796
|
-
/**
|
|
4797
|
-
* Get a hashtag's info (media count, cover).
|
|
4798
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4799
|
-
*/
|
|
4770
|
+
/** Get a hashtag's info (media count, cover). */
|
|
4800
4771
|
async get(tag) {
|
|
4801
4772
|
return this.client.request(`/v1/instagram/hashtags/${tag}`);
|
|
4802
4773
|
}
|
|
4803
|
-
/**
|
|
4804
|
-
* Get the top/popular media for a hashtag.
|
|
4805
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4806
|
-
*/
|
|
4774
|
+
/** Get the top/popular media for a hashtag. */
|
|
4807
4775
|
async top(tag, options = {}) {
|
|
4808
4776
|
return mediaFeed(this.client, `/v1/instagram/hashtags/${tag}/top`, options);
|
|
4809
4777
|
}
|
|
4810
|
-
/**
|
|
4811
|
-
* Get the most recent media for a hashtag.
|
|
4812
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4813
|
-
*/
|
|
4778
|
+
/** Get the most recent media for a hashtag. */
|
|
4814
4779
|
async recent(tag, options = {}) {
|
|
4815
4780
|
return mediaFeed(this.client, `/v1/instagram/hashtags/${tag}/recent`, options);
|
|
4816
4781
|
}
|
|
4817
|
-
/**
|
|
4818
|
-
* Get reels for a hashtag.
|
|
4819
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4820
|
-
*/
|
|
4782
|
+
/** Get reels for a hashtag. */
|
|
4821
4783
|
async reels(tag, options = {}) {
|
|
4822
4784
|
return mediaFeed(this.client, `/v1/instagram/hashtags/${tag}/reels`, options);
|
|
4823
4785
|
}
|
|
@@ -4827,31 +4789,19 @@ var LocationsClient = class {
|
|
|
4827
4789
|
constructor(client) {
|
|
4828
4790
|
this.client = client;
|
|
4829
4791
|
}
|
|
4830
|
-
/**
|
|
4831
|
-
* Get a location's info.
|
|
4832
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4833
|
-
*/
|
|
4792
|
+
/** Get a location's info. */
|
|
4834
4793
|
async get(pk) {
|
|
4835
4794
|
return this.client.request(`/v1/instagram/locations/${pk}`);
|
|
4836
4795
|
}
|
|
4837
|
-
/**
|
|
4838
|
-
* Get the top/popular media for a location.
|
|
4839
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4840
|
-
*/
|
|
4796
|
+
/** Get the top/popular media for a location. */
|
|
4841
4797
|
async top(pk, options = {}) {
|
|
4842
4798
|
return mediaFeed(this.client, `/v1/instagram/locations/${pk}/top`, options);
|
|
4843
4799
|
}
|
|
4844
|
-
/**
|
|
4845
|
-
* Get the most recent media for a location.
|
|
4846
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4847
|
-
*/
|
|
4800
|
+
/** Get the most recent media for a location. */
|
|
4848
4801
|
async recent(pk, options = {}) {
|
|
4849
4802
|
return mediaFeed(this.client, `/v1/instagram/locations/${pk}/recent`, options);
|
|
4850
4803
|
}
|
|
4851
|
-
/**
|
|
4852
|
-
* Search locations by name.
|
|
4853
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4854
|
-
*/
|
|
4804
|
+
/** Search locations by name. */
|
|
4855
4805
|
async search(query) {
|
|
4856
4806
|
return this.client.request("/v1/instagram/locations/search", {
|
|
4857
4807
|
params: { query }
|
|
@@ -4863,24 +4813,15 @@ var AudioClient = class {
|
|
|
4863
4813
|
constructor(client) {
|
|
4864
4814
|
this.client = client;
|
|
4865
4815
|
}
|
|
4866
|
-
/**
|
|
4867
|
-
* Get an audio track's info.
|
|
4868
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4869
|
-
*/
|
|
4816
|
+
/** Get an audio track's info. */
|
|
4870
4817
|
async get(audioId) {
|
|
4871
4818
|
return this.client.request(`/v1/instagram/audio/${audioId}`);
|
|
4872
4819
|
}
|
|
4873
|
-
/**
|
|
4874
|
-
* Get media that use an audio track.
|
|
4875
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4876
|
-
*/
|
|
4820
|
+
/** Get media that use an audio track. */
|
|
4877
4821
|
async media(audioId, options = {}) {
|
|
4878
4822
|
return mediaFeed(this.client, `/v1/instagram/audio/${audioId}/media`, options);
|
|
4879
4823
|
}
|
|
4880
|
-
/**
|
|
4881
|
-
* Get currently-trending audio tracks.
|
|
4882
|
-
* @deprecated Temporarily unavailable — authenticated data is temporarily offline.
|
|
4883
|
-
*/
|
|
4824
|
+
/** Get currently-trending audio tracks. */
|
|
4884
4825
|
async trending() {
|
|
4885
4826
|
return this.client.request("/v1/instagram/audio/trending");
|
|
4886
4827
|
}
|