ensembledata 0.1.12 → 0.1.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ensembledata",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "Node.js bindings for the EnsembleData API",
5
5
  "author": "EnsembleData <hello@ensembledata.com>",
6
6
  "contributors": [
package/src/client.js CHANGED
@@ -105,7 +105,7 @@ class TiktokEndpoints {
105
105
  * keyword: string;
106
106
  * cursor?: number;
107
107
  * period: "0" | "1" | "7" | "30" | "90" | "180";
108
- * sorting?: "0" | "1";
108
+ * sorting?: "0" | "1" | "2";
109
109
  * country?: string;
110
110
  * matchExactly?: boolean;
111
111
  * getAuthorStats?: boolean;
@@ -144,7 +144,7 @@ class TiktokEndpoints {
144
144
  * @param {{
145
145
  * keyword: string;
146
146
  * period: "0" | "1" | "7" | "30" | "90" | "180";
147
- * sorting?: "0" | "1";
147
+ * sorting?: "0" | "1" | "2";
148
148
  * country?: string;
149
149
  * matchExactly?: boolean;
150
150
  * }} params
@@ -812,6 +812,7 @@ class InstagramEndpoints {
812
812
  * chunkSize?: number;
813
813
  * cursor?: string;
814
814
  * alternativeMethod?: boolean;
815
+ * fetchPlayCount?: boolean;
815
816
  * }} params
816
817
  * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
817
818
  * @returns {Promise<EDResponse>}
@@ -824,6 +825,7 @@ class InstagramEndpoints {
824
825
  chunkSize = undefined,
825
826
  cursor = undefined,
826
827
  alternativeMethod = undefined,
828
+ fetchPlayCount = undefined,
827
829
  },
828
830
  options = {},
829
831
  ) {
@@ -835,6 +837,7 @@ class InstagramEndpoints {
835
837
  chunk_size: chunkSize,
836
838
  start_cursor: cursor,
837
839
  alternative_method: alternativeMethod,
840
+ fetch_play_count: fetchPlayCount,
838
841
  });
839
842
  return this.#requester.get("/instagram/user/posts", params, {
840
843
  timeout: options.timeout,
@@ -872,14 +875,15 @@ class InstagramEndpoints {
872
875
  }
873
876
 
874
877
  /**
875
- * @param {{ username: string }} params
878
+ * @param {{ username: string; backupMethod?: boolean }} params
876
879
  * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
877
880
  * @returns {Promise<EDResponse>}
878
881
  */
879
- userDetailedInfo({ username }, options = {}) {
882
+ userDetailedInfo({ username, backupMethod = undefined }, options = {}) {
880
883
  const params = filterUndefinedValues({
881
884
  ...options.extraParams,
882
885
  username,
886
+ backup_method: backupMethod,
883
887
  });
884
888
  return this.#requester.get("/instagram/user/detailed-info", params, {
885
889
  timeout: options.timeout,
@@ -939,35 +943,23 @@ class InstagramEndpoints {
939
943
  }
940
944
 
941
945
  /**
942
- * @param {{ userId: number; cursor?: string; chunkSize?: number }} params
946
+ * @param {{
947
+ * code: string;
948
+ * numComments?: number;
949
+ * fetchPlayCount?: boolean;
950
+ * }} params
943
951
  * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
944
952
  * @returns {Promise<EDResponse>}
945
953
  */
946
- userTaggedPosts(
947
- { userId, cursor = undefined, chunkSize = undefined },
954
+ postInfoAndComments(
955
+ { code, numComments = undefined, fetchPlayCount = undefined },
948
956
  options = {},
949
957
  ) {
950
- const params = filterUndefinedValues({
951
- ...options.extraParams,
952
- user_id: userId,
953
- cursor,
954
- chunk_size: chunkSize,
955
- });
956
- return this.#requester.get("/instagram/user/tagged-posts", params, {
957
- timeout: options.timeout,
958
- });
959
- }
960
-
961
- /**
962
- * @param {{ code: string; numComments?: number }} params
963
- * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
964
- * @returns {Promise<EDResponse>}
965
- */
966
- postInfoAndComments({ code, numComments = undefined }, options = {}) {
967
958
  const params = filterUndefinedValues({
968
959
  ...options.extraParams,
969
960
  code,
970
961
  n_comments_to_fetch: numComments,
962
+ fetch_play_count: fetchPlayCount,
971
963
  });
972
964
  return this.#requester.get("/instagram/post/details", params, {
973
965
  timeout: options.timeout,
@@ -1012,16 +1004,17 @@ class InstagramEndpoints {
1012
1004
  }
1013
1005
 
1014
1006
  /**
1015
- * @param {{ text: string }} params
1007
+ * @param {{ text: string; cursor: string }} params
1016
1008
  * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
1017
1009
  * @returns {Promise<EDResponse>}
1018
1010
  */
1019
- search({ text }, options = {}) {
1011
+ reelsSearch({ text, cursor }, options = {}) {
1020
1012
  const params = filterUndefinedValues({
1021
1013
  ...options.extraParams,
1022
1014
  text,
1015
+ cursor,
1023
1016
  });
1024
- return this.#requester.get("/instagram/search", params, {
1017
+ return this.#requester.get("/instagram/reels/search", params, {
1025
1018
  timeout: options.timeout,
1026
1019
  });
1027
1020
  }
@@ -1088,6 +1081,29 @@ class RedditEndpoints {
1088
1081
  this.#requester = requester;
1089
1082
  }
1090
1083
 
1084
+ /**
1085
+ * @param {{
1086
+ * name: string;
1087
+ * sort: "relevance" | "hot" | "new" | "top" | "comments";
1088
+ * period: "hour" | "day" | "week" | "month" | "year" | "all";
1089
+ * cursor: string;
1090
+ * }} params
1091
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
1092
+ * @returns {Promise<EDResponse>}
1093
+ */
1094
+ searchRedditKeywordSearchGet({ name, sort, period, cursor }, options = {}) {
1095
+ const params = filterUndefinedValues({
1096
+ ...options.extraParams,
1097
+ name,
1098
+ sort,
1099
+ period,
1100
+ cursor,
1101
+ });
1102
+ return this.#requester.get("/reddit/keyword/search", params, {
1103
+ timeout: options.timeout,
1104
+ });
1105
+ }
1106
+
1091
1107
  /**
1092
1108
  * @param {{
1093
1109
  * name: string;
@@ -1112,14 +1128,15 @@ class RedditEndpoints {
1112
1128
  }
1113
1129
 
1114
1130
  /**
1115
- * @param {{ permalink: string }} params
1131
+ * @param {{ permalink: string; cursor?: string }} params
1116
1132
  * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
1117
1133
  * @returns {Promise<EDResponse>}
1118
1134
  */
