x-twitter-scraper 0.20.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 (214) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +120 -121
  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/extractions.d.mts +105 -5
  11. package/resources/extractions.d.mts.map +1 -1
  12. package/resources/extractions.d.ts +105 -5
  13. package/resources/extractions.d.ts.map +1 -1
  14. package/resources/index.d.mts +1 -1
  15. package/resources/index.d.mts.map +1 -1
  16. package/resources/index.d.ts +1 -1
  17. package/resources/index.d.ts.map +1 -1
  18. package/resources/index.js.map +1 -1
  19. package/resources/index.mjs.map +1 -1
  20. package/resources/monitors/index.d.mts +1 -1
  21. package/resources/monitors/index.d.mts.map +1 -1
  22. package/resources/monitors/index.d.ts +1 -1
  23. package/resources/monitors/index.d.ts.map +1 -1
  24. package/resources/monitors/index.js.map +1 -1
  25. package/resources/monitors/index.mjs.map +1 -1
  26. package/resources/monitors/monitors.d.mts +38 -1
  27. package/resources/monitors/monitors.d.mts.map +1 -1
  28. package/resources/monitors/monitors.d.ts +38 -1
  29. package/resources/monitors/monitors.d.ts.map +1 -1
  30. package/resources/monitors/monitors.js +18 -0
  31. package/resources/monitors/monitors.js.map +1 -1
  32. package/resources/monitors/monitors.mjs +18 -0
  33. package/resources/monitors/monitors.mjs.map +1 -1
  34. package/resources/monitors/posts.d.mts +27 -0
  35. package/resources/monitors/posts.d.mts.map +1 -1
  36. package/resources/monitors/posts.d.ts +27 -0
  37. package/resources/monitors/posts.d.ts.map +1 -1
  38. package/resources/shared.d.mts +175 -5
  39. package/resources/shared.d.mts.map +1 -1
  40. package/resources/shared.d.ts +175 -5
  41. package/resources/shared.d.ts.map +1 -1
  42. package/resources/x/account-connection-attempts.d.mts +4 -0
  43. package/resources/x/account-connection-attempts.d.mts.map +1 -1
  44. package/resources/x/account-connection-attempts.d.ts +4 -0
  45. package/resources/x/account-connection-attempts.d.ts.map +1 -1
  46. package/resources/x/account-connection-links.d.mts +159 -0
  47. package/resources/x/account-connection-links.d.mts.map +1 -0
  48. package/resources/x/account-connection-links.d.ts +159 -0
  49. package/resources/x/account-connection-links.d.ts.map +1 -0
  50. package/resources/x/account-connection-links.js +82 -0
  51. package/resources/x/account-connection-links.js.map +1 -0
  52. package/resources/x/account-connection-links.mjs +78 -0
  53. package/resources/x/account-connection-links.mjs.map +1 -0
  54. package/resources/x/accounts.d.mts +13 -9
  55. package/resources/x/accounts.d.mts.map +1 -1
  56. package/resources/x/accounts.d.ts +13 -9
  57. package/resources/x/accounts.d.ts.map +1 -1
  58. package/resources/x/analysis.d.mts +540 -36
  59. package/resources/x/analysis.d.mts.map +1 -1
  60. package/resources/x/analysis.d.ts +540 -36
  61. package/resources/x/analysis.d.ts.map +1 -1
  62. package/resources/x/bookmarks.d.mts +5 -0
  63. package/resources/x/bookmarks.d.mts.map +1 -1
  64. package/resources/x/bookmarks.d.ts +5 -0
  65. package/resources/x/bookmarks.d.ts.map +1 -1
  66. package/resources/x/communities/communities.d.mts +2 -2
  67. package/resources/x/communities/communities.d.mts.map +1 -1
  68. package/resources/x/communities/communities.d.ts +2 -2
  69. package/resources/x/communities/communities.d.ts.map +1 -1
  70. package/resources/x/communities/communities.js.map +1 -1
  71. package/resources/x/communities/communities.mjs.map +1 -1
  72. package/resources/x/communities/join.d.mts +2 -2
  73. package/resources/x/communities/join.d.mts.map +1 -1
  74. package/resources/x/communities/join.d.ts +2 -2
  75. package/resources/x/communities/join.d.ts.map +1 -1
  76. package/resources/x/dm.d.mts +2 -2
  77. package/resources/x/dm.d.mts.map +1 -1
  78. package/resources/x/dm.d.ts +2 -2
  79. package/resources/x/dm.d.ts.map +1 -1
  80. package/resources/x/index.d.mts +2 -1
  81. package/resources/x/index.d.mts.map +1 -1
  82. package/resources/x/index.d.ts +2 -1
  83. package/resources/x/index.d.ts.map +1 -1
  84. package/resources/x/index.js +3 -1
  85. package/resources/x/index.js.map +1 -1
  86. package/resources/x/index.mjs +1 -0
  87. package/resources/x/index.mjs.map +1 -1
  88. package/resources/x/media.d.mts +48 -1
  89. package/resources/x/media.d.mts.map +1 -1
  90. package/resources/x/media.d.ts +48 -1
  91. package/resources/x/media.d.ts.map +1 -1
  92. package/resources/x/media.js.map +1 -1
  93. package/resources/x/media.mjs.map +1 -1
  94. package/resources/x/profile.d.mts +3 -3
  95. package/resources/x/profile.d.mts.map +1 -1
  96. package/resources/x/profile.d.ts +3 -3
  97. package/resources/x/profile.d.ts.map +1 -1
  98. package/resources/x/tweets/bookmark.d.mts +84 -0
  99. package/resources/x/tweets/bookmark.d.mts.map +1 -0
  100. package/resources/x/tweets/bookmark.d.ts +84 -0
  101. package/resources/x/tweets/bookmark.d.ts.map +1 -0
  102. package/resources/x/tweets/bookmark.js +55 -0
  103. package/resources/x/tweets/bookmark.js.map +1 -0
  104. package/resources/x/tweets/bookmark.mjs +51 -0
  105. package/resources/x/tweets/bookmark.mjs.map +1 -0
  106. package/resources/x/tweets/index.d.mts +1 -0
  107. package/resources/x/tweets/index.d.mts.map +1 -1
  108. package/resources/x/tweets/index.d.ts +1 -0
  109. package/resources/x/tweets/index.d.ts.map +1 -1
  110. package/resources/x/tweets/index.js +3 -1
  111. package/resources/x/tweets/index.js.map +1 -1
  112. package/resources/x/tweets/index.mjs +1 -0
  113. package/resources/x/tweets/index.mjs.map +1 -1
  114. package/resources/x/tweets/like.d.mts +2 -2
  115. package/resources/x/tweets/like.d.mts.map +1 -1
  116. package/resources/x/tweets/like.d.ts +2 -2
  117. package/resources/x/tweets/like.d.ts.map +1 -1
  118. package/resources/x/tweets/retweet.d.mts +2 -2
  119. package/resources/x/tweets/retweet.d.mts.map +1 -1
  120. package/resources/x/tweets/retweet.d.ts +2 -2
  121. package/resources/x/tweets/retweet.d.ts.map +1 -1
  122. package/resources/x/tweets/tweets.d.mts +41 -13
  123. package/resources/x/tweets/tweets.d.mts.map +1 -1
  124. package/resources/x/tweets/tweets.d.ts +41 -13
  125. package/resources/x/tweets/tweets.d.ts.map +1 -1
  126. package/resources/x/tweets/tweets.js +4 -0
  127. package/resources/x/tweets/tweets.js.map +1 -1
  128. package/resources/x/tweets/tweets.mjs +4 -0
  129. package/resources/x/tweets/tweets.mjs.map +1 -1
  130. package/resources/x/users/block.d.mts +84 -0
  131. package/resources/x/users/block.d.mts.map +1 -0
  132. package/resources/x/users/block.d.ts +84 -0
  133. package/resources/x/users/block.d.ts.map +1 -0
  134. package/resources/x/users/block.js +55 -0
  135. package/resources/x/users/block.js.map +1 -0
  136. package/resources/x/users/block.mjs +51 -0
  137. package/resources/x/users/block.mjs.map +1 -0
  138. package/resources/x/users/follow.d.mts +2 -2
  139. package/resources/x/users/follow.d.mts.map +1 -1
  140. package/resources/x/users/follow.d.ts +2 -2
  141. package/resources/x/users/follow.d.ts.map +1 -1
  142. package/resources/x/users/index.d.mts +3 -1
  143. package/resources/x/users/index.d.mts.map +1 -1
  144. package/resources/x/users/index.d.ts +3 -1
  145. package/resources/x/users/index.d.ts.map +1 -1
  146. package/resources/x/users/index.js +5 -1
  147. package/resources/x/users/index.js.map +1 -1
  148. package/resources/x/users/index.mjs +2 -0
  149. package/resources/x/users/index.mjs.map +1 -1
  150. package/resources/x/users/mute.d.mts +84 -0
  151. package/resources/x/users/mute.d.mts.map +1 -0
  152. package/resources/x/users/mute.d.ts +84 -0
  153. package/resources/x/users/mute.d.ts.map +1 -0
  154. package/resources/x/users/mute.js +55 -0
  155. package/resources/x/users/mute.js.map +1 -0
  156. package/resources/x/users/mute.mjs +51 -0
  157. package/resources/x/users/mute.mjs.map +1 -0
  158. package/resources/x/users/users.d.mts +359 -9
  159. package/resources/x/users/users.d.mts.map +1 -1
  160. package/resources/x/users/users.d.ts +359 -9
  161. package/resources/x/users/users.d.ts.map +1 -1
  162. package/resources/x/users/users.js +27 -1
  163. package/resources/x/users/users.js.map +1 -1
  164. package/resources/x/users/users.mjs +27 -1
  165. package/resources/x/users/users.mjs.map +1 -1
  166. package/resources/x/write-actions.d.mts +1 -1
  167. package/resources/x/write-actions.d.mts.map +1 -1
  168. package/resources/x/write-actions.d.ts +1 -1
  169. package/resources/x/write-actions.d.ts.map +1 -1
  170. package/resources/x/x.d.mts +15 -2
  171. package/resources/x/x.d.mts.map +1 -1
  172. package/resources/x/x.d.ts +15 -2
  173. package/resources/x/x.d.ts.map +1 -1
  174. package/resources/x/x.js +4 -0
  175. package/resources/x/x.js.map +1 -1
  176. package/resources/x/x.mjs +4 -0
  177. package/resources/x/x.mjs.map +1 -1
  178. package/src/client.ts +9 -0
  179. package/src/core/README.md +4 -0
  180. package/src/internal/README.md +6 -1
  181. package/src/resources/extractions.ts +125 -0
  182. package/src/resources/index.ts +2 -0
  183. package/src/resources/monitors/index.ts +2 -0
  184. package/src/resources/monitors/monitors.ts +49 -0
  185. package/src/resources/monitors/posts.ts +32 -0
  186. package/src/resources/shared.ts +203 -4
  187. package/src/resources/x/account-connection-attempts.ts +5 -0
  188. package/src/resources/x/account-connection-links.ts +215 -0
  189. package/src/resources/x/accounts.ts +15 -14
  190. package/src/resources/x/analysis.ts +618 -36
  191. package/src/resources/x/bookmarks.ts +6 -0
  192. package/src/resources/x/communities/communities.ts +12 -0
  193. package/src/resources/x/communities/join.ts +12 -0
  194. package/src/resources/x/dm.ts +12 -0
  195. package/src/resources/x/index.ts +15 -0
  196. package/src/resources/x/media.ts +64 -0
  197. package/src/resources/x/profile.ts +18 -0
  198. package/src/resources/x/tweets/bookmark.ts +127 -0
  199. package/src/resources/x/tweets/index.ts +7 -0
  200. package/src/resources/x/tweets/like.ts +12 -0
  201. package/src/resources/x/tweets/retweet.ts +12 -0
  202. package/src/resources/x/tweets/tweets.ts +69 -10
  203. package/src/resources/x/users/block.ts +119 -0
  204. package/src/resources/x/users/follow.ts +12 -0
  205. package/src/resources/x/users/index.ts +20 -0
  206. package/src/resources/x/users/mute.ts +119 -0
  207. package/src/resources/x/users/users.ts +470 -7
  208. package/src/resources/x/write-actions.ts +6 -0
  209. package/src/resources/x/x.ts +48 -0
  210. package/src/version.ts +1 -1
  211. package/version.d.mts +1 -1
  212. package/version.d.ts +1 -1
  213. package/version.js +1 -1
  214. package/version.mjs +1 -1
