x-twitter-scraper 0.19.0 → 0.21.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.
Files changed (257) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/README.md +120 -120
  3. package/client.d.mts +7 -2
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +7 -2
  6. package/client.d.ts.map +1 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/resources/activity.d.mts +18 -2
  11. package/resources/activity.d.mts.map +1 -1
  12. package/resources/activity.d.ts +18 -2
  13. package/resources/activity.d.ts.map +1 -1
  14. package/resources/credits.d.mts +5 -0
  15. package/resources/credits.d.mts.map +1 -1
  16. package/resources/credits.d.ts +5 -0
  17. package/resources/credits.d.ts.map +1 -1
  18. package/resources/extractions.d.mts +153 -5
  19. package/resources/extractions.d.mts.map +1 -1
  20. package/resources/extractions.d.ts +153 -5
  21. package/resources/extractions.d.ts.map +1 -1
  22. package/resources/index.d.mts +1 -1
  23. package/resources/index.d.mts.map +1 -1
  24. package/resources/index.d.ts +1 -1
  25. package/resources/index.d.ts.map +1 -1
  26. package/resources/index.js.map +1 -1
  27. package/resources/index.mjs.map +1 -1
  28. package/resources/monitors/index.d.mts +1 -1
  29. package/resources/monitors/index.d.mts.map +1 -1
  30. package/resources/monitors/index.d.ts +1 -1
  31. package/resources/monitors/index.d.ts.map +1 -1
  32. package/resources/monitors/index.js.map +1 -1
  33. package/resources/monitors/index.mjs.map +1 -1
  34. package/resources/monitors/monitors.d.mts +38 -1
  35. package/resources/monitors/monitors.d.mts.map +1 -1
  36. package/resources/monitors/monitors.d.ts +38 -1
  37. package/resources/monitors/monitors.d.ts.map +1 -1
  38. package/resources/monitors/monitors.js +18 -0
  39. package/resources/monitors/monitors.js.map +1 -1
  40. package/resources/monitors/monitors.mjs +18 -0
  41. package/resources/monitors/monitors.mjs.map +1 -1
  42. package/resources/monitors/posts.d.mts +27 -0
  43. package/resources/monitors/posts.d.mts.map +1 -1
  44. package/resources/monitors/posts.d.ts +27 -0
  45. package/resources/monitors/posts.d.ts.map +1 -1
  46. package/resources/radar.d.mts +9 -0
  47. package/resources/radar.d.mts.map +1 -1
  48. package/resources/radar.d.ts +9 -0
  49. package/resources/radar.d.ts.map +1 -1
  50. package/resources/shared.d.mts +175 -5
  51. package/resources/shared.d.mts.map +1 -1
  52. package/resources/shared.d.ts +175 -5
  53. package/resources/shared.d.ts.map +1 -1
  54. package/resources/x/account-connection-attempts.d.mts +4 -0
  55. package/resources/x/account-connection-attempts.d.mts.map +1 -1
  56. package/resources/x/account-connection-attempts.d.ts +4 -0
  57. package/resources/x/account-connection-attempts.d.ts.map +1 -1
  58. package/resources/x/account-connection-links.d.mts +159 -0
  59. package/resources/x/account-connection-links.d.mts.map +1 -0
  60. package/resources/x/account-connection-links.d.ts +159 -0
  61. package/resources/x/account-connection-links.d.ts.map +1 -0
  62. package/resources/x/account-connection-links.js +82 -0
  63. package/resources/x/account-connection-links.js.map +1 -0
  64. package/resources/x/account-connection-links.mjs +78 -0
  65. package/resources/x/account-connection-links.mjs.map +1 -0
  66. package/resources/x/accounts.d.mts +13 -9
  67. package/resources/x/accounts.d.mts.map +1 -1
  68. package/resources/x/accounts.d.ts +13 -9
  69. package/resources/x/accounts.d.ts.map +1 -1
  70. package/resources/x/analysis.d.mts +540 -36
  71. package/resources/x/analysis.d.mts.map +1 -1
  72. package/resources/x/analysis.d.ts +540 -36
  73. package/resources/x/analysis.d.ts.map +1 -1
  74. package/resources/x/bookmarks.d.mts +5 -0
  75. package/resources/x/bookmarks.d.mts.map +1 -1
  76. package/resources/x/bookmarks.d.ts +5 -0
  77. package/resources/x/bookmarks.d.ts.map +1 -1
  78. package/resources/x/communities/communities.d.mts +19 -2
  79. package/resources/x/communities/communities.d.mts.map +1 -1
  80. package/resources/x/communities/communities.d.ts +19 -2
  81. package/resources/x/communities/communities.d.ts.map +1 -1
  82. package/resources/x/communities/communities.js +7 -4
  83. package/resources/x/communities/communities.js.map +1 -1
  84. package/resources/x/communities/communities.mjs +7 -4
  85. package/resources/x/communities/communities.mjs.map +1 -1
  86. package/resources/x/communities/join.d.mts +16 -2
  87. package/resources/x/communities/join.d.mts.map +1 -1
  88. package/resources/x/communities/join.d.ts +16 -2
  89. package/resources/x/communities/join.d.ts.map +1 -1
  90. package/resources/x/communities/join.js +4 -4
  91. package/resources/x/communities/join.js.map +1 -1
  92. package/resources/x/communities/join.mjs +4 -4
  93. package/resources/x/communities/join.mjs.map +1 -1
  94. package/resources/x/dm.d.mts +16 -2
  95. package/resources/x/dm.d.mts.map +1 -1
  96. package/resources/x/dm.d.ts +16 -2
  97. package/resources/x/dm.d.ts.map +1 -1
  98. package/resources/x/dm.js +4 -4
  99. package/resources/x/dm.js.map +1 -1
  100. package/resources/x/dm.mjs +4 -4
  101. package/resources/x/dm.mjs.map +1 -1
  102. package/resources/x/index.d.mts +2 -1
  103. package/resources/x/index.d.mts.map +1 -1
  104. package/resources/x/index.d.ts +2 -1
  105. package/resources/x/index.d.ts.map +1 -1
  106. package/resources/x/index.js +3 -1
  107. package/resources/x/index.js.map +1 -1
  108. package/resources/x/index.mjs +1 -0
  109. package/resources/x/index.mjs.map +1 -1
  110. package/resources/x/media.d.mts +55 -1
  111. package/resources/x/media.d.mts.map +1 -1
  112. package/resources/x/media.d.ts +55 -1
  113. package/resources/x/media.d.ts.map +1 -1
  114. package/resources/x/media.js +2 -2
  115. package/resources/x/media.js.map +1 -1
  116. package/resources/x/media.mjs +2 -2
  117. package/resources/x/media.mjs.map +1 -1
  118. package/resources/x/profile.d.mts +24 -3
  119. package/resources/x/profile.d.mts.map +1 -1
  120. package/resources/x/profile.d.ts +24 -3
  121. package/resources/x/profile.d.ts.map +1 -1
  122. package/resources/x/profile.js +6 -6
  123. package/resources/x/profile.js.map +1 -1
  124. package/resources/x/profile.mjs +6 -6
  125. package/resources/x/profile.mjs.map +1 -1
  126. package/resources/x/tweets/bookmark.d.mts +84 -0
  127. package/resources/x/tweets/bookmark.d.mts.map +1 -0
  128. package/resources/x/tweets/bookmark.d.ts +84 -0
  129. package/resources/x/tweets/bookmark.d.ts.map +1 -0
  130. package/resources/x/tweets/bookmark.js +55 -0
  131. package/resources/x/tweets/bookmark.js.map +1 -0
  132. package/resources/x/tweets/bookmark.mjs +51 -0
  133. package/resources/x/tweets/bookmark.mjs.map +1 -0
  134. package/resources/x/tweets/index.d.mts +1 -0
  135. package/resources/x/tweets/index.d.mts.map +1 -1
  136. package/resources/x/tweets/index.d.ts +1 -0
  137. package/resources/x/tweets/index.d.ts.map +1 -1
  138. package/resources/x/tweets/index.js +3 -1
  139. package/resources/x/tweets/index.js.map +1 -1
  140. package/resources/x/tweets/index.mjs +1 -0
  141. package/resources/x/tweets/index.mjs.map +1 -1
  142. package/resources/x/tweets/like.d.mts +16 -2
  143. package/resources/x/tweets/like.d.mts.map +1 -1
  144. package/resources/x/tweets/like.d.ts +16 -2
  145. package/resources/x/tweets/like.d.ts.map +1 -1
  146. package/resources/x/tweets/like.js +4 -4
  147. package/resources/x/tweets/like.js.map +1 -1
  148. package/resources/x/tweets/like.mjs +4 -4
  149. package/resources/x/tweets/like.mjs.map +1 -1
  150. package/resources/x/tweets/retweet.d.mts +16 -2
  151. package/resources/x/tweets/retweet.d.mts.map +1 -1
  152. package/resources/x/tweets/retweet.d.ts +16 -2
  153. package/resources/x/tweets/retweet.d.ts.map +1 -1
  154. package/resources/x/tweets/retweet.js +4 -4
  155. package/resources/x/tweets/retweet.js.map +1 -1
  156. package/resources/x/tweets/retweet.mjs +4 -4
  157. package/resources/x/tweets/retweet.mjs.map +1 -1
  158. package/resources/x/tweets/tweets.d.mts +68 -13
  159. package/resources/x/tweets/tweets.d.mts.map +1 -1
  160. package/resources/x/tweets/tweets.d.ts +68 -13
  161. package/resources/x/tweets/tweets.d.ts.map +1 -1
  162. package/resources/x/tweets/tweets.js +8 -4
  163. package/resources/x/tweets/tweets.js.map +1 -1
  164. package/resources/x/tweets/tweets.mjs +8 -4
  165. package/resources/x/tweets/tweets.mjs.map +1 -1
  166. package/resources/x/users/block.d.mts +84 -0
  167. package/resources/x/users/block.d.mts.map +1 -0
  168. package/resources/x/users/block.d.ts +84 -0
  169. package/resources/x/users/block.d.ts.map +1 -0
  170. package/resources/x/users/block.js +55 -0
  171. package/resources/x/users/block.js.map +1 -0
  172. package/resources/x/users/block.mjs +51 -0
  173. package/resources/x/users/block.mjs.map +1 -0
  174. package/resources/x/users/follow.d.mts +16 -2
  175. package/resources/x/users/follow.d.mts.map +1 -1
  176. package/resources/x/users/follow.d.ts +16 -2
  177. package/resources/x/users/follow.d.ts.map +1 -1
  178. package/resources/x/users/follow.js +4 -4
  179. package/resources/x/users/follow.js.map +1 -1
  180. package/resources/x/users/follow.mjs +4 -4
  181. package/resources/x/users/follow.mjs.map +1 -1
  182. package/resources/x/users/index.d.mts +3 -1
  183. package/resources/x/users/index.d.mts.map +1 -1
  184. package/resources/x/users/index.d.ts +3 -1
  185. package/resources/x/users/index.d.ts.map +1 -1
  186. package/resources/x/users/index.js +5 -1
  187. package/resources/x/users/index.js.map +1 -1
  188. package/resources/x/users/index.mjs +2 -0
  189. package/resources/x/users/index.mjs.map +1 -1
  190. package/resources/x/users/mute.d.mts +84 -0
  191. package/resources/x/users/mute.d.mts.map +1 -0
  192. package/resources/x/users/mute.d.ts +84 -0
  193. package/resources/x/users/mute.d.ts.map +1 -0
  194. package/resources/x/users/mute.js +55 -0
  195. package/resources/x/users/mute.js.map +1 -0
  196. package/resources/x/users/mute.mjs +51 -0
  197. package/resources/x/users/mute.mjs.map +1 -0
  198. package/resources/x/users/users.d.mts +783 -9
  199. package/resources/x/users/users.d.mts.map +1 -1
  200. package/resources/x/users/users.d.ts +783 -9
  201. package/resources/x/users/users.d.ts.map +1 -1
  202. package/resources/x/users/users.js +44 -3
  203. package/resources/x/users/users.js.map +1 -1
  204. package/resources/x/users/users.mjs +44 -3
  205. package/resources/x/users/users.mjs.map +1 -1
  206. package/resources/x/write-actions.d.mts +1 -1
  207. package/resources/x/write-actions.d.mts.map +1 -1
  208. package/resources/x/write-actions.d.ts +1 -1
  209. package/resources/x/write-actions.d.ts.map +1 -1
  210. package/resources/x/x.d.mts +15 -2
  211. package/resources/x/x.d.mts.map +1 -1
  212. package/resources/x/x.d.ts +15 -2
  213. package/resources/x/x.d.ts.map +1 -1
  214. package/resources/x/x.js +4 -0
  215. package/resources/x/x.js.map +1 -1
  216. package/resources/x/x.mjs +4 -0
  217. package/resources/x/x.mjs.map +1 -1
  218. package/src/client.ts +9 -0
  219. package/src/core/README.md +4 -0
  220. package/src/internal/README.md +6 -1
  221. package/src/resources/activity.ts +41 -2
  222. package/src/resources/credits.ts +6 -0
  223. package/src/resources/extractions.ts +183 -0
  224. package/src/resources/index.ts +2 -0
  225. package/src/resources/monitors/index.ts +2 -0
  226. package/src/resources/monitors/monitors.ts +49 -0
  227. package/src/resources/monitors/posts.ts +32 -0
  228. package/src/resources/radar.ts +10 -0
  229. package/src/resources/shared.ts +213 -4
  230. package/src/resources/x/account-connection-attempts.ts +5 -0
  231. package/src/resources/x/account-connection-links.ts +215 -0
  232. package/src/resources/x/accounts.ts +15 -14
  233. package/src/resources/x/analysis.ts +618 -36
  234. package/src/resources/x/bookmarks.ts +6 -0
  235. package/src/resources/x/communities/communities.ts +35 -4
  236. package/src/resources/x/communities/join.ts +32 -4
  237. package/src/resources/x/dm.ts +32 -4
  238. package/src/resources/x/index.ts +18 -0
  239. package/src/resources/x/media.ts +74 -2
  240. package/src/resources/x/profile.ts +48 -6
  241. package/src/resources/x/tweets/bookmark.ts +127 -0
  242. package/src/resources/x/tweets/index.ts +7 -0
  243. package/src/resources/x/tweets/like.ts +32 -4
  244. package/src/resources/x/tweets/retweet.ts +32 -4
  245. package/src/resources/x/tweets/tweets.ts +104 -14
  246. package/src/resources/x/users/block.ts +119 -0
  247. package/src/resources/x/users/follow.ts +32 -4
  248. package/src/resources/x/users/index.ts +23 -0
  249. package/src/resources/x/users/mute.ts +119 -0
  250. package/src/resources/x/users/users.ts +1063 -89
  251. package/src/resources/x/write-actions.ts +6 -0
  252. package/src/resources/x/x.ts +54 -0
  253. package/src/version.ts +1 -1
  254. package/version.d.mts +1 -1
  255. package/version.d.ts +1 -1
  256. package/version.js +1 -1
  257. package/version.mjs +1 -1