1119
- postComments({ permalink }, options = {}) {
1135
+ postComments({ permalink, cursor = undefined }, options = {}) {
1120
1136
  const params = filterUndefinedValues({
1121
1137
  ...options.extraParams,
1122
1138
  permalink,
1139
+ cursor,
1123
1140
  });
1124
1141
  return this.#requester.get("/reddit/post/comments", params, {
1125
1142
  timeout: options.timeout,
@@ -1169,6 +1186,23 @@ class TwitterEndpoints {
1169
1186
  });
1170
1187
  }
1171
1188
 
1189
+ /**
1190
+ * @param {{ name: string }} params
1191
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
1192
+ * @returns {Promise<EDResponse>}
1193
+ */
1194
+ userTweetsFromUsername({ name }, options = {}) {
1195
+ const params = filterUndefinedValues({
1196
+ ...options.extraParams,
1197
+ name,
1198
+ });
1199
+ return this.#requester.get(
1200
+ "/twitter/user/tweets-from-username",
1201
+ params,
1202
+ { timeout: options.timeout },
1203
+ );
1204
+ }
1205
+
1172
1206
  /**
1173
1207
  * @param {{ id: number }} params
1174
1208
  * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
@@ -1260,14 +1294,15 @@ class ThreadsEndpoints {
1260
1294
  }
1261
1295
 
1262
1296
  /**
1263
- * @param {{ id: number }} params
1297
+ * @param {{ id: number; shortcode?: string }} params
1264
1298
  * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
1265
1299
  * @returns {Promise<EDResponse>}
1266
1300
  */
1267
- postReplies({ id }, options = {}) {
1301
+ postReplies({ id, shortcode = undefined }, options = {}) {
1268
1302
  const params = filterUndefinedValues({
1269
1303
  ...options.extraParams,
1270
1304
  id,
1305
+ shortcode,
1271
1306
  });
1272
1307
  return this.#requester.get("/threads/post/replies", params, {
1273
1308
  timeout: options.timeout,
package/src/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "0.1.12";
1
+ export const VERSION = "0.1.13";