@@ -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
  */
@@ -1077,6 +1173,15 @@ export interface ExtractionEstimateCostParams {
1077
1173
  */
1078
1174
  textOnlyTerms?: string;
1079
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
+
1080
1185
  /**
1081
1186
  * Replies to this username (tweet_search_extractor).
1082
1187
  */
@@ -1347,6 +1452,7 @@ export interface ExtractionRunParams {
1347
1452
  | 'space_explorer'
1348
1453
  | 'thread_extractor'
1349
1454
  | 'tweet_search_extractor'
1455
+ | 'user_affiliates'
1350
1456
  | 'user_likes'
1351
1457
  | 'user_media'
1352
1458
  | 'verified_follower_explorer';
@@ -1492,6 +1598,16 @@ export interface ExtractionRunParams {
1492
1598
  */
1493
1599
  hasWebsite?: boolean;
1494
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
+
1495
1611
  /**
1496
1612
  * Body param: Include the source post in reply results.
1497
1613
  */
@@ -1838,6 +1954,15 @@ export interface ExtractionRunParams {
1838
1954
  */
1839
1955
  textOnlyTerms?: string;
1840
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
+
1841
1966
  /**
1842
1967
  * Body param: Replies to this username (tweet_search_extractor).
1843
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
  */
@@ -214,7 +214,7 @@ export interface Community {
214
214
  * The creator's public profile, or the ID, username and badge alone when X sends
215
215
  * no profile
216
216
  */
217
- creator?: UserProfile | Community.UnionMember1;
217
+ creator?: (UserProfile & { verified: boolean }) | Community.UnionMember1;
218
218
 
219
219
  /**
220
220
  * About text for the community
@@ -871,6 +871,11 @@ export interface Error {
871
871
  */
872
872
  reason?: string;
873
873
 
874
+ /**
875
+ * With insufficient_scope, the scope the API key needs for this route.
876
+ */
877
+ requiredScope?: 'write' | 'monitors' | 'exports' | 'billing' | 'full';
878
+
874
879
  /**
875
880
  * Seconds until the next permitted request.
876
881
  */
@@ -918,6 +923,7 @@ export namespace Error {
918
923
  | 'login_cooldown'
919
924
  | 'login_failed'
920
925
  | 'media_download_failed'
926
+ | 'media_not_uploaded'
921
927
  | 'media_too_large'
922
928
  | 'media_unavailable'
923
929
  | 'missing_params'
@@ -1140,6 +1146,86 @@ export type EventType =
1140
1146
  | 'profile.followers.changed'
1141
1147
  | 'profile.following.changed';
1142
1148
 
1149
+ /**
1150
+ * A page of posts from a read that takes the topic and imageShows filters. Without a
1151
+ * filter it is a PaginatedTweets page. With topic it holds topicFilter and each
1152
+ * post's topicScore. With imageShows it holds imageFilter and each post's
1153
+ * imageScore.
1154
+ */
1155
+ export type FilterablePaginatedTweets = PaginatedTweets | TopicFilteredTweets | ImageFilteredTweets;
1156
+
1157
+ /**
1158
+ * Posts kept by the image filter. Each kept post carries its imageScore. Follow
1159
+ * next_cursor to check the next posts.
1160
+ */
1161
+ export interface ImageFilteredTweets extends PaginatedTweets {
1162
+ /**
1163
+ * What the image filter asked & how many posts it kept.
1164
+ */
1165
+ imageFilter: ImageFilterSummary;
1166
+
1167
+ tweets: Array<ImageFilteredTweets.Tweet>;
1168
+ }
1169
+
1170
+ export namespace ImageFilteredTweets {
1171
+ /**
1172
+ * A post the image filter kept, with its score.
1173
+ */
1174
+ export interface Tweet extends SearchTweet {
1175
+ /**
1176
+ * How likely a photo shows what you asked for, from 0.5 to 1.
1177
+ */
1178
+ imageScore: number;
1179
+ }
1180
+ }
1181
+
1182
+ /**
1183
+ * What the image filter asked & how many posts it kept.
1184
+ */
1185
+ export interface ImageFilterSummary {
1186
+ /**
1187
+ * Posts whose photos were checked. Only kept posts are billed.
1188
+ */
1189
+ checked: number;
1190
+
1191
+ /**
1192
+ * The lowest imageScore a kept post has.
1193
+ */
1194
+ cutoff: 0.5;
1195
+
1196
+ /**
1197
+ * What you asked the photos to show.
1198
+ */
1199
+ imageShows: string;
1200
+
1201
+ /**
1202
+ * Posts whose photos show it, all returned & billed at 2 credits each.
1203
+ */
1204
+ kept: number;
1205
+
1206
+ /**
1207
+ * The question asked of each post's photos.
1208
+ */
1209
+ question: string;
1210
+
1211
+ /**
1212
+ * Posts without a safe photo & posts the check couldn't answer. They aren't
1213
+ * billed or returned.
1214
+ */
1215
+ unchecked: Array<ImageFilterSummary.Unchecked>;
1216
+ }
1217
+
1218
+ export namespace ImageFilterSummary {
1219
+ /**
1220
+ * A post the image filter left out without a score, with the reason.
1221
+ */
1222
+ export interface Unchecked {
1223
+ id: string;
1224
+
1225
+ reason: string;
1226
+ }
1227
+ }
1228
+
1143
1229
  /**
1144
1230
  * The other account of a following or follower event, with the profile fields a
1145
1231
  * user lookup returns. It holds the ID alone when X fails the profile lookup.
@@ -1163,14 +1249,29 @@ export interface MonitorFollow {
1163
1249
  */
1164
1250
  followedAtExact?: boolean;
1165
1251
 
1252
+ /**
1253
+ * Why a removed account is back, on following.added & follower.added. refollow
1254
+ * means the account followed again. return means X lists the old follow again, so
1255
+ * it never ended. It covers removals the monitor reported in the last 30 days. It
1256
+ * is missing on a first follow.
1257
+ */
1258
+ followKind?: 'refollow' | 'return';
1259
+
1166
1260
  /**
1167
1261
  * Why the account left the list, on following.removed & follower.removed.
1168
- * unavailable means X no longer serves the account. unfollowed means X's follow
1169
- * check says the follow ended. It is missing when X fails the check. Xquik sends no
1170
- * removal while X still confirms the follow.
1262
+ * unavailable means X shows no account for it, and unavailableReason says why.
1263
+ * unfollowed means the follow ended. It is missing when the cause isn't known.
1171
1264
  */
1172
1265
  reason?: 'unavailable' | 'unfollowed';
1173
1266
 
1267
+ /**
1268
+ * Why X shows no account, when reason is unavailable. not_found means the account
1269
+ * no longer exists, as X answers for a deactivated or deleted account. suspended
1270
+ * means X suspended it. A user lookup of the ID answers user_not_found with the
1271
+ * same reason.
1272
+ */
1273
+ unavailableReason?: 'not_found' | 'suspended';
1274
+
1174
1275
  [k: string]: unknown;
1175
1276
  }
1176
1277
 
@@ -1200,11 +1301,25 @@ export interface PaginatedTweets {
1200
1301
 
1201
1302
  tweets: Array<SearchTweet>;
1202
1303
 
1304
+ /**
1305
+ * Present on a last page that X cut short. `stalled` means X returned no new
1306
+ * results 2 times in a row, 30 s apart. The list may hold more. Read it again
1307
+ * later without cursor.
1308
+ */
1309
+ endReason?: 'stalled';
1310
+
1203
1311
  /**
1204
1312
  * Whole number from 0.
1205
1313
  */
1206
1314
  filtered_count?: number;
1207
1315
 
1316
+ /**
1317
+ * Present on an empty last page when X shows this account's timeline to nobody.
1318
+ * The page is empty because of that, so it doesn't mean the account posted
1319
+ * nothing. A retry returns the same page.
1320
+ */
1321
+ hiddenTimeline?: true;
1322
+
1208
1323
  /**
1209
1324
  * How far back a filtered Latest search has read, in UTC. Every newer post was
1210
1325
  * checked, so an empty page still moves this time back.
@@ -1290,6 +1405,13 @@ export interface PaginatedUsers {
1290
1405
 
1291
1406
  users: Array<UserProfile>;
1292
1407
 
1408
+ /**
1409
+ * Present on a last page that X cut short. `stalled` means X returned no new
1410
+ * results 2 times in a row, 30 s apart. The list may hold more. Read it again
1411
+ * later without cursor.
1412
+ */
1413
+ endReason?: 'stalled';
1414
+
1293
1415
  /**
1294
1416
  * Whole number from 0.
1295
1417
  */
@@ -2820,6 +2942,77 @@ export namespace SoftIntervention {
2820
2942
  }
2821
2943
  }
2822
2944
 
2945
+ /**
2946
+ * Posts kept by the topic filter. Each kept post carries its topicScore. Follow
2947
+ * next_cursor to check the next posts.
2948
+ */
2949
+ export interface TopicFilteredTweets extends PaginatedTweets {
2950
+ /**
2951
+ * What the topic filter asked & how many posts it kept.
2952
+ */
2953
+ topicFilter: TopicFilterSummary;
2954
+
2955
+ tweets: Array<TopicFilteredTweets.Tweet>;
2956
+ }
2957
+
2958
+ export namespace TopicFilteredTweets {
2959
+ /**
2960
+ * A post the topic filter kept, with its score.
2961
+ */
2962
+ export interface Tweet extends SearchTweet {
2963
+ /**
2964
+ * How likely the post is about the topic, from 0.5 to 1.
2965
+ */
2966
+ topicScore: number;
2967
+ }
2968
+ }
2969
+
2970
+ /**
2971
+ * What the topic filter asked & how many posts it kept.
2972
+ */
2973
+ export interface TopicFilterSummary {
2974
+ /**
2975
+ * Posts checked. Only kept posts are billed.
2976
+ */
2977
+ checked: number;
2978
+
2979
+ /**
2980
+ * The lowest topicScore a kept post has.
2981
+ */
2982
+ cutoff: 0.5;
2983
+
2984
+ /**
2985
+ * Posts about the topic, all returned & billed at 2 credits each.
2986
+ */
2987
+ kept: number;
2988
+
2989
+ /**
2990
+ * The question asked of each post.
2991
+ */
2992
+ question: string;
2993
+
2994
+ /**
2995
+ * The topic you sent.
2996
+ */
2997
+ topic: string;
2998
+
2999
+ /**
3000
+ * Posts the check couldn't answer. They aren't billed or returned.
3001
+ */
3002
+ unchecked: Array<TopicFilterSummary.Unchecked>;
3003
+ }
3004
+
3005
+ export namespace TopicFilterSummary {
3006
+ /**
3007
+ * A post the topic filter left out without a score, with the reason.
3008
+ */
3009
+ export interface Unchecked {
3010
+ id: string;
3011
+
3012
+ reason: string;
3013
+ }
3014
+ }
3015
+
2823
3016
  /**
2824
3017
  * Tweet media.
2825
3018
  */
@@ -3109,6 +3302,12 @@ export interface UserListPage extends PaginatedUsers {
3109
3302
  * list's last.
3110
3303
  */
3111
3304
  scanLimit?: UserListPage.ScanLimit;
3305
+
3306
+ /**
3307
+ * Present on the last page of an empty list whose profile counts 0 accounts in
3308
+ * it.
3309
+ */
3310
+ windowComplete?: true;
3112
3311
  }
3113
3312
 
3114
3313
  export namespace UserListPage {
@@ -55,6 +55,11 @@ export namespace AccountConnectionAttemptRetrieveResponse {
55
55
  object: 'x_account_connection_attempt';
56
56
 
57
57
  status: 'success';
58
+
59
+ /**
60
+ * The connected account's ID.
61
+ */
62
+ accountId?: string;
58
63
  }
59
64
 
60
65
  /**