x-twitter-scraper 0.20.0 → 0.22.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 (226) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/README.md +121 -122
  3. package/client.d.mts +9 -3
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +9 -3
  6. package/client.d.ts.map +1 -1
  7. package/client.js +2 -2
  8. package/client.js.map +1 -1
  9. package/client.mjs +2 -2
  10. package/client.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/events.d.mts +8 -0
  13. package/resources/events.d.mts.map +1 -1
  14. package/resources/events.d.ts +8 -0
  15. package/resources/events.d.ts.map +1 -1
  16. package/resources/extractions.d.mts +105 -5
  17. package/resources/extractions.d.mts.map +1 -1
  18. package/resources/extractions.d.ts +105 -5
  19. package/resources/extractions.d.ts.map +1 -1
  20. package/resources/index.d.mts +1 -1
  21. package/resources/index.d.mts.map +1 -1
  22. package/resources/index.d.ts +1 -1
  23. package/resources/index.d.ts.map +1 -1
  24. package/resources/index.js.map +1 -1
  25. package/resources/index.mjs.map +1 -1
  26. package/resources/monitors/index.d.mts +1 -1
  27. package/resources/monitors/index.d.mts.map +1 -1
  28. package/resources/monitors/index.d.ts +1 -1
  29. package/resources/monitors/index.d.ts.map +1 -1
  30. package/resources/monitors/index.js.map +1 -1
  31. package/resources/monitors/index.mjs.map +1 -1
  32. package/resources/monitors/monitors.d.mts +38 -1
  33. package/resources/monitors/monitors.d.mts.map +1 -1
  34. package/resources/monitors/monitors.d.ts +38 -1
  35. package/resources/monitors/monitors.d.ts.map +1 -1
  36. package/resources/monitors/monitors.js +18 -0
  37. package/resources/monitors/monitors.js.map +1 -1
  38. package/resources/monitors/monitors.mjs +18 -0
  39. package/resources/monitors/monitors.mjs.map +1 -1
  40. package/resources/monitors/posts.d.mts +27 -0
  41. package/resources/monitors/posts.d.mts.map +1 -1
  42. package/resources/monitors/posts.d.ts +27 -0
  43. package/resources/monitors/posts.d.ts.map +1 -1
  44. package/resources/shared.d.mts +192 -5
  45. package/resources/shared.d.mts.map +1 -1
  46. package/resources/shared.d.ts +192 -5
  47. package/resources/shared.d.ts.map +1 -1
  48. package/resources/x/account-connection-attempts.d.mts +4 -0
  49. package/resources/x/account-connection-attempts.d.mts.map +1 -1
  50. package/resources/x/account-connection-attempts.d.ts +4 -0
  51. package/resources/x/account-connection-attempts.d.ts.map +1 -1
  52. package/resources/x/account-connection-links.d.mts +159 -0
  53. package/resources/x/account-connection-links.d.mts.map +1 -0
  54. package/resources/x/account-connection-links.d.ts +159 -0
  55. package/resources/x/account-connection-links.d.ts.map +1 -0
  56. package/resources/x/account-connection-links.js +82 -0
  57. package/resources/x/account-connection-links.js.map +1 -0
  58. package/resources/x/account-connection-links.mjs +78 -0
  59. package/resources/x/account-connection-links.mjs.map +1 -0
  60. package/resources/x/accounts.d.mts +13 -9
  61. package/resources/x/accounts.d.mts.map +1 -1
  62. package/resources/x/accounts.d.ts +13 -9
  63. package/resources/x/accounts.d.ts.map +1 -1
  64. package/resources/x/analysis.d.mts +540 -36
  65. package/resources/x/analysis.d.mts.map +1 -1
  66. package/resources/x/analysis.d.ts +540 -36
  67. package/resources/x/analysis.d.ts.map +1 -1
  68. package/resources/x/bookmarks.d.mts +5 -0
  69. package/resources/x/bookmarks.d.mts.map +1 -1
  70. package/resources/x/bookmarks.d.ts +5 -0
  71. package/resources/x/bookmarks.d.ts.map +1 -1
  72. package/resources/x/communities/communities.d.mts +2 -2
  73. package/resources/x/communities/communities.d.mts.map +1 -1
  74. package/resources/x/communities/communities.d.ts +2 -2
  75. package/resources/x/communities/communities.d.ts.map +1 -1
  76. package/resources/x/communities/communities.js.map +1 -1
  77. package/resources/x/communities/communities.mjs.map +1 -1
  78. package/resources/x/communities/join.d.mts +2 -2
  79. package/resources/x/communities/join.d.mts.map +1 -1
  80. package/resources/x/communities/join.d.ts +2 -2
  81. package/resources/x/communities/join.d.ts.map +1 -1
  82. package/resources/x/dm.d.mts +2 -2
  83. package/resources/x/dm.d.mts.map +1 -1
  84. package/resources/x/dm.d.ts +2 -2
  85. package/resources/x/dm.d.ts.map +1 -1
  86. package/resources/x/index.d.mts +3 -2
  87. package/resources/x/index.d.mts.map +1 -1
  88. package/resources/x/index.d.ts +3 -2
  89. package/resources/x/index.d.ts.map +1 -1
  90. package/resources/x/index.js +3 -1
  91. package/resources/x/index.js.map +1 -1
  92. package/resources/x/index.mjs +1 -0
  93. package/resources/x/index.mjs.map +1 -1
  94. package/resources/x/media.d.mts +48 -1
  95. package/resources/x/media.d.mts.map +1 -1
  96. package/resources/x/media.d.ts +48 -1
  97. package/resources/x/media.d.ts.map +1 -1
  98. package/resources/x/media.js.map +1 -1
  99. package/resources/x/media.mjs.map +1 -1
  100. package/resources/x/profile.d.mts +3 -3
  101. package/resources/x/profile.d.mts.map +1 -1
  102. package/resources/x/profile.d.ts +3 -3
  103. package/resources/x/profile.d.ts.map +1 -1
  104. package/resources/x/sports.d.mts +19 -1
  105. package/resources/x/sports.d.mts.map +1 -1
  106. package/resources/x/sports.d.ts +19 -1
  107. package/resources/x/sports.d.ts.map +1 -1
  108. package/resources/x/tweets/bookmark.d.mts +84 -0
  109. package/resources/x/tweets/bookmark.d.mts.map +1 -0
  110. package/resources/x/tweets/bookmark.d.ts +84 -0
  111. package/resources/x/tweets/bookmark.d.ts.map +1 -0
  112. package/resources/x/tweets/bookmark.js +55 -0
  113. package/resources/x/tweets/bookmark.js.map +1 -0
  114. package/resources/x/tweets/bookmark.mjs +51 -0
  115. package/resources/x/tweets/bookmark.mjs.map +1 -0
  116. package/resources/x/tweets/index.d.mts +1 -0
  117. package/resources/x/tweets/index.d.mts.map +1 -1
  118. package/resources/x/tweets/index.d.ts +1 -0
  119. package/resources/x/tweets/index.d.ts.map +1 -1
  120. package/resources/x/tweets/index.js +3 -1
  121. package/resources/x/tweets/index.js.map +1 -1
  122. package/resources/x/tweets/index.mjs +1 -0
  123. package/resources/x/tweets/index.mjs.map +1 -1
  124. package/resources/x/tweets/like.d.mts +2 -2
  125. package/resources/x/tweets/like.d.mts.map +1 -1
  126. package/resources/x/tweets/like.d.ts +2 -2
  127. package/resources/x/tweets/like.d.ts.map +1 -1
  128. package/resources/x/tweets/retweet.d.mts +2 -2
  129. package/resources/x/tweets/retweet.d.mts.map +1 -1
  130. package/resources/x/tweets/retweet.d.ts +2 -2
  131. package/resources/x/tweets/retweet.d.ts.map +1 -1
  132. package/resources/x/tweets/tweets.d.mts +45 -13
  133. package/resources/x/tweets/tweets.d.mts.map +1 -1
  134. package/resources/x/tweets/tweets.d.ts +45 -13
  135. package/resources/x/tweets/tweets.d.ts.map +1 -1
  136. package/resources/x/tweets/tweets.js +4 -0
  137. package/resources/x/tweets/tweets.js.map +1 -1
  138. package/resources/x/tweets/tweets.mjs +4 -0
  139. package/resources/x/tweets/tweets.mjs.map +1 -1
  140. package/resources/x/users/block.d.mts +84 -0
  141. package/resources/x/users/block.d.mts.map +1 -0
  142. package/resources/x/users/block.d.ts +84 -0
  143. package/resources/x/users/block.d.ts.map +1 -0
  144. package/resources/x/users/block.js +55 -0
  145. package/resources/x/users/block.js.map +1 -0
  146. package/resources/x/users/block.mjs +51 -0
  147. package/resources/x/users/block.mjs.map +1 -0
  148. package/resources/x/users/follow.d.mts +2 -2
  149. package/resources/x/users/follow.d.mts.map +1 -1
  150. package/resources/x/users/follow.d.ts +2 -2
  151. package/resources/x/users/follow.d.ts.map +1 -1
  152. package/resources/x/users/index.d.mts +3 -1
  153. package/resources/x/users/index.d.mts.map +1 -1
  154. package/resources/x/users/index.d.ts +3 -1
  155. package/resources/x/users/index.d.ts.map +1 -1
  156. package/resources/x/users/index.js +5 -1
  157. package/resources/x/users/index.js.map +1 -1
  158. package/resources/x/users/index.mjs +2 -0
  159. package/resources/x/users/index.mjs.map +1 -1
  160. package/resources/x/users/mute.d.mts +84 -0
  161. package/resources/x/users/mute.d.mts.map +1 -0
  162. package/resources/x/users/mute.d.ts +84 -0
  163. package/resources/x/users/mute.d.ts.map +1 -0
  164. package/resources/x/users/mute.js +55 -0
  165. package/resources/x/users/mute.js.map +1 -0
  166. package/resources/x/users/mute.mjs +51 -0
  167. package/resources/x/users/mute.mjs.map +1 -0
  168. package/resources/x/users/users.d.mts +359 -9
  169. package/resources/x/users/users.d.mts.map +1 -1
  170. package/resources/x/users/users.d.ts +359 -9
  171. package/resources/x/users/users.d.ts.map +1 -1
  172. package/resources/x/users/users.js +27 -1
  173. package/resources/x/users/users.js.map +1 -1
  174. package/resources/x/users/users.mjs +27 -1
  175. package/resources/x/users/users.mjs.map +1 -1
  176. package/resources/x/write-actions.d.mts +1 -1
  177. package/resources/x/write-actions.d.mts.map +1 -1
  178. package/resources/x/write-actions.d.ts +1 -1
  179. package/resources/x/write-actions.d.ts.map +1 -1
  180. package/resources/x/x.d.mts +17 -4
  181. package/resources/x/x.d.mts.map +1 -1
  182. package/resources/x/x.d.ts +17 -4
  183. package/resources/x/x.d.ts.map +1 -1
  184. package/resources/x/x.js +4 -0
  185. package/resources/x/x.js.map +1 -1
  186. package/resources/x/x.mjs +4 -0
  187. package/resources/x/x.mjs.map +1 -1
  188. package/src/client.ts +12 -2
  189. package/src/core/README.md +4 -0
  190. package/src/internal/README.md +6 -1
  191. package/src/resources/events.ts +10 -0
  192. package/src/resources/extractions.ts +125 -0
  193. package/src/resources/index.ts +2 -0
  194. package/src/resources/monitors/index.ts +2 -0
  195. package/src/resources/monitors/monitors.ts +49 -0
  196. package/src/resources/monitors/posts.ts +32 -0
  197. package/src/resources/shared.ts +223 -4
  198. package/src/resources/x/account-connection-attempts.ts +5 -0
  199. package/src/resources/x/account-connection-links.ts +215 -0
  200. package/src/resources/x/accounts.ts +15 -14
  201. package/src/resources/x/analysis.ts +618 -36
  202. package/src/resources/x/bookmarks.ts +6 -0
  203. package/src/resources/x/communities/communities.ts +12 -0
  204. package/src/resources/x/communities/join.ts +12 -0
  205. package/src/resources/x/dm.ts +12 -0
  206. package/src/resources/x/index.ts +16 -0
  207. package/src/resources/x/media.ts +64 -0
  208. package/src/resources/x/profile.ts +18 -0
  209. package/src/resources/x/sports.ts +22 -0
  210. package/src/resources/x/tweets/bookmark.ts +127 -0
  211. package/src/resources/x/tweets/index.ts +7 -0
  212. package/src/resources/x/tweets/like.ts +12 -0
  213. package/src/resources/x/tweets/retweet.ts +12 -0
  214. package/src/resources/x/tweets/tweets.ts +74 -10
  215. package/src/resources/x/users/block.ts +119 -0
  216. package/src/resources/x/users/follow.ts +12 -0
  217. package/src/resources/x/users/index.ts +20 -0
  218. package/src/resources/x/users/mute.ts +119 -0
  219. package/src/resources/x/users/users.ts +470 -7
  220. package/src/resources/x/write-actions.ts +6 -0
  221. package/src/resources/x/x.ts +50 -0
  222. package/src/version.ts +1 -1
  223. package/version.d.mts +1 -1
  224. package/version.d.ts +1 -1
  225. package/version.js +1 -1
  226. package/version.mjs +1 -1
