@bycrawl/nodejs-sdk 0.1.1 → 0.2.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.cjs +123 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +65 -17
- package/dist/index.d.ts +65 -17
- package/dist/index.js +123 -25
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -488,25 +488,30 @@ declare class Dcard extends APIResource {
|
|
|
488
488
|
|
|
489
489
|
declare class Facebook extends APIResource {
|
|
490
490
|
getUser(username: string): Promise<APIResponse<FacebookUser>>;
|
|
491
|
-
getUserPosts(username: string
|
|
491
|
+
getUserPosts(username: string, options?: {
|
|
492
|
+
count?: number;
|
|
493
|
+
}): Promise<APIResponse<FacebookPost[]>>;
|
|
494
|
+
getPagePosts(pageId: string, options?: {
|
|
495
|
+
count?: number;
|
|
496
|
+
}): Promise<APIResponse<FacebookPost[]>>;
|
|
492
497
|
getPost(options: {
|
|
493
498
|
url: string;
|
|
494
499
|
}): Promise<APIResponse<FacebookPost>>;
|
|
495
500
|
getPostComments(options: {
|
|
496
501
|
url: string;
|
|
497
|
-
cursor?: string;
|
|
498
502
|
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
499
503
|
searchPosts(q: string, options?: {
|
|
500
504
|
count?: number;
|
|
501
|
-
cursor?: string;
|
|
502
505
|
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
503
|
-
|
|
506
|
+
browseMarketplace(options?: {
|
|
507
|
+
location?: string;
|
|
504
508
|
category?: string;
|
|
505
509
|
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
506
|
-
|
|
510
|
+
searchMarketplace(q: string, options?: {
|
|
507
511
|
location?: string;
|
|
512
|
+
category?: string;
|
|
508
513
|
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
509
|
-
|
|
514
|
+
getMarketplaceItem(listingId: string): Promise<APIResponse<Record<string, unknown>>>;
|
|
510
515
|
iterPostComments(options: {
|
|
511
516
|
url: string;
|
|
512
517
|
}): AsyncGenerator<Record<string, unknown>>;
|
|
@@ -562,14 +567,14 @@ declare class LinkedIn extends APIResource {
|
|
|
562
567
|
count?: number;
|
|
563
568
|
offset?: number;
|
|
564
569
|
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
565
|
-
searchJobs(
|
|
570
|
+
searchJobs(q: string, options?: {
|
|
566
571
|
location?: string;
|
|
567
572
|
count?: number;
|
|
568
573
|
offset?: number;
|
|
569
574
|
}): Promise<APIResponse<LinkedInJob[]>>;
|
|
570
575
|
getJob(jobId: string): Promise<APIResponse<LinkedInJob>>;
|
|
571
576
|
getPost(postId: string): Promise<APIResponse<LinkedInPost>>;
|
|
572
|
-
searchUsers(
|
|
577
|
+
searchUsers(q: string, options?: {
|
|
573
578
|
count?: number;
|
|
574
579
|
offset?: number;
|
|
575
580
|
}): Promise<APIResponse<LinkedInUser[]>>;
|
|
@@ -577,23 +582,38 @@ declare class LinkedIn extends APIResource {
|
|
|
577
582
|
iterCompanyJobs(companyId: string, options?: {
|
|
578
583
|
count?: number;
|
|
579
584
|
}): AsyncGenerator<LinkedInJob>;
|
|
580
|
-
iterSearchJobs(
|
|
585
|
+
iterSearchJobs(q: string, options?: {
|
|
581
586
|
location?: string;
|
|
582
587
|
count?: number;
|
|
583
588
|
}): AsyncGenerator<LinkedInJob>;
|
|
584
589
|
}
|
|
585
590
|
|
|
591
|
+
declare class PTT extends APIResource {
|
|
592
|
+
getBoard(boardName: string): Promise<APIResponse<Record<string, unknown>>>;
|
|
593
|
+
getBoardPosts(boardName: string, options?: {
|
|
594
|
+
page?: number;
|
|
595
|
+
count?: number;
|
|
596
|
+
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
597
|
+
getPost(url: string): Promise<APIResponse<Record<string, unknown>>>;
|
|
598
|
+
searchPosts(boardName: string, q: string, options?: {
|
|
599
|
+
count?: number;
|
|
600
|
+
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
601
|
+
}
|
|
602
|
+
|
|
586
603
|
declare class Reddit extends APIResource {
|
|
587
604
|
getSubreddit(name: string): Promise<APIResponse<Subreddit>>;
|
|
588
605
|
getSubredditPosts(name: string, options?: {
|
|
589
606
|
sort?: string;
|
|
590
607
|
t?: string;
|
|
591
608
|
count?: number;
|
|
609
|
+
after?: string;
|
|
592
610
|
}): Promise<APIResponse<RedditPost[]>>;
|
|
593
611
|
getPost(postId: string): Promise<APIResponse<RedditPost>>;
|
|
594
612
|
searchPosts(q: string, options?: {
|
|
595
613
|
sort?: string;
|
|
614
|
+
t?: string;
|
|
596
615
|
count?: number;
|
|
616
|
+
after?: string;
|
|
597
617
|
}): Promise<APIResponse<RedditPost[]>>;
|
|
598
618
|
getUser(username: string): Promise<APIResponse<RedditUser>>;
|
|
599
619
|
getUserPosts(username: string, options?: {
|
|
@@ -604,13 +624,21 @@ declare class Reddit extends APIResource {
|
|
|
604
624
|
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
605
625
|
}
|
|
606
626
|
|
|
627
|
+
declare class Rent591 extends APIResource {
|
|
628
|
+
getListings(options?: {
|
|
629
|
+
region?: number;
|
|
630
|
+
first_row?: number;
|
|
631
|
+
kind?: number;
|
|
632
|
+
section?: number;
|
|
633
|
+
price?: string;
|
|
634
|
+
count?: number;
|
|
635
|
+
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
636
|
+
getListing(listingId: number): Promise<APIResponse<Record<string, unknown>>>;
|
|
637
|
+
}
|
|
638
|
+
|
|
607
639
|
declare class Threads extends APIResource {
|
|
608
|
-
getPost(postId: string
|
|
609
|
-
|
|
610
|
-
}): Promise<APIResponse<ThreadsPost>>;
|
|
611
|
-
getPosts(ids: string[], options?: {
|
|
612
|
-
mode?: string;
|
|
613
|
-
}): Promise<APIResponse<ThreadsPost[]>>;
|
|
640
|
+
getPost(postId: string): Promise<APIResponse<ThreadsPost>>;
|
|
641
|
+
getPosts(ids: string[]): Promise<APIResponse<ThreadsPost[]>>;
|
|
614
642
|
searchPosts(q: string, options?: {
|
|
615
643
|
count?: number;
|
|
616
644
|
}): Promise<APIResponse<ThreadsPost[]>>;
|
|
@@ -660,13 +688,30 @@ declare class TikTok extends APIResource {
|
|
|
660
688
|
category?: string;
|
|
661
689
|
count?: number;
|
|
662
690
|
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
663
|
-
search(
|
|
691
|
+
search(q: string, options?: {
|
|
664
692
|
count?: number;
|
|
665
693
|
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
666
|
-
getVideoSubtitles(videoId: string
|
|
694
|
+
getVideoSubtitles(videoId: string, options?: {
|
|
695
|
+
language?: string;
|
|
696
|
+
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
667
697
|
iterVideoComments(videoId: string): AsyncGenerator<TikTokComment>;
|
|
668
698
|
}
|
|
669
699
|
|
|
700
|
+
declare class Trustpilot extends APIResource {
|
|
701
|
+
getBusiness(domain: string): Promise<APIResponse<Record<string, unknown>>>;
|
|
702
|
+
getBusinessReviews(domain: string, options?: {
|
|
703
|
+
page?: number;
|
|
704
|
+
sort?: string;
|
|
705
|
+
stars?: number;
|
|
706
|
+
languages?: string;
|
|
707
|
+
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
708
|
+
searchBusinesses(q: string, options?: {
|
|
709
|
+
page?: number;
|
|
710
|
+
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
711
|
+
searchCategories(q: string): Promise<APIResponse<Record<string, unknown>>>;
|
|
712
|
+
getSuggestions(q: string): Promise<APIResponse<Record<string, unknown>>>;
|
|
713
|
+
}
|
|
714
|
+
|
|
670
715
|
declare class WebFetch extends APIResource {
|
|
671
716
|
fetch(url: string, options?: {
|
|
672
717
|
format?: string;
|
|
@@ -749,6 +794,9 @@ declare class ByCrawl {
|
|
|
749
794
|
readonly dcard: Dcard;
|
|
750
795
|
readonly gmaps: GMaps;
|
|
751
796
|
readonly job104: Job104;
|
|
797
|
+
readonly trustpilot: Trustpilot;
|
|
798
|
+
readonly ptt: PTT;
|
|
799
|
+
readonly rent591: Rent591;
|
|
752
800
|
readonly web: WebFetch;
|
|
753
801
|
private readonly _transport;
|
|
754
802
|
constructor(options?: ByCrawlOptions);
|
package/dist/index.d.ts
CHANGED
|
@@ -488,25 +488,30 @@ declare class Dcard extends APIResource {
|
|
|
488
488
|
|
|
489
489
|
declare class Facebook extends APIResource {
|
|
490
490
|
getUser(username: string): Promise<APIResponse<FacebookUser>>;
|
|
491
|
-
getUserPosts(username: string
|
|
491
|
+
getUserPosts(username: string, options?: {
|
|
492
|
+
count?: number;
|
|
493
|
+
}): Promise<APIResponse<FacebookPost[]>>;
|
|
494
|
+
getPagePosts(pageId: string, options?: {
|
|
495
|
+
count?: number;
|
|
496
|
+
}): Promise<APIResponse<FacebookPost[]>>;
|
|
492
497
|
getPost(options: {
|
|
493
498
|
url: string;
|
|
494
499
|
}): Promise<APIResponse<FacebookPost>>;
|
|
495
500
|
getPostComments(options: {
|
|
496
501
|
url: string;
|
|
497
|
-
cursor?: string;
|
|
498
502
|
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
499
503
|
searchPosts(q: string, options?: {
|
|
500
504
|
count?: number;
|
|
501
|
-
cursor?: string;
|
|
502
505
|
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
503
|
-
|
|
506
|
+
browseMarketplace(options?: {
|
|
507
|
+
location?: string;
|
|
504
508
|
category?: string;
|
|
505
509
|
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
506
|
-
|
|
510
|
+
searchMarketplace(q: string, options?: {
|
|
507
511
|
location?: string;
|
|
512
|
+
category?: string;
|
|
508
513
|
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
509
|
-
|
|
514
|
+
getMarketplaceItem(listingId: string): Promise<APIResponse<Record<string, unknown>>>;
|
|
510
515
|
iterPostComments(options: {
|
|
511
516
|
url: string;
|
|
512
517
|
}): AsyncGenerator<Record<string, unknown>>;
|
|
@@ -562,14 +567,14 @@ declare class LinkedIn extends APIResource {
|
|
|
562
567
|
count?: number;
|
|
563
568
|
offset?: number;
|
|
564
569
|
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
565
|
-
searchJobs(
|
|
570
|
+
searchJobs(q: string, options?: {
|
|
566
571
|
location?: string;
|
|
567
572
|
count?: number;
|
|
568
573
|
offset?: number;
|
|
569
574
|
}): Promise<APIResponse<LinkedInJob[]>>;
|
|
570
575
|
getJob(jobId: string): Promise<APIResponse<LinkedInJob>>;
|
|
571
576
|
getPost(postId: string): Promise<APIResponse<LinkedInPost>>;
|
|
572
|
-
searchUsers(
|
|
577
|
+
searchUsers(q: string, options?: {
|
|
573
578
|
count?: number;
|
|
574
579
|
offset?: number;
|
|
575
580
|
}): Promise<APIResponse<LinkedInUser[]>>;
|
|
@@ -577,23 +582,38 @@ declare class LinkedIn extends APIResource {
|
|
|
577
582
|
iterCompanyJobs(companyId: string, options?: {
|
|
578
583
|
count?: number;
|
|
579
584
|
}): AsyncGenerator<LinkedInJob>;
|
|
580
|
-
iterSearchJobs(
|
|
585
|
+
iterSearchJobs(q: string, options?: {
|
|
581
586
|
location?: string;
|
|
582
587
|
count?: number;
|
|
583
588
|
}): AsyncGenerator<LinkedInJob>;
|
|
584
589
|
}
|
|
585
590
|
|
|
591
|
+
declare class PTT extends APIResource {
|
|
592
|
+
getBoard(boardName: string): Promise<APIResponse<Record<string, unknown>>>;
|
|
593
|
+
getBoardPosts(boardName: string, options?: {
|
|
594
|
+
page?: number;
|
|
595
|
+
count?: number;
|
|
596
|
+
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
597
|
+
getPost(url: string): Promise<APIResponse<Record<string, unknown>>>;
|
|
598
|
+
searchPosts(boardName: string, q: string, options?: {
|
|
599
|
+
count?: number;
|
|
600
|
+
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
601
|
+
}
|
|
602
|
+
|
|
586
603
|
declare class Reddit extends APIResource {
|
|
587
604
|
getSubreddit(name: string): Promise<APIResponse<Subreddit>>;
|
|
588
605
|
getSubredditPosts(name: string, options?: {
|
|
589
606
|
sort?: string;
|
|
590
607
|
t?: string;
|
|
591
608
|
count?: number;
|
|
609
|
+
after?: string;
|
|
592
610
|
}): Promise<APIResponse<RedditPost[]>>;
|
|
593
611
|
getPost(postId: string): Promise<APIResponse<RedditPost>>;
|
|
594
612
|
searchPosts(q: string, options?: {
|
|
595
613
|
sort?: string;
|
|
614
|
+
t?: string;
|
|
596
615
|
count?: number;
|
|
616
|
+
after?: string;
|
|
597
617
|
}): Promise<APIResponse<RedditPost[]>>;
|
|
598
618
|
getUser(username: string): Promise<APIResponse<RedditUser>>;
|
|
599
619
|
getUserPosts(username: string, options?: {
|
|
@@ -604,13 +624,21 @@ declare class Reddit extends APIResource {
|
|
|
604
624
|
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
605
625
|
}
|
|
606
626
|
|
|
627
|
+
declare class Rent591 extends APIResource {
|
|
628
|
+
getListings(options?: {
|
|
629
|
+
region?: number;
|
|
630
|
+
first_row?: number;
|
|
631
|
+
kind?: number;
|
|
632
|
+
section?: number;
|
|
633
|
+
price?: string;
|
|
634
|
+
count?: number;
|
|
635
|
+
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
636
|
+
getListing(listingId: number): Promise<APIResponse<Record<string, unknown>>>;
|
|
637
|
+
}
|
|
638
|
+
|
|
607
639
|
declare class Threads extends APIResource {
|
|
608
|
-
getPost(postId: string
|
|
609
|
-
|
|
610
|
-
}): Promise<APIResponse<ThreadsPost>>;
|
|
611
|
-
getPosts(ids: string[], options?: {
|
|
612
|
-
mode?: string;
|
|
613
|
-
}): Promise<APIResponse<ThreadsPost[]>>;
|
|
640
|
+
getPost(postId: string): Promise<APIResponse<ThreadsPost>>;
|
|
641
|
+
getPosts(ids: string[]): Promise<APIResponse<ThreadsPost[]>>;
|
|
614
642
|
searchPosts(q: string, options?: {
|
|
615
643
|
count?: number;
|
|
616
644
|
}): Promise<APIResponse<ThreadsPost[]>>;
|
|
@@ -660,13 +688,30 @@ declare class TikTok extends APIResource {
|
|
|
660
688
|
category?: string;
|
|
661
689
|
count?: number;
|
|
662
690
|
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
663
|
-
search(
|
|
691
|
+
search(q: string, options?: {
|
|
664
692
|
count?: number;
|
|
665
693
|
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
666
|
-
getVideoSubtitles(videoId: string
|
|
694
|
+
getVideoSubtitles(videoId: string, options?: {
|
|
695
|
+
language?: string;
|
|
696
|
+
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
667
697
|
iterVideoComments(videoId: string): AsyncGenerator<TikTokComment>;
|
|
668
698
|
}
|
|
669
699
|
|
|
700
|
+
declare class Trustpilot extends APIResource {
|
|
701
|
+
getBusiness(domain: string): Promise<APIResponse<Record<string, unknown>>>;
|
|
702
|
+
getBusinessReviews(domain: string, options?: {
|
|
703
|
+
page?: number;
|
|
704
|
+
sort?: string;
|
|
705
|
+
stars?: number;
|
|
706
|
+
languages?: string;
|
|
707
|
+
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
708
|
+
searchBusinesses(q: string, options?: {
|
|
709
|
+
page?: number;
|
|
710
|
+
}): Promise<APIResponse<Record<string, unknown>>>;
|
|
711
|
+
searchCategories(q: string): Promise<APIResponse<Record<string, unknown>>>;
|
|
712
|
+
getSuggestions(q: string): Promise<APIResponse<Record<string, unknown>>>;
|
|
713
|
+
}
|
|
714
|
+
|
|
670
715
|
declare class WebFetch extends APIResource {
|
|
671
716
|
fetch(url: string, options?: {
|
|
672
717
|
format?: string;
|
|
@@ -749,6 +794,9 @@ declare class ByCrawl {
|
|
|
749
794
|
readonly dcard: Dcard;
|
|
750
795
|
readonly gmaps: GMaps;
|
|
751
796
|
readonly job104: Job104;
|
|
797
|
+
readonly trustpilot: Trustpilot;
|
|
798
|
+
readonly ptt: PTT;
|
|
799
|
+
readonly rent591: Rent591;
|
|
752
800
|
readonly web: WebFetch;
|
|
753
801
|
private readonly _transport;
|
|
754
802
|
constructor(options?: ByCrawlOptions);
|
package/dist/index.js
CHANGED
|
@@ -439,8 +439,15 @@ var Facebook = class extends APIResource {
|
|
|
439
439
|
castTo: (r) => r
|
|
440
440
|
});
|
|
441
441
|
}
|
|
442
|
-
async getUserPosts(username) {
|
|
443
|
-
return this._request("GET", `/facebook/users/${username}/posts
|
|
442
|
+
async getUserPosts(username, options) {
|
|
443
|
+
return this._request("GET", `/facebook/users/${username}/posts`, {
|
|
444
|
+
params: { count: options?.count }
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
async getPagePosts(pageId, options) {
|
|
448
|
+
return this._request("GET", `/facebook/pages/${pageId}/posts`, {
|
|
449
|
+
params: { count: options?.count }
|
|
450
|
+
});
|
|
444
451
|
}
|
|
445
452
|
async getPost(options) {
|
|
446
453
|
return this._get(`/facebook/posts`, {
|
|
@@ -450,25 +457,25 @@ var Facebook = class extends APIResource {
|
|
|
450
457
|
}
|
|
451
458
|
async getPostComments(options) {
|
|
452
459
|
return this._get(`/facebook/posts/comments`, {
|
|
453
|
-
params: { url: options.url
|
|
460
|
+
params: { url: options.url }
|
|
454
461
|
});
|
|
455
462
|
}
|
|
456
463
|
async searchPosts(q, options) {
|
|
457
464
|
return this._get(`/facebook/posts/search`, {
|
|
458
|
-
params: { q, count: options?.count
|
|
465
|
+
params: { q, count: options?.count }
|
|
459
466
|
});
|
|
460
467
|
}
|
|
461
|
-
async
|
|
468
|
+
async browseMarketplace(options) {
|
|
462
469
|
return this._get(`/facebook/marketplace/listings`, {
|
|
463
|
-
params: { location, category: options?.category }
|
|
470
|
+
params: { location: options?.location, category: options?.category }
|
|
464
471
|
});
|
|
465
472
|
}
|
|
466
|
-
async
|
|
473
|
+
async searchMarketplace(q, options) {
|
|
467
474
|
return this._get(`/facebook/marketplace/search`, {
|
|
468
|
-
params: { q, location: options?.location }
|
|
475
|
+
params: { q, location: options?.location, category: options?.category }
|
|
469
476
|
});
|
|
470
477
|
}
|
|
471
|
-
async
|
|
478
|
+
async getMarketplaceItem(listingId) {
|
|
472
479
|
return this._get(`/facebook/marketplace/items/${listingId}`);
|
|
473
480
|
}
|
|
474
481
|
// -- Auto-pagination iterators --
|
|
@@ -593,10 +600,10 @@ var LinkedIn = class extends APIResource {
|
|
|
593
600
|
params: { count: options?.count, offset: options?.offset }
|
|
594
601
|
});
|
|
595
602
|
}
|
|
596
|
-
async searchJobs(
|
|
603
|
+
async searchJobs(q, options) {
|
|
597
604
|
return this._getList(`/linkedin/jobs/search`, {
|
|
598
605
|
params: {
|
|
599
|
-
q
|
|
606
|
+
q,
|
|
600
607
|
location: options?.location,
|
|
601
608
|
count: options?.count,
|
|
602
609
|
offset: options?.offset
|
|
@@ -615,9 +622,9 @@ var LinkedIn = class extends APIResource {
|
|
|
615
622
|
castTo: (r) => r
|
|
616
623
|
});
|
|
617
624
|
}
|
|
618
|
-
async searchUsers(
|
|
625
|
+
async searchUsers(q, options) {
|
|
619
626
|
return this._getList(`/linkedin/users/search`, {
|
|
620
|
-
params: { q
|
|
627
|
+
params: { q, count: options?.count, offset: options?.offset },
|
|
621
628
|
itemsKey: "users",
|
|
622
629
|
castTo: (r) => r
|
|
623
630
|
});
|
|
@@ -636,16 +643,38 @@ var LinkedIn = class extends APIResource {
|
|
|
636
643
|
castTo: (r) => r
|
|
637
644
|
});
|
|
638
645
|
}
|
|
639
|
-
iterSearchJobs(
|
|
646
|
+
iterSearchJobs(q, options) {
|
|
640
647
|
const count = options?.count ?? 10;
|
|
641
648
|
return this._paginateByOffset(`/linkedin/jobs/search`, {
|
|
642
|
-
params: { q
|
|
649
|
+
params: { q, location: options?.location, count, limit: count },
|
|
643
650
|
itemsKey: "jobs",
|
|
644
651
|
castTo: (r) => r
|
|
645
652
|
});
|
|
646
653
|
}
|
|
647
654
|
};
|
|
648
655
|
|
|
656
|
+
// src/platforms/ptt.ts
|
|
657
|
+
var PTT = class extends APIResource {
|
|
658
|
+
async getBoard(boardName) {
|
|
659
|
+
return this._get(`/ptt/boards/${boardName}`);
|
|
660
|
+
}
|
|
661
|
+
async getBoardPosts(boardName, options) {
|
|
662
|
+
return this._get(`/ptt/boards/${boardName}/posts`, {
|
|
663
|
+
params: { page: options?.page, count: options?.count }
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
async getPost(url) {
|
|
667
|
+
return this._get(`/ptt/posts`, {
|
|
668
|
+
params: { url }
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
async searchPosts(boardName, q, options) {
|
|
672
|
+
return this._get(`/ptt/boards/${boardName}/search`, {
|
|
673
|
+
params: { q, count: options?.count }
|
|
674
|
+
});
|
|
675
|
+
}
|
|
676
|
+
};
|
|
677
|
+
|
|
649
678
|
// src/platforms/reddit.ts
|
|
650
679
|
var Reddit = class extends APIResource {
|
|
651
680
|
async getSubreddit(name) {
|
|
@@ -655,7 +684,12 @@ var Reddit = class extends APIResource {
|
|
|
655
684
|
}
|
|
656
685
|
async getSubredditPosts(name, options) {
|
|
657
686
|
return this._getList(`/reddit/subreddits/${name}/posts`, {
|
|
658
|
-
params: {
|
|
687
|
+
params: {
|
|
688
|
+
sort: options?.sort,
|
|
689
|
+
t: options?.t,
|
|
690
|
+
count: options?.count,
|
|
691
|
+
after: options?.after
|
|
692
|
+
},
|
|
659
693
|
itemsKey: "posts",
|
|
660
694
|
castTo: (r) => r
|
|
661
695
|
});
|
|
@@ -667,7 +701,13 @@ var Reddit = class extends APIResource {
|
|
|
667
701
|
}
|
|
668
702
|
async searchPosts(q, options) {
|
|
669
703
|
return this._getList(`/reddit/posts/search`, {
|
|
670
|
-
params: {
|
|
704
|
+
params: {
|
|
705
|
+
q,
|
|
706
|
+
sort: options?.sort,
|
|
707
|
+
t: options?.t,
|
|
708
|
+
count: options?.count,
|
|
709
|
+
after: options?.after
|
|
710
|
+
},
|
|
671
711
|
itemsKey: "posts",
|
|
672
712
|
castTo: (r) => r
|
|
673
713
|
});
|
|
@@ -689,17 +729,35 @@ var Reddit = class extends APIResource {
|
|
|
689
729
|
}
|
|
690
730
|
};
|
|
691
731
|
|
|
732
|
+
// src/platforms/rent591.ts
|
|
733
|
+
var Rent591 = class extends APIResource {
|
|
734
|
+
async getListings(options) {
|
|
735
|
+
return this._get(`/rent591/listings`, {
|
|
736
|
+
params: {
|
|
737
|
+
region: options?.region,
|
|
738
|
+
first_row: options?.first_row,
|
|
739
|
+
kind: options?.kind,
|
|
740
|
+
section: options?.section,
|
|
741
|
+
price: options?.price,
|
|
742
|
+
count: options?.count
|
|
743
|
+
}
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
async getListing(listingId) {
|
|
747
|
+
return this._get(`/rent591/listings/${listingId}`);
|
|
748
|
+
}
|
|
749
|
+
};
|
|
750
|
+
|
|
692
751
|
// src/platforms/threads.ts
|
|
693
752
|
var Threads = class extends APIResource {
|
|
694
|
-
async getPost(postId
|
|
753
|
+
async getPost(postId) {
|
|
695
754
|
return this._get(`/threads/posts/${postId}`, {
|
|
696
|
-
params: { mode: options?.mode },
|
|
697
755
|
castTo: (r) => r
|
|
698
756
|
});
|
|
699
757
|
}
|
|
700
|
-
async getPosts(ids
|
|
758
|
+
async getPosts(ids) {
|
|
701
759
|
const resp = await this._request("GET", `/threads/posts`, {
|
|
702
|
-
params: { ids: ids.join(",")
|
|
760
|
+
params: { ids: ids.join(",") }
|
|
703
761
|
});
|
|
704
762
|
return resp;
|
|
705
763
|
}
|
|
@@ -815,13 +873,15 @@ var TikTok = class extends APIResource {
|
|
|
815
873
|
params: { category: options?.category, count: options?.count }
|
|
816
874
|
});
|
|
817
875
|
}
|
|
818
|
-
async search(
|
|
876
|
+
async search(q, options) {
|
|
819
877
|
return this._get(`/tiktok/videos/search`, {
|
|
820
|
-
params: { q
|
|
878
|
+
params: { q, count: options?.count }
|
|
821
879
|
});
|
|
822
880
|
}
|
|
823
|
-
async getVideoSubtitles(videoId) {
|
|
824
|
-
return this._get(`/tiktok/videos/${videoId}/subtitles
|
|
881
|
+
async getVideoSubtitles(videoId, options) {
|
|
882
|
+
return this._get(`/tiktok/videos/${videoId}/subtitles`, {
|
|
883
|
+
params: { language: options?.language }
|
|
884
|
+
});
|
|
825
885
|
}
|
|
826
886
|
// -- Auto-pagination iterators --
|
|
827
887
|
iterVideoComments(videoId) {
|
|
@@ -833,6 +893,38 @@ var TikTok = class extends APIResource {
|
|
|
833
893
|
}
|
|
834
894
|
};
|
|
835
895
|
|
|
896
|
+
// src/platforms/trustpilot.ts
|
|
897
|
+
var Trustpilot = class extends APIResource {
|
|
898
|
+
async getBusiness(domain) {
|
|
899
|
+
return this._get(`/trustpilot/businesses/${domain}`);
|
|
900
|
+
}
|
|
901
|
+
async getBusinessReviews(domain, options) {
|
|
902
|
+
return this._get(`/trustpilot/businesses/${domain}/reviews`, {
|
|
903
|
+
params: {
|
|
904
|
+
page: options?.page,
|
|
905
|
+
sort: options?.sort,
|
|
906
|
+
stars: options?.stars,
|
|
907
|
+
languages: options?.languages
|
|
908
|
+
}
|
|
909
|
+
});
|
|
910
|
+
}
|
|
911
|
+
async searchBusinesses(q, options) {
|
|
912
|
+
return this._get(`/trustpilot/businesses/search`, {
|
|
913
|
+
params: { q, page: options?.page }
|
|
914
|
+
});
|
|
915
|
+
}
|
|
916
|
+
async searchCategories(q) {
|
|
917
|
+
return this._get(`/trustpilot/categories/search`, {
|
|
918
|
+
params: { q }
|
|
919
|
+
});
|
|
920
|
+
}
|
|
921
|
+
async getSuggestions(q) {
|
|
922
|
+
return this._get(`/trustpilot/suggestions`, {
|
|
923
|
+
params: { q }
|
|
924
|
+
});
|
|
925
|
+
}
|
|
926
|
+
};
|
|
927
|
+
|
|
836
928
|
// src/platforms/webfetch.ts
|
|
837
929
|
var WebFetch = class extends APIResource {
|
|
838
930
|
async fetch(url, options) {
|
|
@@ -945,6 +1037,9 @@ var ByCrawl = class {
|
|
|
945
1037
|
dcard;
|
|
946
1038
|
gmaps;
|
|
947
1039
|
job104;
|
|
1040
|
+
trustpilot;
|
|
1041
|
+
ptt;
|
|
1042
|
+
rent591;
|
|
948
1043
|
web;
|
|
949
1044
|
_transport;
|
|
950
1045
|
constructor(options) {
|
|
@@ -971,6 +1066,9 @@ var ByCrawl = class {
|
|
|
971
1066
|
this.dcard = new Dcard(this._transport);
|
|
972
1067
|
this.gmaps = new GMaps(this._transport);
|
|
973
1068
|
this.job104 = new Job104(this._transport);
|
|
1069
|
+
this.trustpilot = new Trustpilot(this._transport);
|
|
1070
|
+
this.ptt = new PTT(this._transport);
|
|
1071
|
+
this.rent591 = new Rent591(this._transport);
|
|
974
1072
|
this.web = new WebFetch(this._transport);
|
|
975
1073
|
}
|
|
976
1074
|
};
|