scavio 0.6.0 → 0.7.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 +77 -9
- package/dist/index.cjs +125 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +285 -2
- package/dist/index.d.ts +285 -2
- package/dist/index.js +125 -0
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Scavio
|
|
2
2
|
|
|
3
|
-
TypeScript SDK for the [Scavio Search API](https://scavio.dev) — real-time Google, Amazon, Walmart, YouTube, Reddit, TikTok, and
|
|
3
|
+
TypeScript SDK for the [Scavio Search API](https://scavio.dev) — real-time Google, Amazon, Walmart, YouTube, Reddit, TikTok, Instagram, Twitter, and LinkedIn data.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -149,16 +149,83 @@ await client.youtube.channelResolve({ channel: "@mkbhd" }); // handle/URL -> id
|
|
|
149
149
|
|
|
150
150
|
```typescript
|
|
151
151
|
// Search posts
|
|
152
|
-
await client.reddit.search({
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
152
|
+
await client.reddit.search({ query: "typescript", cursor: "..." });
|
|
153
|
+
|
|
154
|
+
// Search-as-you-type suggestions
|
|
155
|
+
await client.reddit.searchSuggestions({ query: "python" });
|
|
156
|
+
|
|
157
|
+
// Post detail (by post_id or url)
|
|
158
|
+
await client.reddit.post({ post_id: "t3_1v6ngaf" });
|
|
159
|
+
await client.reddit.post({ url: "https://reddit.com/r/typescript/comments/abc123" });
|
|
157
160
|
|
|
158
|
-
//
|
|
159
|
-
await client.reddit.
|
|
160
|
-
|
|
161
|
+
// Post comments and threaded replies
|
|
162
|
+
await client.reddit.postComments({ post_id: "t3_1v6ngaf", sort: "TOP" });
|
|
163
|
+
await client.reddit.commentReplies({
|
|
164
|
+
post_id: "t3_1v6ngaf",
|
|
165
|
+
cursor: "...", // reply_cursor from a comment
|
|
161
166
|
});
|
|
167
|
+
|
|
168
|
+
// Subreddit info and feed
|
|
169
|
+
await client.reddit.subreddit({ subreddit: "AskReddit" });
|
|
170
|
+
await client.reddit.subredditPosts({ subreddit: "AskReddit", sort: "HOT" });
|
|
171
|
+
|
|
172
|
+
// Redditor profile, posts, and comments
|
|
173
|
+
await client.reddit.user({ username: "spez" });
|
|
174
|
+
await client.reddit.userPosts({ username: "spez", sort: "NEW" });
|
|
175
|
+
await client.reddit.userComments({ username: "spez" });
|
|
176
|
+
|
|
177
|
+
// Site-wide popular feed and trending searches
|
|
178
|
+
await client.reddit.popular();
|
|
179
|
+
await client.reddit.trending();
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Twitter
|
|
183
|
+
|
|
184
|
+
```typescript
|
|
185
|
+
// Search tweets and people
|
|
186
|
+
await client.twitter.search({ search: "artificial intelligence", search_type: "Latest" });
|
|
187
|
+
|
|
188
|
+
// Tweet detail, comments, and retweeters
|
|
189
|
+
await client.twitter.tweet({ tweet_id: "1808168603721650364" });
|
|
190
|
+
await client.twitter.tweetComments({ tweet_id: "1808168603721650364", rank: "top" });
|
|
191
|
+
await client.twitter.tweetRetweeters({ tweet_id: "1808168603721650364" });
|
|
192
|
+
|
|
193
|
+
// User profile and feeds
|
|
194
|
+
await client.twitter.user({ screen_name: "elonmusk" });
|
|
195
|
+
await client.twitter.userTweets({ screen_name: "elonmusk" });
|
|
196
|
+
await client.twitter.userReplies({ screen_name: "elonmusk" });
|
|
197
|
+
await client.twitter.userMedia({ screen_name: "elonmusk" });
|
|
198
|
+
await client.twitter.userFollowers({ screen_name: "elonmusk" });
|
|
199
|
+
await client.twitter.userFollowings({ screen_name: "elonmusk" });
|
|
200
|
+
|
|
201
|
+
// Trending topics
|
|
202
|
+
await client.twitter.trending({ country: "UnitedStates" });
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### LinkedIn
|
|
206
|
+
|
|
207
|
+
```typescript
|
|
208
|
+
// Person profile, about, posts, and contact
|
|
209
|
+
await client.linkedin.person({ username: "williamhgates" });
|
|
210
|
+
await client.linkedin.personAbout({ username: "williamhgates" });
|
|
211
|
+
await client.linkedin.personPosts({ username: "williamhgates" });
|
|
212
|
+
await client.linkedin.personContact({ username: "williamhgates" });
|
|
213
|
+
|
|
214
|
+
// Company profile, posts, people, and jobs
|
|
215
|
+
await client.linkedin.company({ company: "microsoft" });
|
|
216
|
+
await client.linkedin.companyPosts({ company: "microsoft" });
|
|
217
|
+
await client.linkedin.companyPeople({ company: "microsoft" });
|
|
218
|
+
await client.linkedin.companyJobs({ company: "microsoft" });
|
|
219
|
+
|
|
220
|
+
// Search people, jobs, and posts
|
|
221
|
+
await client.linkedin.searchPeople({ search: "john", title: "engineer" });
|
|
222
|
+
await client.linkedin.searchJobs({ search: "software engineer" });
|
|
223
|
+
await client.linkedin.searchPosts({ search: "AI agents" });
|
|
224
|
+
|
|
225
|
+
// Job, post, and post comments
|
|
226
|
+
await client.linkedin.job({ job_id: "3900000000" });
|
|
227
|
+
await client.linkedin.post({ post_id: "7486820977411145728" });
|
|
228
|
+
await client.linkedin.postComments({ post_id: "7486820977411145728", sort_order: "relevance" });
|
|
162
229
|
```
|
|
163
230
|
|
|
164
231
|
### TikTok
|
|
@@ -282,6 +349,7 @@ MIT
|
|
|
282
349
|
- [Amazon Product API](https://scavio.dev/amazon-product-api) and [Walmart Product API](https://scavio.dev/walmart-product-api) — product search and details
|
|
283
350
|
- [YouTube API](https://scavio.dev/youtube-transcript-api), [TikTok API](https://scavio.dev/tiktok-api), and [Instagram API](https://scavio.dev/instagram-api) — video and social media data
|
|
284
351
|
- [Reddit API](https://scavio.dev/reddit-api) — posts and threaded comments
|
|
352
|
+
- [Twitter API](https://scavio.dev/twitter-api) and [LinkedIn API](https://scavio.dev/linkedin-api) — tweets, profiles, companies, and jobs
|
|
285
353
|
|
|
286
354
|
Teams choosing between providers can [compare Scavio vs alternatives](https://scavio.dev/compare) side by side.
|
|
287
355
|
|
package/dist/index.cjs
CHANGED
|
@@ -390,9 +390,39 @@ var RedditNamespace = class {
|
|
|
390
390
|
async search(options) {
|
|
391
391
|
return this.client._post("/api/v1/reddit/search", options);
|
|
392
392
|
}
|
|
393
|
+
async searchSuggestions(options) {
|
|
394
|
+
return this.client._post("/api/v1/reddit/search/suggestions", options);
|
|
395
|
+
}
|
|
393
396
|
async post(options) {
|
|
394
397
|
return this.client._post("/api/v1/reddit/post", options);
|
|
395
398
|
}
|
|
399
|
+
async postComments(options) {
|
|
400
|
+
return this.client._post("/api/v1/reddit/post/comments", options);
|
|
401
|
+
}
|
|
402
|
+
async commentReplies(options) {
|
|
403
|
+
return this.client._post("/api/v1/reddit/post/comments/replies", options);
|
|
404
|
+
}
|
|
405
|
+
async subreddit(options) {
|
|
406
|
+
return this.client._post("/api/v1/reddit/subreddit", options);
|
|
407
|
+
}
|
|
408
|
+
async subredditPosts(options) {
|
|
409
|
+
return this.client._post("/api/v1/reddit/subreddit/posts", options);
|
|
410
|
+
}
|
|
411
|
+
async user(options) {
|
|
412
|
+
return this.client._post("/api/v1/reddit/user", options);
|
|
413
|
+
}
|
|
414
|
+
async userPosts(options) {
|
|
415
|
+
return this.client._post("/api/v1/reddit/user/posts", options);
|
|
416
|
+
}
|
|
417
|
+
async userComments(options) {
|
|
418
|
+
return this.client._post("/api/v1/reddit/user/comments", options);
|
|
419
|
+
}
|
|
420
|
+
async popular(options = {}) {
|
|
421
|
+
return this.client._post("/api/v1/reddit/popular", options);
|
|
422
|
+
}
|
|
423
|
+
async trending() {
|
|
424
|
+
return this.client._post("/api/v1/reddit/trending", {});
|
|
425
|
+
}
|
|
396
426
|
};
|
|
397
427
|
|
|
398
428
|
// src/namespaces/tiktok.ts
|
|
@@ -571,6 +601,97 @@ var YouTubeNamespace = class {
|
|
|
571
601
|
}
|
|
572
602
|
};
|
|
573
603
|
|
|
604
|
+
// src/namespaces/twitter.ts
|
|
605
|
+
var TwitterNamespace = class {
|
|
606
|
+
constructor(client) {
|
|
607
|
+
this.client = client;
|
|
608
|
+
}
|
|
609
|
+
client;
|
|
610
|
+
async search(options) {
|
|
611
|
+
return this.client._post("/api/v1/twitter/search", options);
|
|
612
|
+
}
|
|
613
|
+
async tweet(options) {
|
|
614
|
+
return this.client._post("/api/v1/twitter/tweet", options);
|
|
615
|
+
}
|
|
616
|
+
async tweetComments(options) {
|
|
617
|
+
return this.client._post("/api/v1/twitter/tweet/comments", options);
|
|
618
|
+
}
|
|
619
|
+
async tweetRetweeters(options) {
|
|
620
|
+
return this.client._post("/api/v1/twitter/tweet/retweeters", options);
|
|
621
|
+
}
|
|
622
|
+
async user(options) {
|
|
623
|
+
return this.client._post("/api/v1/twitter/user", options);
|
|
624
|
+
}
|
|
625
|
+
async userTweets(options) {
|
|
626
|
+
return this.client._post("/api/v1/twitter/user/tweets", options);
|
|
627
|
+
}
|
|
628
|
+
async userReplies(options) {
|
|
629
|
+
return this.client._post("/api/v1/twitter/user/replies", options);
|
|
630
|
+
}
|
|
631
|
+
async userMedia(options) {
|
|
632
|
+
return this.client._post("/api/v1/twitter/user/media", options);
|
|
633
|
+
}
|
|
634
|
+
async userFollowers(options) {
|
|
635
|
+
return this.client._post("/api/v1/twitter/user/followers", options);
|
|
636
|
+
}
|
|
637
|
+
async userFollowings(options) {
|
|
638
|
+
return this.client._post("/api/v1/twitter/user/followings", options);
|
|
639
|
+
}
|
|
640
|
+
async trending(options = {}) {
|
|
641
|
+
return this.client._post("/api/v1/twitter/trending", options);
|
|
642
|
+
}
|
|
643
|
+
};
|
|
644
|
+
|
|
645
|
+
// src/namespaces/linkedin.ts
|
|
646
|
+
var LinkedInNamespace = class {
|
|
647
|
+
constructor(client) {
|
|
648
|
+
this.client = client;
|
|
649
|
+
}
|
|
650
|
+
client;
|
|
651
|
+
async person(options) {
|
|
652
|
+
return this.client._post("/api/v1/linkedin/person", options);
|
|
653
|
+
}
|
|
654
|
+
async personAbout(options) {
|
|
655
|
+
return this.client._post("/api/v1/linkedin/person/about", options);
|
|
656
|
+
}
|
|
657
|
+
async personPosts(options) {
|
|
658
|
+
return this.client._post("/api/v1/linkedin/person/posts", options);
|
|
659
|
+
}
|
|
660
|
+
async personContact(options) {
|
|
661
|
+
return this.client._post("/api/v1/linkedin/person/contact", options);
|
|
662
|
+
}
|
|
663
|
+
async company(options) {
|
|
664
|
+
return this.client._post("/api/v1/linkedin/company", options);
|
|
665
|
+
}
|
|
666
|
+
async companyPosts(options) {
|
|
667
|
+
return this.client._post("/api/v1/linkedin/company/posts", options);
|
|
668
|
+
}
|
|
669
|
+
async companyPeople(options) {
|
|
670
|
+
return this.client._post("/api/v1/linkedin/company/people", options);
|
|
671
|
+
}
|
|
672
|
+
async companyJobs(options) {
|
|
673
|
+
return this.client._post("/api/v1/linkedin/company/jobs", options);
|
|
674
|
+
}
|
|
675
|
+
async searchPeople(options) {
|
|
676
|
+
return this.client._post("/api/v1/linkedin/search/people", options);
|
|
677
|
+
}
|
|
678
|
+
async searchJobs(options) {
|
|
679
|
+
return this.client._post("/api/v1/linkedin/search/jobs", options);
|
|
680
|
+
}
|
|
681
|
+
async searchPosts(options) {
|
|
682
|
+
return this.client._post("/api/v1/linkedin/search/posts", options);
|
|
683
|
+
}
|
|
684
|
+
async job(options) {
|
|
685
|
+
return this.client._post("/api/v1/linkedin/job", options);
|
|
686
|
+
}
|
|
687
|
+
async post(options) {
|
|
688
|
+
return this.client._post("/api/v1/linkedin/post", options);
|
|
689
|
+
}
|
|
690
|
+
async postComments(options) {
|
|
691
|
+
return this.client._post("/api/v1/linkedin/post/comments", options);
|
|
692
|
+
}
|
|
693
|
+
};
|
|
694
|
+
|
|
574
695
|
// src/client.ts
|
|
575
696
|
var Scavio = class {
|
|
576
697
|
google;
|
|
@@ -580,6 +701,8 @@ var Scavio = class {
|
|
|
580
701
|
reddit;
|
|
581
702
|
tiktok;
|
|
582
703
|
instagram;
|
|
704
|
+
twitter;
|
|
705
|
+
linkedin;
|
|
583
706
|
apiKey;
|
|
584
707
|
baseUrl;
|
|
585
708
|
timeout;
|
|
@@ -605,6 +728,8 @@ var Scavio = class {
|
|
|
605
728
|
this.reddit = new RedditNamespace(this);
|
|
606
729
|
this.tiktok = new TikTokNamespace(this);
|
|
607
730
|
this.instagram = new InstagramNamespace(this);
|
|
731
|
+
this.twitter = new TwitterNamespace(this);
|
|
732
|
+
this.linkedin = new LinkedInNamespace(this);
|
|
608
733
|
}
|
|
609
734
|
/** @internal */
|
|
610
735
|
async _post(path, body) {
|