@@ -156,6 +156,12 @@ export interface BookmarkListParams {
156
156
  * Optional bookmark folder ID. Folders need X Premium.
157
157
  */
158
158
  folderId?: string;
159
+
160
+ /**
161
+ * Items per page, 1 to 100, default 20. Source, filters or credits can return
162
+ * fewer. Follow next_cursor for more pages.
163
+ */
164
+ pageSize?: number;
159
165
  }
160
166
 
161
167
  export interface BookmarkRetrieveFoldersParams {
@@ -353,8 +353,14 @@ export interface CommunityCreateResponse {
353
353
  | 'unlike'
354
354
  | 'retweet'
355
355
  | 'unretweet'
356
+ | 'bookmark'
357
+ | 'unbookmark'
356
358
  | 'follow'
357
359
  | 'unfollow'
360
+ | 'block'
361
+ | 'unblock'
362
+ | 'mute'
363
+ | 'unmute'
358
364
  | 'remove_follower'
359
365
  | 'send_dm'
360
366
  | 'delete_dm'
@@ -604,8 +610,14 @@ export interface CommunityDeleteResponse {
604
610
  | 'unlike'
605
611
  | 'retweet'
606
612
  | 'unretweet'
613
+ | 'bookmark'
614
+ | 'unbookmark'
607
615
  | 'follow'
608
616
  | 'unfollow'
617
+ | 'block'
618
+ | 'unblock'
619
+ | 'mute'
620
+ | 'unmute'
609
621
  | 'remove_follower'
610
622
  | 'send_dm'
611
623
  | 'delete_dm'
@@ -83,8 +83,14 @@ export interface JoinCreateResponse {
83
83
  | 'unlike'
84
84
  | 'retweet'
85
85
  | 'unretweet'
86
+ | 'bookmark'
87
+ | 'unbookmark'
86
88
  | 'follow'
87
89
  | 'unfollow'
90
+ | 'block'
91
+ | 'unblock'
92
+ | 'mute'
93
+ | 'unmute'
88
94
  | 'remove_follower'
89
95
  | 'send_dm'
90
96
  | 'delete_dm'
@@ -334,8 +340,14 @@ export interface JoinDeleteAllResponse {
334
340
  | 'unlike'
335
341
  | 'retweet'
336
342
  | 'unretweet'
343
+ | 'bookmark'
344
+ | 'unbookmark'
337
345
  | 'follow'
338
346
  | 'unfollow'
347
+ | 'block'
348
+ | 'unblock'
349
+ | 'mute'
350
+ | 'unmute'
339
351
  | 'remove_follower'
340
352
  | 'send_dm'
341
353
  | 'delete_dm'
@@ -103,8 +103,14 @@ export interface DmDeleteMessageResponse {
103
103
  | 'unlike'
104
104
  | 'retweet'
105
105
  | 'unretweet'
106
+ | 'bookmark'
107
+ | 'unbookmark'
106
108
  | 'follow'
107
109
  | 'unfollow'
110
+ | 'block'
111
+ | 'unblock'
112
+ | 'mute'
113
+ | 'unmute'
108
114
  | 'remove_follower'
109
115
  | 'send_dm'
110
116
  | 'delete_dm'
@@ -385,8 +391,14 @@ export interface DmSendResponse {
385
391
  | 'unlike'
386
392
  | 'retweet'
387
393
  | 'unretweet'
394
+ | 'bookmark'
395
+ | 'unbookmark'
388
396
  | 'follow'
389
397
  | 'unfollow'
398
+ | 'block'
399
+ | 'unblock'
400
+ | 'mute'
401
+ | 'unmute'
390
402
  | 'remove_follower'
391
403
  | 'send_dm'
392
404
  | 'delete_dm'
@@ -6,6 +6,15 @@ export {
6
6
  AccountConnectionAttempts,
7
7
  type AccountConnectionAttemptRetrieveResponse,
8
8
  } from './account-connection-attempts';
9
+ export {
10
+ AccountConnectionLinks,
11
+ type XAccountConnectionLink,
12
+ type AccountConnectionLinkCreateResponse,
13
+ type AccountConnectionLinkListResponse,
14
+ type AccountConnectionLinkDeleteResponse,
15
+ type AccountConnectionLinkCreateParams,
16
+ type AccountConnectionLinkListParams,
17
+ } from './account-connection-links';
9
18
  export {
10
19
  AccountConnectionChallenges,
11
20
  type AccountConnectionChallengeSubmitResponse,
@@ -182,6 +191,11 @@ export {
182
191
  type UserRemoveFollowerResponse,
183
192
  type UserRetrieveBatchResponse,
184
193
  type UserRetrieveBatchTweetsResponse,
194
+ type UserRetrieveFollowerAuditResponse,
195
+ type FollowerAudit,
196
+ type AuditedFollower,
197
+ type FollowerClass,
198
+ type FollowerValueCount,
185
199
  type UserRetrieveFollowerIDsResponse,
186
200
  type UserRetrieveFollowersResponse,
187
201
  type UserRetrieveFollowingResponse,
@@ -200,6 +214,7 @@ export {
200
214
  type UserRetrieveArticlesParams,
201
215
  type UserRetrieveBatchParams,
202
216
  type UserRetrieveBatchTweetsParams,
217
+ type UserRetrieveFollowerAuditParams,
203
218
  type UserRetrieveFollowerIDsParams,
204
219
  type UserRetrieveFollowersParams,
205
220
  type UserRetrieveFollowersYouKnowParams,
@@ -253,6 +268,7 @@ export {
253
268
  type FootballSchedulePeriod,
254
269
  type FootballOdds,
255
270
  type FootballScheduleGameOdds,
271
+ type FootballPollRanking,
256
272
  type FootballScheduleGame,
257
273
  type SportsTeamColor,
258
274
  type SportsTeamLogos,
@@ -3,6 +3,7 @@
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
 
5
5
  import { APIResource } from '../../core/resource';
6
+ import * as Shared from '../shared';
6
7
  import { APIPromise } from '../../core/api-promise';
7
8
  import { type Uploadable } from '../../core/uploads';
8
9
  import { buildHeaders } from '../../internal/headers';
@@ -55,18 +56,39 @@ export class Media extends APIResource {
55
56
  export interface MediaDownloadResponse {
56
57
  cacheHit?: boolean;
57
58
 
59
+ /**
60
+ * Posts Xquik couldn't read, at no charge. Send them again.
61
+ */
62
+ failedTweetIds?: Array<string>;
63
+
58
64
  galleryUrl?: string;
59
65
 
66
+ /**
67
+ * What the image filter asked & how many posts it kept. Present when the request
68
+ * sent imageShows.
69
+ */
70
+ imageFilter?: Shared.ImageFilterSummary;
71
+
60
72
  /**
61
73
  * The post's files saved to your gallery. Single downloads only.
62
74
  */
63
75
  items?: Array<MediaDownloadResponse.Item>;
64
76
 
77
+ /**
78
+ * Posts with no media to save, at no charge.
79
+ */
80
+ noMediaTweetIds?: Array<string>;
81
+
65
82
  totalMedia?: number;
66
83
 
67
84
  totalTweets?: number;
68
85
 
69
86
  tweetId?: string;
87
+
88
+ /**
89
+ * Posts Xquik had no time to read, at no charge. Send them again.
90
+ */
91
+ unprocessedTweetIds?: Array<string>;
70
92
  }
71
93
 
72
94
  export namespace MediaDownloadResponse {
@@ -88,6 +110,18 @@ export namespace MediaDownloadResponse {
88
110
  */
89
111
  mediaUrl: string;
90
112
 
113
+ /**
114
+ * Cover image of a video or GIF. Null for photos & files first saved to Xquik
115
+ * before 2026-11-03.
116
+ */
117
+ posterUrl: string | null;
118
+
119
+ /**
120
+ * The MP4 sizes X stores for a video, highest bitrate first. Empty for photos,
121
+ * GIFs & files first saved to Xquik before 2026-11-03.
122
+ */
123
+ qualities: Array<Item.Quality>;
124
+
91
125
  /**
92
126
  * File size in bytes, as a string.
93
127
  */
@@ -112,6 +146,21 @@ export namespace MediaDownloadResponse {
112
146
 
113
147
  views: number | null;
114
148
  }
149
+
150
+ export namespace Item {
151
+ /**
152
+ * 1 MP4 size of the video.
153
+ */
154
+ export interface Quality {
155
+ bitrate: number;
156
+
157
+ height: number;
158
+
159
+ url: string;
160
+
161
+ width: number;
162
+ }
163
+ }
115
164
  }
116
165
 
117
166
  /**
@@ -134,8 +183,14 @@ export interface MediaUploadResponse {
134
183
  | 'unlike'
135
184
  | 'retweet'
136
185
  | 'unretweet'
186
+ | 'bookmark'
187
+ | 'unbookmark'
137
188
  | 'follow'
138
189
  | 'unfollow'
190
+ | 'block'
191
+ | 'unblock'
192
+ | 'mute'
193
+ | 'unmute'
139
194
  | 'remove_follower'
140
195
  | 'send_dm'
141
196
  | 'delete_dm'
@@ -366,6 +421,15 @@ export namespace MediaUploadResponse {
366
421
  }
367
422
 
368
423
  export interface MediaDownloadParams {
424
+ /**
425
+ * Save only posts whose photos show this. Send charts, screenshots, product_photos,
426
+ * memes or people, or describe it in words, such as a rocket. AI-powered analysis
427
+ * checks posts with photos X doesn't mark sensitive & keeps scores of 0.5 or more.
428
+ * Each post saved costs 2 credits, the AI analysis price, on top of its save price,
429
+ * & a post the filter drops costs nothing. imageFilter states the cutoff & counts.
430
+ */
431
+ imageShows?: string;
432
+
369
433
  /**
370
434
  * Numeric tweet ID alias for tweetInput
371
435
  */
@@ -118,8 +118,14 @@ export interface ProfileUpdateResponse {
118
118
  | 'unlike'
119
119
  | 'retweet'
120
120
  | 'unretweet'
121
+ | 'bookmark'
122
+ | 'unbookmark'
121
123
  | 'follow'
122
124
  | 'unfollow'
125
+ | 'block'
126
+ | 'unblock'
127
+ | 'mute'
128
+ | 'unmute'
123
129
  | 'remove_follower'
124
130
  | 'send_dm'
125
131
  | 'delete_dm'
@@ -369,8 +375,14 @@ export interface ProfileUpdateAvatarResponse {
369
375
  | 'unlike'
370
376
  | 'retweet'
371
377
  | 'unretweet'
378
+ | 'bookmark'
379
+ | 'unbookmark'
372
380
  | 'follow'
373
381
  | 'unfollow'
382
+ | 'block'
383
+ | 'unblock'
384
+ | 'mute'
385
+ | 'unmute'
374
386
  | 'remove_follower'
375
387
  | 'send_dm'
376
388
  | 'delete_dm'
@@ -620,8 +632,14 @@ export interface ProfileUpdateBannerResponse {
620
632
  | 'unlike'
621
633
  | 'retweet'
622
634
  | 'unretweet'
635
+ | 'bookmark'
636
+ | 'unbookmark'
623
637
  | 'follow'
624
638
  | 'unfollow'
639
+ | 'block'
640
+ | 'unblock'
641
+ | 'mute'
642
+ | 'unmute'
625
643
  | 'remove_follower'
626
644
  | 'send_dm'
627
645
  | 'delete_dm'
@@ -238,6 +238,21 @@ export interface FootballScheduleGameOdds {
238
238
  away: FootballOdds;
239
239
  }
240
240
 
241
+ /**
242
+ * A team's rank in X's college football poll.
243
+ */
244
+ export interface FootballPollRanking {
245
+ /**
246
+ * The ranked team, a key of teams.
247
+ */
248
+ teamId: string | null;
249
+
250
+ /**
251
+ * The team's rank, where 1 is the top.
252
+ */
253
+ rank: number | null;
254
+ }
255
+
241
256
  /**
242
257
  * A listed game, with its teams & score.
243
258
  */
@@ -301,6 +316,12 @@ export interface FootballScheduleGame {
301
316
  * Betting odds for each team, or null when X has none.
302
317
  */
303
318
  odds: FootballScheduleGameOdds | null;
319
+
320
+ /**
321
+ * Each team X ranks in its college football poll, with its rank. Empty when X
322
+ * ranks neither team, & for the NFL.
323
+ */
324
+ rankings: Array<FootballPollRanking>;
304
325
  }
305
326
 
306
327
  export interface SportsTeamColor {
@@ -2190,6 +2211,7 @@ export declare namespace Sports {
2190
2211
  type FootballSchedulePeriod as FootballSchedulePeriod,
2191
2212
  type FootballOdds as FootballOdds,
2192
2213
  type FootballScheduleGameOdds as FootballScheduleGameOdds,
2214
+ type FootballPollRanking as FootballPollRanking,
2193
2215
  type FootballScheduleGame as FootballScheduleGame,
2194
2216
  type SportsTeamColor as SportsTeamColor,
2195
2217
  type SportsTeamLogos as SportsTeamLogos,
@@ -0,0 +1,127 @@
1
+ // SPDX-FileCopyrightText: 2026 Xquik contributors
2
+ //
3
+ // SPDX-License-Identifier: Apache-2.0
4
+
5
+ import { APIResource } from '../../../core/resource';
6
+ import * as WriteActionsAPI from '../write-actions';
7
+ import { APIPromise } from '../../../core/api-promise';
8
+ import { buildHeaders } from '../../../internal/headers';
9
+ import { RequestOptions } from '../../../internal/request-options';
10
+ import { path } from '../../../internal/utils/path';
11
+
12
+ /**
13
+ * X write actions (tweets, likes, follows, DMs)
14
+ */
15
+ export class Bookmark extends APIResource {
16
+ /**
17
+ * Bookmarks a post through a connected X account. Only that account sees its
18
+ * bookmarks, and `client.x.bookmarks.list` lists them.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const bookmark = await client.x.tweets.bookmark.create('id', {
23
+ * account: '@elonmusk',
24
+ * 'Idempotency-Key': 'Idempotency-Key',
25
+ * });
26
+ * ```
27
+ */
28
+ create(
29
+ id: string,
30
+ params: BookmarkCreateParams,
31
+ options?: RequestOptions,
32
+ ): APIPromise<BookmarkCreateResponse> {
33
+ const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
34
+ return this._client.post(path`/x/tweets/${id}/bookmark`, {
35
+ body,
36
+ ...options,
37
+ headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
38
+ });
39
+ }
40
+
41
+ /**
42
+ * Removes a bookmark through a connected X account.
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * const response = await client.x.tweets.bookmark.delete('id', {
47
+ * account: '@elonmusk',
48
+ * 'Idempotency-Key': 'Idempotency-Key',
49
+ * });
50
+ * ```
51
+ */
52
+ delete(
53
+ id: string,
54
+ params: BookmarkDeleteParams,
55
+ options?: RequestOptions,
56
+ ): APIPromise<BookmarkDeleteResponse> {
57
+ const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
58
+ return this._client.delete(path`/x/tweets/${id}/bookmark`, {
59
+ body,
60
+ ...options,
61
+ headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
62
+ });
63
+ }
64
+ }
65
+
66
+ export type BookmarkCreateResponse = WriteActionsAPI.WriteActionRetrieveResponse;
67
+
68
+ export type BookmarkDeleteResponse = WriteActionsAPI.WriteActionRetrieveResponse;
69
+
70
+ export interface BookmarkCreateParams {
71
+ /**
72
+ * Body param: X account identifier (@username or account ID)
73
+ */
74
+ account: string;
75
+
76
+ /**
77
+ * Header param: Use one unique value per intended write. Reuse it only for an
78
+ * identical retry. A matching retry returns the first answer again, with
79
+ * idempotent: true added. It keeps the first status, body & Retry-After. It sends
80
+ * nothing to X & charges nothing. While the first request runs, a retry returns
81
+ * 202 & the action. Different input returns 409. Protection lasts at least 90
82
+ * days.
83
+ */
84
+ 'Idempotency-Key': string;
85
+
86
+ /**
87
+ * Header param: A long write answers 202 with a status link, then lands on X.
88
+ * `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
89
+ * the write is still running then, the API answers 202 with Location. Poll
90
+ * Location until `terminal` is true, and don't send the write again.
91
+ */
92
+ Prefer?: string;
93
+ }
94
+
95
+ export interface BookmarkDeleteParams {
96
+ /**
97
+ * Body param: X account identifier (@username or account ID)
98
+ */
99
+ account: string;
100
+
101
+ /**
102
+ * Header param: Use one unique value per intended write. Reuse it only for an
103
+ * identical retry. A matching retry returns the first answer again, with
104
+ * idempotent: true added. It keeps the first status, body & Retry-After. It sends
105
+ * nothing to X & charges nothing. While the first request runs, a retry returns
106
+ * 202 & the action. Different input returns 409. Protection lasts at least 90
107
+ * days.
108
+ */
109
+ 'Idempotency-Key': string;
110
+
111
+ /**
112
+ * Header param: A long write answers 202 with a status link, then lands on X.
113
+ * `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
114
+ * the write is still running then, the API answers 202 with Location. Poll
115
+ * Location until `terminal` is true, and don't send the write again.
116
+ */
117
+ Prefer?: string;
118
+ }
119
+
120
+ export declare namespace Bookmark {
121
+ export {
122
+ type BookmarkCreateResponse as BookmarkCreateResponse,
123
+ type BookmarkDeleteResponse as BookmarkDeleteResponse,
124
+ type BookmarkCreateParams as BookmarkCreateParams,
125
+ type BookmarkDeleteParams as BookmarkDeleteParams,
126
+ };
127
+ }
@@ -2,6 +2,13 @@
2
2
  //
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
 
5
+ export {
6
+ Bookmark,
7
+ type BookmarkCreateResponse,
8
+ type BookmarkDeleteResponse,
9
+ type BookmarkCreateParams,
10
+ type BookmarkDeleteParams,
11
+ } from './bookmark';
5
12
  export {
6
13
  Like,
7
14
  type LikeCreateResponse,
@@ -73,8 +73,14 @@ export interface LikeCreateResponse {
73
73
  | 'unlike'
74
74
  | 'retweet'
75
75
  | 'unretweet'
76
+ | 'bookmark'
77
+ | 'unbookmark'
76
78
  | 'follow'
77
79
  | 'unfollow'
80
+ | 'block'
81
+ | 'unblock'
82
+ | 'mute'
83
+ | 'unmute'
78
84
  | 'remove_follower'
79
85
  | 'send_dm'
80
86
  | 'delete_dm'
@@ -324,8 +330,14 @@ export interface LikeDeleteResponse {
324
330
  | 'unlike'
325
331
  | 'retweet'
326
332
  | 'unretweet'
333
+ | 'bookmark'
334
+ | 'unbookmark'
327
335
  | 'follow'
328
336
  | 'unfollow'
337
+ | 'block'
338
+ | 'unblock'
339
+ | 'mute'
340
+ | 'unmute'
329
341
  | 'remove_follower'
330
342
  | 'send_dm'
331
343
  | 'delete_dm'
@@ -81,8 +81,14 @@ export interface RetweetCreateResponse {
81
81
  | 'unlike'
82
82
  | 'retweet'
83
83
  | 'unretweet'
84
+ | 'bookmark'
85
+ | 'unbookmark'
84
86
  | 'follow'
85
87
  | 'unfollow'
88
+ | 'block'
89
+ | 'unblock'
90
+ | 'mute'
91
+ | 'unmute'
86
92
  | 'remove_follower'
87
93
  | 'send_dm'
88
94
  | 'delete_dm'
@@ -332,8 +338,14 @@ export interface RetweetDeleteResponse {
332
338
  | 'unlike'
333
339
  | 'retweet'
334
340
  | 'unretweet'
341
+ | 'bookmark'
342
+ | 'unbookmark'
335
343
  | 'follow'
336
344
  | 'unfollow'
345
+ | 'block'
346
+ | 'unblock'
347
+ | 'mute'
348
+ | 'unmute'
337
349
  | 'remove_follower'
338
350
  | 'send_dm'
339
351
  | 'delete_dm'