scavio 0.23.1 → 0.24.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/README.md CHANGED
@@ -785,13 +785,16 @@ await client.tiktokShop.resolve({ url: "https://vt.tiktok.com/ZT2AHoGsE/" });
785
785
 
786
786
  ### Instagram
787
787
 
788
- Credit cost varies by endpoint, in three tiers:
788
+ 20 endpoints. Typical credit cost per call:
789
789
 
790
790
  | Credits | Methods |
791
791
  |---|---|
792
- | 2 | `userPosts` |
793
- | 8 | `post`, `commentReplies` |
794
- | 10 | `profile`, `userReels`, `userTagged`, `userStories`, `postComments`, `searchUsers`, `searchHashtags`, `userFollowers`, `userFollowings` |
792
+ | 1 | `profile`, `musicPosts` (per page), `userReels`, `userTagged` (2 the first time a username is looked up) |
793
+ | 2 | `userPosts`, `userStories`, `post`, `postComments`, `commentReplies`, `searchUsers`, `searchHashtags`, `userFollowers`, `userFollowings`, `userHighlights`, `highlightStories`, `searchReels`, `searchMusic`, `searchLocations`, `userSimilar`, `postLikers` |
794
+ | 8 | `searchUsers` / `searchHashtags` when a `cursor` is sent |
795
+
796
+ A request can cost up to 10 when it needs extra work; `credits_used` in the
797
+ response is the exact charge.
795
798
 
796
799
  ```typescript
797
800
  // User profile
@@ -802,23 +805,33 @@ await client.instagram.userPosts({ username: "instagram", count: 12 });
802
805
  await client.instagram.userReels({ username: "instagram" });
803
806
  await client.instagram.userTagged({ username: "instagram" });
804
807
 
805
- // User stories
808
+ // User stories, highlights and the stories saved in one highlight
806
809
  await client.instagram.userStories({ username: "instagram" });
810
+ await client.instagram.userHighlights({ username: "natgeo" });
811
+ await client.instagram.highlightStories({ highlight_id: "highlight:18149897764550869" });
807
812
 
808
- // Post detail (by url, media_id, or shortcode)
813
+ // Post detail (by url, media_id, or shortcode) and who liked it
809
814
  await client.instagram.post({ shortcode: "DUajw4YkorV" });
815
+ await client.instagram.postLikers({ shortcode: "DUajw4YkorV" });
810
816
 
811
817
  // Post comments and replies
812
818
  await client.instagram.postComments({ shortcode: "DUajw4YkorV", sort_order: "newest" });
813
819
  await client.instagram.commentReplies({ media_id: "123", comment_id: "456" });
814
820
 
815
- // Search
821
+ // Search users, hashtags, Reels and places
816
822
  await client.instagram.searchUsers({ keyword: "justin" });
817
823
  await client.instagram.searchHashtags({ keyword: "fashion" });
824
+ await client.instagram.searchReels({ keyword: "latte art" });
825
+ await client.instagram.searchLocations({ keyword: "central park" });
826
+
827
+ // Audio: find a track, then the Reels that use it
828
+ await client.instagram.searchMusic({ keyword: "espresso" });
829
+ await client.instagram.musicPosts({ music_id: "1747512212697470" });
818
830
 
819
- // Followers / followings
831
+ // Followers / followings / similar accounts
820
832
  await client.instagram.userFollowers({ username: "instagram", count: 50 });
821
833
  await client.instagram.userFollowings({ username: "instagram" });
834
+ await client.instagram.userSimilar({ username: "mrbeast" });
822
835
  ```
823
836
 
824
837
  ### Threads