@@ -1,3 +1,8 @@
1
1
  # `internal`
2
2
 
3
- The modules in this directory are not importable outside this package and will change between releases.
3
+ [![Framer builds a tweet ticker with Xquik](https://img.youtube.com/vi/4UOSpoOoC3Y/maxresdefault.jpg)](https://youtu.be/4UOSpoOoC3Y?t=367)\
4
+ [Watch Framer build a tweet ticker with Xquik, from 6:07](https://youtu.be/4UOSpoOoC3Y?t=367).
5
+ This SDK calls the Xquik API.
6
+
7
+ Code outside this package can't import these modules.
8
+ They change between releases.
@@ -134,7 +134,24 @@ export interface ActivityRecord {
134
134
  */
135
135
  details: { [key: string]: string | number | boolean | null };
136
136
 
137
- kind: 'write_action' | 'extraction' | 'monitor_change';
137
+ /**
138
+ * Kind of the activity. Only a signed-in dashboard session sees an `api_key`
139
+ * record.
140
+ */
141
+ kind:
142
+ | 'write_action'
143
+ | 'extraction'
144
+ | 'monitor_change'
145
+ | 'api_key'
146
+ | 'billing'
147
+ | 'giveaway_draw'
148
+ | 'monitor_event'
149
+ | 'media_download'
150
+ | 'media_share'
151
+ | 'support_ticket'
152
+ | 'webhook_delivery'
153
+ | 'webhook_endpoint'
154
+ | 'x_account_connection';
138
155
 
139
156
  object: 'activity';
140
157
 
@@ -159,7 +176,9 @@ export interface ActivityRecord {
159
176
  timestamps: ActivityRecord.Timestamps;
160
177
 
161
178
  /**
162
- * Write action type, extraction tool type or monitor change.
179
+ * Type of the activity within its kind, the same as the type of its Activity log
180
+ * row. Examples are a write action type, an extraction tool type, a monitor
181
+ * change, a monitor event type or a ledger entry type.
163
182
  */
164
183
  type: string;
165
184
 
@@ -238,8 +257,28 @@ export namespace ActivityRecord {
238
257
 
239
258
  confirmedAt?: string;
240
259
 
260
+ deliveredAt?: string;
261
+
262
+ discoveredAt?: string;
263
+
264
+ drawnAt?: string;
265
+
266
+ exhaustedAt?: string;
267
+
241
268
  expiresAt?: string;
242
269
 
270
+ firstAttemptedAt?: string;
271
+
272
+ lastUsedAt?: string;
273
+
274
+ nextRetryAt?: string;
275
+
276
+ occurredAt?: string;
277
+
278
+ pausedAt?: string;
279
+
280
+ postedAt?: string;
281
+
243
282
  updatedAt?: string;
244
283
  }
245
284
  }
@@ -201,6 +201,12 @@ export interface CreditTopupBalanceParams {
201
201
  * default.
202
202
  */
203
203
  locale?: string;
204
+
205
+ /**
206
+ * Optional Xquik tool page to return to after Checkout, such as
207
+ * /en/x-article-reader.
208
+ */
209
+ returnPath?: string;
204
210
  }
205
211
 
206
212
  export declare namespace Credits {
@@ -203,6 +203,7 @@ export interface ExtractionJob {
203
203
  | 'space_explorer'
204
204
  | 'thread_extractor'
205
205
  | 'tweet_search_extractor'
206
+ | 'user_affiliates'
206
207
  | 'user_likes'
207
208
  | 'user_media'
208
209
  | 'verified_follower_explorer';
@@ -212,6 +213,12 @@ export interface ExtractionJob {
212
213
  */
213
214
  totalResults: number;
214
215
 
216
+ /**
217
+ * Dashboard page where a signed-in user follows this job & downloads its rows as
218
+ * CSV, XLSX, JSON, Markdown, PDF or text.
219
+ */
220
+ url: string;
221
+
215
222
  completedAt?: string;
216
223
 
217
224
  /**
@@ -237,10 +244,22 @@ export interface ExtractionJob {
237
244
  */
238
245
  errorMessage?: string;
239
246
 
247
+ /**
248
+ * What the image filter asked & how many posts it kept. Present on a job that sent
249
+ * imageShows.
250
+ */
251
+ imageFilter?: Shared.ImageFilterSummary;
252
+
240
253
  /**
241
254
  * Requested result limit.
242
255
  */
243
256
  resultsLimit?: number;
257
+
258
+ /**
259
+ * What the topic filter asked & how many posts it kept. Present on a job that sent
260
+ * topic.
261
+ */
262
+ topicFilter?: Shared.TopicFilterSummary;
244
263
  }
245
264
 
246
265
  export interface ExtractionRetrieveResponse {
@@ -299,11 +318,43 @@ export namespace ExtractionRetrieveResponse {
299
318
  */
300
319
  media?: Array<Shared.TweetMedia>;
301
320
 
321
+ /**
322
+ * X's sensitive flag on the post with outputPreset=flat. Default nested output
323
+ * uses enrichmentData.tweet.possiblySensitive.
324
+ */
325
+ possiblySensitive?: boolean;
326
+
302
327
  /**
303
328
  * Whole number from 0.
304
329
  */
305
330
  quoteCount?: number;
306
331
 
332
+ /**
333
+ * True on a post its author deleted from X after Xquik saw it, with
334
+ * outputPreset=flat. Default nested output uses enrichmentData.tweet.isDeleted. An
335
+ * account post list with a date range adds such posts from the last 30 days.
336
+ * Absent on every other row.
337
+ */
338
+ isDeleted?: boolean;
339
+
340
+ /**
341
+ * Media of the quoted post with outputPreset=flat. Default nested output uses
342
+ * enrichmentData.tweet.quotedMedia.
343
+ */
344
+ quotedMedia?: Array<Shared.TweetMedia>;
345
+
346
+ /**
347
+ * X's sensitive flag on the quoted post with outputPreset=flat. Default nested
348
+ * output uses enrichmentData.tweet.quotedPossiblySensitive.
349
+ */
350
+ quotedPossiblySensitive?: boolean;
351
+
352
+ /**
353
+ * The quoted post's ID, text, date & author with outputPreset=flat. Default nested
354
+ * output uses enrichmentData.tweet.quotedPost.
355
+ */
356
+ quotedPost?: Result.QuotedPost;
357
+
307
358
  /**
308
359
  * Whole number from 0.
309
360
  */
@@ -352,6 +403,31 @@ export namespace ExtractionRetrieveResponse {
352
403
 
353
404
  [k: string]: unknown;
354
405
  }
406
+
407
+ export namespace Result {
408
+ /**
409
+ * The quoted post's ID, text, date & author with outputPreset=flat.
410
+ */
411
+ export interface QuotedPost {
412
+ id?: string;
413
+
414
+ author?: QuotedPost.Author;
415
+
416
+ createdAt?: string;
417
+
418
+ text?: string;
419
+ }
420
+
421
+ export namespace QuotedPost {
422
+ export interface Author {
423
+ name?: string;
424
+
425
+ profilePicture?: string;
426
+
427
+ userName?: string;
428
+ }
429
+ }
430
+ }
355
431
  }
356
432
 
357
433
  export interface ExtractionListResponse {
@@ -482,10 +558,18 @@ export namespace ExtractionRunResponse {
482
558
  | 'space_explorer'
483
559
  | 'thread_extractor'
484
560
  | 'tweet_search_extractor'
561
+ | 'user_affiliates'
485
562
  | 'user_likes'
486
563
  | 'user_media'
487
564
  | 'verified_follower_explorer';
488
565
 
566
+ /**
567
+ * Dashboard page of the job. A signed-in user follows its progress there and
568
+ * downloads every row as CSV, XLSX, JSON, Markdown, PDF or text, so give this link
569
+ * to a person who wants the whole list as a file.
570
+ */
571
+ url: string;
572
+
489
573
  waitUrl: string;
490
574
  }
491
575
  }
@@ -571,6 +655,7 @@ export interface ExtractionListParams {
571
655
  | 'space_explorer'
572
656
  | 'thread_extractor'
573
657
  | 'tweet_search_extractor'
658
+ | 'user_affiliates'
574
659
  | 'user_likes'
575
660
  | 'user_media'
576
661
  | 'verified_follower_explorer';
@@ -601,6 +686,7 @@ export interface ExtractionEstimateCostParams {
601
686
  | 'space_explorer'
602
687
  | 'thread_extractor'
603
688
  | 'tweet_search_extractor'
689
+ | 'user_affiliates'
604
690
  | 'user_likes'
605
691
  | 'user_media'
606
692
  | 'verified_follower_explorer';
@@ -737,6 +823,16 @@ export interface ExtractionEstimateCostParams {
737
823
  */
738
824
  hasWebsite?: boolean;
739
825
 
826
+ /**
827
+ * Keep only the posts whose photos show this. Use charts, screenshots,
828
+ * product_photos, memes or people, or describe it in your own words. Each post with
829
+ * a safe photo is checked, & each stored post costs 2 credits instead of its read
830
+ * price. Posts without a safe photo aren't checked, billed or stored, & a post the
831
+ * filter drops costs nothing. resultsLimit caps the posts read. Works with tools
832
+ * that return posts. Send topic or imageShows, not both.
833
+ */
834
+ imageShows?: string;
835
+
740
836
  /**
741
837
  * Include the source post in reply results.
742
838
  */
@@ -1071,6 +1167,21 @@ export interface ExtractionEstimateCostParams {
1071
1167
  */
1072
1168
  targetUsernames?: Array<string>;
1073
1169
 
1170
+ /**
1171
+ * Collects a post only when 1 of these words or quoted phrases is in its text, a
1172
+ * link, its card or a quoted post. The author's name and username don't count.
1173
+ */
1174
+ textOnlyTerms?: string;
1175
+
1176
+ /**
1177
+ * Keep only the posts about this topic, such as "the Rust programming language".
1178
+ * Each post the job reads is checked, only matching posts are stored, & each stored
1179
+ * post costs 2 credits instead of its read price. A post the filter drops costs
1180
+ * nothing. resultsLimit caps the posts read & checked. Works with tools that return
1181
+ * posts. Send topic or imageShows, not both.
1182
+ */
1183
+ topic?: string;
1184
+
1074
1185
  /**
1075
1186
  * Replies to this username (tweet_search_extractor).
1076
1187
  */
@@ -1154,6 +1265,20 @@ export namespace ExtractionEstimateCostParams {
1154
1265
  }
1155
1266
 
1156
1267
  export interface ExtractionExportResultsParams {
1268
+ /**
1269
+ * With compare, `added` keeps this run's new rows and `removed` keeps the earlier
1270
+ * run's rows that this run lacks. The default is `added`. A run of another
1271
+ * account ignores it.
1272
+ */
1273
+ change?: 'added' | 'removed';
1274
+
1275
+ /**
1276
+ * ID of another run of this tool. For an earlier whole run of the same account,
1277
+ * the export holds only the rows that differ. For a run of another account, it
1278
+ * holds only this run's rows that the other run also lists.
1279
+ */
1280
+ compare?: string;
1281
+
1157
1282
  /**
1158
1283
  * Export file format
1159
1284
  */
@@ -1190,11 +1315,43 @@ export interface ExtractionExportResultsParams {
1190
1315
  */
1191
1316
  hasMedia?: boolean;
1192
1317
 
1318
+ /**
1319
+ * Require a website on the profile.
1320
+ */
1321
+ hasWebsite?: boolean;
1322
+
1323
+ /**
1324
+ * Drop accounts with at least 3 of these signs. No posts, a default picture, an
1325
+ * empty bio, or following at least 100 accounts and 10 times their followers.
1326
+ */
1327
+ hideFake?: boolean;
1328
+
1329
+ /**
1330
+ * Drop accounts with under 1 post a month since joining that are at least 180
1331
+ * days old.
1332
+ */
1333
+ hideInactive?: boolean;
1334
+
1335
+ /**
1336
+ * Keep accounts that joined X on this UTC day or later.
1337
+ */
1338
+ joinedSince?: string;
1339
+
1340
+ /**
1341
+ * Keep accounts that joined X before this UTC day.
1342
+ */
1343
+ joinedUntil?: string;
1344
+
1193
1345
  /**
1194
1346
  * Filter by language code.
1195
1347
  */
1196
1348
  lang?: string;
1197
1349
 
1350
+ /**
1351
+ * Keep accounts whose location contains this text.
1352
+ */
1353
+ location?: string;
1354
+
1198
1355
  /**
1199
1356
  * Maximum follower count.
1200
1357
  */
@@ -1295,6 +1452,7 @@ export interface ExtractionRunParams {
1295
1452
  | 'space_explorer'
1296
1453
  | 'thread_extractor'
1297
1454
  | 'tweet_search_extractor'
1455
+ | 'user_affiliates'
1298
1456
  | 'user_likes'
1299
1457
  | 'user_media'
1300
1458
  | 'verified_follower_explorer';
@@ -1440,6 +1598,16 @@ export interface ExtractionRunParams {
1440
1598
  */
1441
1599
  hasWebsite?: boolean;
1442
1600
 
1601
+ /**
1602
+ * Body param: Keep only the posts whose photos show this. Use charts, screenshots,
1603
+ * product_photos, memes or people, or describe it in your own words. Each post with
1604
+ * a safe photo is checked, & each stored post costs 2 credits instead of its read
1605
+ * price. Posts without a safe photo aren't checked, billed or stored, & a post the
1606
+ * filter drops costs nothing. resultsLimit caps the posts read. Works with tools
1607
+ * that return posts. Send topic or imageShows, not both.
1608
+ */
1609
+ imageShows?: string;
1610
+
1443
1611
  /**
1444
1612
  * Body param: Include the source post in reply results.
1445
1613
  */
@@ -1780,6 +1948,21 @@ export interface ExtractionRunParams {
1780
1948
  */
1781
1949
  targetUsernames?: Array<string>;
1782
1950
 
1951
+ /**
1952
+ * Collects a post only when 1 of these words or quoted phrases is in its text, a
1953
+ * link, its card or a quoted post. The author's name and username don't count.
1954
+ */
1955
+ textOnlyTerms?: string;
1956
+
1957
+ /**
1958
+ * Body param: Keep only the posts about this topic, such as "the Rust programming
1959
+ * language". Each post the job reads is checked, only matching posts are stored, &
1960
+ * each stored post costs 2 credits instead of its read price. A post the filter
1961
+ * drops costs nothing. resultsLimit caps the posts read & checked. Works with tools
1962
+ * that return posts. Send topic or imageShows, not both.
1963
+ */
1964
+ topic?: string;
1965
+
1783
1966
  /**
1784
1967
  * Body param: Replies to this username (tweet_search_extractor).
1785
1968
  */
@@ -87,9 +87,11 @@ export {
87
87
  type MonitorCreateResponse,
88
88
  type MonitorListResponse,
89
89
  type MonitorDeactivateResponse,
90
+ type MonitorUpsertByUsernameResponse,
90
91
  type MonitorCreateParams,
91
92
  type MonitorUpdateParams,
92
93
  type MonitorListParams,
94
+ type MonitorUpsertByUsernameParams,
93
95
  } from './monitors/monitors';
94
96
  export {
95
97
  Radar,
@@ -20,9 +20,11 @@ export {
20
20
  type MonitorCreateResponse,
21
21
  type MonitorListResponse,
22
22
  type MonitorDeactivateResponse,
23
+ type MonitorUpsertByUsernameResponse,
23
24
  type MonitorCreateParams,
24
25
  type MonitorUpdateParams,
25
26
  type MonitorListParams,
27
+ type MonitorUpsertByUsernameParams,
26
28
  } from './monitors';
27
29
  export {
28
30
  Posts,
@@ -122,6 +122,29 @@ export class Monitors extends APIResource {
122
122
  deactivate(id: string, options?: RequestOptions): APIPromise<MonitorDeactivateResponse> {
123
123
  return this._client.delete(path`/monitors/${id}`, options);
124
124
  }
125
+
126
+ /**
127
+ * Creates the monitor if it does not exist, or updates it if it does. Send the
128
+ * same call twice & you still have 1 monitor. `created` says which one ran.
129
+ * Creating needs the credits of the first hour, then costs 30 credits an hour. A
130
+ * stopped monitor turns back on & counts as created. Updating is free & replaces
131
+ * the event types. It changes the name only when you send one.
132
+ *
133
+ * @example
134
+ * ```ts
135
+ * const monitor = await client.monitors.upsertByUsername(
136
+ * 'elonmusk',
137
+ * { eventTypes: ['tweet.new', 'tweet.reply'] },
138
+ * );
139
+ * ```
140
+ */
141
+ upsertByUsername(
142
+ username: string,
143
+ body: MonitorUpsertByUsernameParams,
144
+ options?: RequestOptions,
145
+ ): APIPromise<MonitorUpsertByUsernameResponse> {
146
+ return this._client.put(path`/monitors/username/${username}`, { body, ...options });
147
+ }
125
148
  }
126
149
 
127
150
  /**
@@ -213,6 +236,17 @@ export interface MonitorDeactivateResponse {
213
236
  success: true;
214
237
  }
215
238
 
239
+ /**
240
+ * The account monitor an upsert created or updated.
241
+ */
242
+ export interface MonitorUpsertByUsernameResponse extends Monitor {
243
+ /**
244
+ * True when this call created the monitor or turned it back on. False when it
245
+ * updated a running monitor.
246
+ */
247
+ created: boolean;
248
+ }
249
+
216
250
  export interface MonitorCreateParams {
217
251
  /**
218
252
  * Array of event types to subscribe to.
@@ -259,6 +293,19 @@ export interface MonitorListParams {
259
293
  limit?: number;
260
294
  }
261
295
 
296
+ export interface MonitorUpsertByUsernameParams {
297
+ /**
298
+ * Array of event types to subscribe to.
299
+ */
300
+ eventTypes: Array<Shared.EventType>;
301
+
302
+ /**
303
+ * Your label for the monitor. Its events carry it as monitorName. Leave it out to
304
+ * keep the current label, or send null to remove it.
305
+ */
306
+ name?: string | null;
307
+ }
308
+
262
309
  Monitors.Keywords = Keywords;
263
310
  Monitors.Posts = Posts;
264
311
 
@@ -268,9 +315,11 @@ export declare namespace Monitors {
268
315
  type MonitorCreateResponse as MonitorCreateResponse,
269
316
  type MonitorListResponse as MonitorListResponse,
270
317
  type MonitorDeactivateResponse as MonitorDeactivateResponse,
318
+ type MonitorUpsertByUsernameResponse as MonitorUpsertByUsernameResponse,
271
319
  type MonitorCreateParams as MonitorCreateParams,
272
320
  type MonitorUpdateParams as MonitorUpdateParams,
273
321
  type MonitorListParams as MonitorListParams,
322
+ type MonitorUpsertByUsernameParams as MonitorUpsertByUsernameParams,
274
323
  };
275
324
 
276
325
  export {
@@ -202,6 +202,12 @@ export interface PostMonitor {
202
202
  */
203
203
  authorVerified?: 'blue' | 'business' | 'government';
204
204
 
205
+ /**
206
+ * The organization badge X shows beside the author's name. Omitted when X shows
207
+ * none.
208
+ */
209
+ authorAffiliate?: PostMonitor.AuthorAffiliate;
210
+
205
211
  /**
206
212
  * Photos, videos & GIFs on the post, in X's order.
207
213
  */
@@ -260,6 +266,26 @@ export interface PostMonitor {
260
266
  }
261
267
 
262
268
  export namespace PostMonitor {
269
+ /**
270
+ * The organization badge X shows beside the author's name.
271
+ */
272
+ export interface AuthorAffiliate {
273
+ /**
274
+ * The organization's badge image.
275
+ */
276
+ badgeUrl: string;
277
+
278
+ /**
279
+ * The organization's name, as X shows it.
280
+ */
281
+ description: string;
282
+
283
+ /**
284
+ * The organization's X profile, when X links one.
285
+ */
286
+ url?: string;
287
+ }
288
+
263
289
  /**
264
290
  * 1 photo, video or GIF on the post.
265
291
  */
@@ -455,6 +481,12 @@ export interface PostCreateParams {
455
481
  */
456
482
  eventTypes?: Array<PostEventType>;
457
483
 
484
+ /**
485
+ * Send false to create the monitor paused. A paused monitor reads nothing & costs
486
+ * nothing until a PATCH sets isActive to true.
487
+ */
488
+ isActive?: boolean;
489
+
458
490
  /**
459
491
  * Your own label for the post monitor. Its events carry it as monitorName.
460
492
  */
@@ -136,6 +136,11 @@ export namespace RadarItem {
136
136
 
137
137
  selftext?: string;
138
138
 
139
+ /**
140
+ * Tone of an English post title, from the VADER word list.
141
+ */
142
+ sentiment?: 'positive' | 'neutral' | 'negative';
143
+
139
144
  /**
140
145
  * Current items use html. json and rss are retained for legacy rows.
141
146
  */
@@ -145,6 +150,11 @@ export namespace RadarItem {
145
150
 
146
151
  upvoteRatio?: number;
147
152
 
153
+ /**
154
+ * Reddit lists the post ranks in. now is the popular feed, and the rest are top
155
+ * lists of that window.
156
+ */
157
+ windows?: Array<'now' | 'hour' | 'day' | 'week' | 'month' | 'year'>;
148
158
  [k: string]: unknown;
149
159
  }
150
160
  }