package/dist/index.cjs CHANGED
@@ -232,7 +232,7 @@ function parseRetryAfter(header) {
232
232
  var BASE_URL = "https://api.scavio.dev";
233
233
  var DEFAULT_TIMEOUT = 3e4;
234
234
  var DEFAULT_MAX_RETRIES = 2;
235
- var SDK_VERSION = true ? "0.23.1" : "0.0.0";
235
+ var SDK_VERSION = true ? "0.24.1" : "0.0.0";
236
236
  var USER_AGENT = `scavio-js/${SDK_VERSION}`;
237
237
  function isServerRuntime() {
238
238
  const g = globalThis;
@@ -812,42 +812,86 @@ var InstagramNamespace = class {
812
812
  this.client = client;
813
813
  }
814
814
  client;
815
+ /** Get a user profile by username or user_id. 1 credit. */
815
816
  async profile(options) {
816
817
  return this.client._post("/api/v1/instagram/profile", options);
817
818
  }
819
+ /** Get a user's posts, about 12 per page; page with `data.pagination_token`. 2 credits per page. */
818
820
  async userPosts(options) {
819
821
  return this.client._post("/api/v1/instagram/user/posts", options);
820
822
  }
823
+ /** Get a user's Reels. 1 credit (2 the first time a username is looked up). */
821
824
  async userReels(options) {
822
825
  return this.client._post("/api/v1/instagram/user/reels", options);
823
826
  }
827
+ /** Get posts a user is tagged in. 1 credit (2 the first time a username is looked up). */
824
828
  async userTagged(options) {
825
829
  return this.client._post("/api/v1/instagram/user/tagged", options);
826
830
  }
831
+ /** Get a user's active stories. 2 credits. */
827
832
  async userStories(options) {
828
833
  return this.client._post("/api/v1/instagram/user/stories", options);
829
834
  }
835
+ /** Get a single post by url, media_id or shortcode. 2 credits. */
830
836
  async post(options) {
831
837
  return this.client._post("/api/v1/instagram/post", options);
832
838
  }
839
+ /** Get comments on a post; page with `next_min_id`. 2 credits per page. */
833
840
  async postComments(options) {
834
841
  return this.client._post("/api/v1/instagram/post/comments", options);
835
842
  }
843
+ /** Get replies to a comment. 2 credits. */
836
844
  async commentReplies(options) {
837
845
  return this.client._post("/api/v1/instagram/post/comments/replies", options);
838
846
  }
847
+ /** Search users by keyword. 2 credits; 8 when a `cursor` is sent. */
839
848
  async searchUsers(options) {
840
849
  return this.client._post("/api/v1/instagram/search/users", options);
841
850
  }
851
+ /** Search hashtags by keyword. 2 credits; 8 when a `cursor` is sent. */
842
852
  async searchHashtags(options) {
843
853
  return this.client._post("/api/v1/instagram/search/hashtags", options);
844
854
  }
855
+ /** Get a user's followers; page with `next_max_id`. 2 credits per page. */
845
856
  async userFollowers(options) {
846
857
  return this.client._post("/api/v1/instagram/user/followers", options);
847
858
  }
859
+ /** Get the accounts a user follows; page with `next_max_id`. 2 credits per page. */
848
860
  async userFollowings(options) {
849
861
  return this.client._post("/api/v1/instagram/user/followings", options);
850
862
  }
863
+ /** List a user's story highlights (id, title, cover, item count). 2 credits. */
864
+ async userHighlights(options) {
865
+ return this.client._post("/api/v1/instagram/user/highlights", options);
866
+ }
867
+ /** Get every story saved in one highlight, with media URLs. 2 credits. */
868
+ async highlightStories(options) {
869
+ return this.client._post("/api/v1/instagram/highlight/stories", options);
870
+ }
871
+ /** Search Reels by keyword; page with `pagination_token`. 2 credits per page. */
872
+ async searchReels(options) {
873
+ return this.client._post("/api/v1/instagram/search/reels", options);
874
+ }
875
+ /** Search audio tracks by song or artist; returns the id `musicPosts` takes. 2 credits. */
876
+ async searchMusic(options) {
877
+ return this.client._post("/api/v1/instagram/search/music", options);
878
+ }
879
+ /** Get the Reels that use an audio track, plus its total reel count. 1 credit per page. */
880
+ async musicPosts(options) {
881
+ return this.client._post("/api/v1/instagram/music/posts", options);
882
+ }
883
+ /** Search places by name (id, name, address, coordinates). 2 credits. */
884
+ async searchLocations(options) {
885
+ return this.client._post("/api/v1/instagram/search/locations", options);
886
+ }
887
+ /** Get accounts similar to a user. Most creator accounts have them; some brand accounts return none. 2 credits. */
888
+ async userSimilar(options) {
889
+ return this.client._post("/api/v1/instagram/user/similar", options);
890
+ }
891
+ /** Get accounts that liked a post (up to about 1,000) and its total like count. 2 credits. */
892
+ async postLikers(options) {
893
+ return this.client._post("/api/v1/instagram/post/likers", options);
894
+ }
851
895
  };
852
896
 
853
897
  // src/namespaces/walmart.ts
@@ -1148,14 +1192,14 @@ var LinkedInNamespace = class {
1148
1192
  return this.client._post("/api/v1/linkedin/post/comments", options);
1149
1193
  }
1150
1194
  /**
1151
- * @deprecated Retired by the upstream provider. Always returns HTTP 410 and is
1195
+ * @deprecated Retired. Always returns HTTP 410 and is
1152
1196
  * never billed.
1153
1197
  */
1154
1198
  async personContact(options) {
1155
1199
  return this.client._post("/api/v1/linkedin/person/contact", options);
1156
1200
  }
1157
1201
  /**
1158
- * @deprecated Retired by the upstream provider. Always returns HTTP 410 and is
1202
+ * @deprecated Retired. Always returns HTTP 410 and is
1159
1203
  * never billed. `company()` returns `featured_employees`, a small sample of
1160
1204
  * staff profiles.
1161
1205
  */
@@ -1163,21 +1207,21 @@ var LinkedInNamespace = class {
1163
1207
  return this.client._post("/api/v1/linkedin/company/people", options);
1164
1208
  }
1165
1209
  /**
1166
- * @deprecated Retired by the upstream provider. Always returns HTTP 410 and is
1210
+ * @deprecated Retired. Always returns HTTP 410 and is
1167
1211
  * never billed. Use `searchJobs()` with the company name as the search term.
1168
1212
  */
1169
1213
  async companyJobs(options) {
1170
1214
  return this.client._post("/api/v1/linkedin/company/jobs", options);
1171
1215
  }
1172
1216
  /**
1173
- * @deprecated Retired by the upstream provider. Always returns HTTP 410 and is
1217
+ * @deprecated Retired. Always returns HTTP 410 and is
1174
1218
  * never billed.
1175
1219
  */
1176
1220
  async searchPeople(options) {
1177
1221
  return this.client._post("/api/v1/linkedin/search/people", options);
1178
1222
  }
1179
1223
  /**
1180
- * @deprecated Retired by the upstream provider. Always returns HTTP 410 and is
1224
+ * @deprecated Retired. Always returns HTTP 410 and is
1181
1225
  * never billed.
1182
1226
  */
1183
1227
  async searchPosts(options) {
@@ -1437,7 +1481,7 @@ var TargetNamespace = class {
1437
1481
  * Paged with `page` + `count` (1-28, default 24). `seller_id` and
1438
1482
  * `seller_name` are null on first-party rows, which means "sold by Target".
1439
1483
  *
1440
- * Costs 1 credit. Typically ~9s - it runs through a headless browser.
1484
+ * Costs 1 credit. Typically ~9s.
1441
1485
  */
1442
1486
  async search(options) {
1443
1487
  return this.client._post("/api/v1/target/search", options);
@@ -1603,9 +1647,8 @@ var RedfinNamespace = class {
1603
1647
  * houses, schools, climate risk, walkability and location scores, sun
1604
1648
  * exposure, monthly weather, permits, zoning, comparable sales and photos.
1605
1649
  *
1606
- * Reads the property PAGE, whose inlined request cache replaces the ~40
1607
- * upstream calls that page made - which is why it is the same price as
1608
- * search().
1650
+ * Returns the whole property page in one call, which is why it is the same
1651
+ * price as search().
1609
1652
  *
1610
1653
  * Costs 1 credit. Single response, no pagination.
1611
1654
  */
@@ -1835,7 +1878,7 @@ var YelpNamespace = class {
1835
1878
  * count.
1836
1879
  *
1837
1880
  * `term` + `location` or `url` is required, and `location` is effectively
1838
- * mandatory - Yelp geolocates a location-less search off the proxy exit.
1881
+ * mandatory - without it Yelp picks a location itself.
1839
1882
  * Paged with `page`; the page size is fixed at 10.
1840
1883
  *
1841
1884
  * Costs 2 credits.
@@ -1907,8 +1950,7 @@ var IndeedNamespace = class {
1907
1950
  * employment types, benefits, geocoded address, employer rating, applicant
1908
1951
  * count and the original ATS link.
1909
1952
  *
1910
- * Single response, no pagination. An unknown job key is a real 404 that
1911
- * scrape.do BILLS - take `job_id` from a search row.
1953
+ * Single response, no pagination. An unknown job key is a real 404 and IS BILLED - take `job_id` from a search row.
1912
1954
  *
1913
1955
  * Costs 2 credits.
1914
1956
  */
@@ -1920,8 +1962,7 @@ var IndeedNamespace = class {
1920
1962
  * approval, overall and per-category ratings, reported salaries, open roles
1921
1963
  * and locations.
1922
1964
  *
1923
- * Single response, no pagination. An unknown company slug is a real 404
1924
- * that scrape.do BILLS.
1965
+ * Single response, no pagination. An unknown company slug is a real 404 and IS BILLED.
1925
1966
  *
1926
1967
  * Costs 2 credits.
1927
1968
  */
@@ -1969,7 +2010,7 @@ var GlassdoorNamespace = class {
1969
2010
  * server-rendered reviews, AND reviews_url / salaries_url.
1970
2011
  *
1971
2012
  * THE CHAINING ENDPOINT: pass reviews_url / salaries_url back as `url` on
1972
- * reviews() and salaries() to halve the upstream fetches. `employer_id` or
2013
+ * reviews() and salaries() to halve the lookups. `employer_id` or
1973
2014
  * `url` is required - `company` is cosmetic and does not satisfy it.
1974
2015
  *
1975
2016
  * Costs 1 credit. Single response, no pagination. Typically ~3-47s.
@@ -2293,7 +2334,7 @@ var SECNamespace = class {
2293
2334
  * filer had more.
2294
2335
  *
2295
2336
  * Costs 1 credit - including with `include_history`, which is the one call
2296
- * that can buy more than one upstream fetch.
2337
+ * that can buy more than one lookup.
2297
2338
  */
2298
2339
  async filings(options) {
2299
2340
  return this.client._post("/api/v1/sec/filings", options);