x-twitter-scraper 0.2.1 → 0.3.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 (200) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/client.d.mts +14 -27
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +14 -27
  5. package/client.d.ts.map +1 -1
  6. package/client.js +12 -27
  7. package/client.js.map +1 -1
  8. package/client.mjs +12 -27
  9. package/client.mjs.map +1 -1
  10. package/internal/request-options.d.mts +0 -4
  11. package/internal/request-options.d.mts.map +1 -1
  12. package/internal/request-options.d.ts +0 -4
  13. package/internal/request-options.d.ts.map +1 -1
  14. package/internal/request-options.js.map +1 -1
  15. package/internal/request-options.mjs.map +1 -1
  16. package/internal/utils/env.js +2 -2
  17. package/internal/utils/env.js.map +1 -1
  18. package/internal/utils/env.mjs +2 -2
  19. package/internal/utils/env.mjs.map +1 -1
  20. package/package.json +1 -1
  21. package/resources/account.d.mts +7 -6
  22. package/resources/account.d.mts.map +1 -1
  23. package/resources/account.d.ts +7 -6
  24. package/resources/account.d.ts.map +1 -1
  25. package/resources/account.js +3 -3
  26. package/resources/account.js.map +1 -1
  27. package/resources/account.mjs +3 -3
  28. package/resources/account.mjs.map +1 -1
  29. package/resources/api-keys.js +3 -3
  30. package/resources/api-keys.js.map +1 -1
  31. package/resources/api-keys.mjs +3 -3
  32. package/resources/api-keys.mjs.map +1 -1
  33. package/resources/compose.d.mts +1 -1
  34. package/resources/compose.d.ts +1 -1
  35. package/resources/compose.js +1 -1
  36. package/resources/compose.mjs +1 -1
  37. package/resources/credits.d.mts +1 -1
  38. package/resources/credits.d.ts +1 -1
  39. package/resources/credits.js +1 -1
  40. package/resources/credits.mjs +1 -1
  41. package/resources/drafts.d.mts +1 -1
  42. package/resources/drafts.d.ts +1 -1
  43. package/resources/drafts.js +1 -1
  44. package/resources/drafts.mjs +1 -1
  45. package/resources/events.js +1 -1
  46. package/resources/events.js.map +1 -1
  47. package/resources/events.mjs +1 -1
  48. package/resources/events.mjs.map +1 -1
  49. package/resources/extractions.d.mts +3 -2
  50. package/resources/extractions.d.mts.map +1 -1
  51. package/resources/extractions.d.ts +3 -2
  52. package/resources/extractions.d.ts.map +1 -1
  53. package/resources/index.d.mts +1 -3
  54. package/resources/index.d.mts.map +1 -1
  55. package/resources/index.d.ts +1 -3
  56. package/resources/index.d.ts.map +1 -1
  57. package/resources/index.js +1 -5
  58. package/resources/index.js.map +1 -1
  59. package/resources/index.mjs +0 -2
  60. package/resources/index.mjs.map +1 -1
  61. package/resources/monitors.d.mts +1 -1
  62. package/resources/monitors.d.ts +1 -1
  63. package/resources/monitors.js +1 -1
  64. package/resources/monitors.mjs +1 -1
  65. package/resources/radar.d.mts +45 -10
  66. package/resources/radar.d.mts.map +1 -1
  67. package/resources/radar.d.ts +45 -10
  68. package/resources/radar.d.ts.map +1 -1
  69. package/resources/radar.js +1 -1
  70. package/resources/radar.mjs +1 -1
  71. package/resources/shared.d.mts +47 -6
  72. package/resources/shared.d.mts.map +1 -1
  73. package/resources/shared.d.ts +47 -6
  74. package/resources/shared.d.ts.map +1 -1
  75. package/resources/styles.d.mts +1 -1
  76. package/resources/styles.d.ts +1 -1
  77. package/resources/styles.js +1 -1
  78. package/resources/styles.mjs +1 -1
  79. package/resources/subscribe.d.mts +1 -1
  80. package/resources/subscribe.d.ts +1 -1
  81. package/resources/subscribe.js +1 -1
  82. package/resources/subscribe.mjs +1 -1
  83. package/resources/trends.d.mts +2 -2
  84. package/resources/trends.d.ts +2 -2
  85. package/resources/trends.js +2 -2
  86. package/resources/trends.mjs +2 -2
  87. package/resources/webhooks.d.mts +2 -2
  88. package/resources/webhooks.d.ts +2 -2
  89. package/resources/webhooks.js +2 -2
  90. package/resources/webhooks.mjs +2 -2
  91. package/resources/x/accounts.d.mts +48 -0
  92. package/resources/x/accounts.d.mts.map +1 -1
  93. package/resources/x/accounts.d.ts +48 -0
  94. package/resources/x/accounts.d.ts.map +1 -1
  95. package/resources/x/accounts.js +6 -10
  96. package/resources/x/accounts.js.map +1 -1
  97. package/resources/x/accounts.mjs +6 -10
  98. package/resources/x/accounts.mjs.map +1 -1
  99. package/resources/x/bookmarks.d.mts +1 -1
  100. package/resources/x/bookmarks.d.ts +1 -1
  101. package/resources/x/bookmarks.js +1 -1
  102. package/resources/x/bookmarks.mjs +1 -1
  103. package/resources/x/communities/communities.d.mts +4 -4
  104. package/resources/x/communities/communities.d.ts +4 -4
  105. package/resources/x/communities/communities.js +4 -4
  106. package/resources/x/communities/communities.mjs +4 -4
  107. package/resources/x/communities/tweets.d.mts +3 -3
  108. package/resources/x/communities/tweets.d.ts +3 -3
  109. package/resources/x/communities/tweets.js +3 -3
  110. package/resources/x/communities/tweets.mjs +3 -3
  111. package/resources/x/followers.d.mts +2 -2
  112. package/resources/x/followers.d.ts +2 -2
  113. package/resources/x/followers.js +2 -2
  114. package/resources/x/followers.mjs +2 -2
  115. package/resources/x/index.d.mts +3 -3
  116. package/resources/x/index.d.mts.map +1 -1
  117. package/resources/x/index.d.ts +3 -3
  118. package/resources/x/index.d.ts.map +1 -1
  119. package/resources/x/index.js.map +1 -1
  120. package/resources/x/index.mjs.map +1 -1
  121. package/resources/x/lists.d.mts +4 -4
  122. package/resources/x/lists.d.ts +4 -4
  123. package/resources/x/lists.js +4 -4
  124. package/resources/x/lists.mjs +4 -4
  125. package/resources/x/media.d.mts +2 -2
  126. package/resources/x/media.d.ts +2 -2
  127. package/resources/x/media.js +2 -2
  128. package/resources/x/media.mjs +2 -2
  129. package/resources/x/tweets/index.d.mts +1 -1
  130. package/resources/x/tweets/index.d.mts.map +1 -1
  131. package/resources/x/tweets/index.d.ts +1 -1
  132. package/resources/x/tweets/index.d.ts.map +1 -1
  133. package/resources/x/tweets/index.js.map +1 -1
  134. package/resources/x/tweets/index.mjs.map +1 -1
  135. package/resources/x/tweets/tweets.d.mts +19 -36
  136. package/resources/x/tweets/tweets.d.mts.map +1 -1
  137. package/resources/x/tweets/tweets.d.ts +19 -36
  138. package/resources/x/tweets/tweets.d.ts.map +1 -1
  139. package/resources/x/tweets/tweets.js +7 -7
  140. package/resources/x/tweets/tweets.js.map +1 -1
  141. package/resources/x/tweets/tweets.mjs +7 -7
  142. package/resources/x/tweets/tweets.mjs.map +1 -1
  143. package/resources/x/users/index.d.mts +1 -1
  144. package/resources/x/users/index.d.mts.map +1 -1
  145. package/resources/x/users/index.d.ts +1 -1
  146. package/resources/x/users/index.d.ts.map +1 -1
  147. package/resources/x/users/index.js.map +1 -1
  148. package/resources/x/users/index.mjs.map +1 -1
  149. package/resources/x/users/users.d.mts +13 -29
  150. package/resources/x/users/users.d.mts.map +1 -1
  151. package/resources/x/users/users.d.ts +13 -29
  152. package/resources/x/users/users.d.ts.map +1 -1
  153. package/resources/x/users/users.js +11 -11
  154. package/resources/x/users/users.js.map +1 -1
  155. package/resources/x/users/users.mjs +11 -11
  156. package/resources/x/users/users.mjs.map +1 -1
  157. package/resources/x/x.d.mts +17 -10
  158. package/resources/x/x.d.mts.map +1 -1
  159. package/resources/x/x.d.ts +17 -10
  160. package/resources/x/x.d.ts.map +1 -1
  161. package/resources/x/x.js +3 -6
  162. package/resources/x/x.js.map +1 -1
  163. package/resources/x/x.mjs +3 -6
  164. package/resources/x/x.mjs.map +1 -1
  165. package/src/client.ts +16 -56
  166. package/src/internal/request-options.ts +0 -2
  167. package/src/internal/utils/env.ts +2 -2
  168. package/src/resources/account.ts +10 -8
  169. package/src/resources/api-keys.ts +3 -3
  170. package/src/resources/compose.ts +1 -1
  171. package/src/resources/credits.ts +1 -1
  172. package/src/resources/drafts.ts +1 -1
  173. package/src/resources/events.ts +1 -1
  174. package/src/resources/extractions.ts +5 -3
  175. package/src/resources/index.ts +1 -13
  176. package/src/resources/monitors.ts +1 -1
  177. package/src/resources/radar.ts +50 -10
  178. package/src/resources/shared.ts +74 -14
  179. package/src/resources/styles.ts +1 -1
  180. package/src/resources/subscribe.ts +1 -1
  181. package/src/resources/trends.ts +2 -2
  182. package/src/resources/webhooks.ts +2 -2
  183. package/src/resources/x/accounts.ts +65 -10
  184. package/src/resources/x/bookmarks.ts +1 -1
  185. package/src/resources/x/communities/communities.ts +4 -4
  186. package/src/resources/x/communities/tweets.ts +3 -3
  187. package/src/resources/x/followers.ts +2 -2
  188. package/src/resources/x/index.ts +1 -2
  189. package/src/resources/x/lists.ts +4 -4
  190. package/src/resources/x/media.ts +2 -2
  191. package/src/resources/x/tweets/index.ts +0 -1
  192. package/src/resources/x/tweets/tweets.ts +20 -52
  193. package/src/resources/x/users/index.ts +0 -1
  194. package/src/resources/x/users/users.ts +12 -40
  195. package/src/resources/x/x.ts +19 -10
  196. package/src/version.ts +1 -1
  197. package/version.d.mts +1 -1
  198. package/version.d.ts +1 -1
  199. package/version.js +1 -1
  200. package/version.mjs +1 -1
@@ -5,11 +5,11 @@ import { APIPromise } from '../core/api-promise';
5
5
  import { RequestOptions } from '../internal/request-options';
6
6
 
7
7
  /**
8
- * Trending topics by region
8
+ * Trending topics and hashtags by region
9
9
  */
10
10
  export class Trends extends APIResource {
11
11
  /**
12
- * Get regional trending topics
12
+ * Get trending hashtags and topics by region (alias)
13
13
  */
14
14
  list(
15
15
  query: TrendListParams | null | undefined = {},
@@ -7,7 +7,7 @@ import { RequestOptions } from '../internal/request-options';
7
7
  import { path } from '../internal/utils/path';
8
8
 
9
9
  /**
10
- * Webhook endpoint management & delivery
10
+ * Webhook endpoint management and delivery
11
11
  */
12
12
  export class Webhooks extends APIResource {
13
13
  /**
@@ -16,7 +16,7 @@ export class Webhooks extends APIResource {
16
16
  * @example
17
17
  * ```ts
18
18
  * const webhook = await client.webhooks.create({
19
- * eventTypes: ['tweet.new', 'follower.gained'],
19
+ * eventTypes: ['tweet.new', 'tweet.reply'],
20
20
  * url: 'https://example.com/webhook',
21
21
  * });
22
22
  * ```
@@ -22,7 +22,7 @@ export class Accounts extends APIResource {
22
22
  * ```
23
23
  */
24
24
  create(body: AccountCreateParams, options?: RequestOptions): APIPromise<AccountCreateResponse> {
25
- return this._client.post('/x/accounts', { body, ...options, __security: { apiKeyAuth: true } });
25
+ return this._client.post('/x/accounts', { body, ...options });
26
26
  }
27
27
 
28
28
  /**
@@ -36,7 +36,7 @@ export class Accounts extends APIResource {
36
36
  * ```
37
37
  */
38
38
  retrieve(id: string, options?: RequestOptions): APIPromise<XAccountDetail> {
39
- return this._client.get(path`/x/accounts/${id}`, { ...options, __security: { apiKeyAuth: true } });
39
+ return this._client.get(path`/x/accounts/${id}`, options);
40
40
  }
41
41
 
42
42
  /**
@@ -48,7 +48,7 @@ export class Accounts extends APIResource {
48
48
  * ```
49
49
  */
50
50
  list(options?: RequestOptions): APIPromise<AccountListResponse> {
51
- return this._client.get('/x/accounts', { ...options, __security: { apiKeyAuth: true } });
51
+ return this._client.get('/x/accounts', options);
52
52
  }
53
53
 
54
54
  /**
@@ -60,7 +60,7 @@ export class Accounts extends APIResource {
60
60
  * ```
61
61
  */
62
62
  delete(id: string, options?: RequestOptions): APIPromise<AccountDeleteResponse> {
63
- return this._client.delete(path`/x/accounts/${id}`, { ...options, __security: { apiKeyAuth: true } });
63
+ return this._client.delete(path`/x/accounts/${id}`, options);
64
64
  }
65
65
 
66
66
  /**
@@ -73,7 +73,7 @@ export class Accounts extends APIResource {
73
73
  * ```
74
74
  */
75
75
  bulkRetry(options?: RequestOptions): APIPromise<AccountBulkRetryResponse> {
76
- return this._client.post('/x/accounts/bulk-retry', { ...options, __security: { apiKeyAuth: true } });
76
+ return this._client.post('/x/accounts/bulk-retry', options);
77
77
  }
78
78
 
79
79
  /**
@@ -88,11 +88,7 @@ export class Accounts extends APIResource {
88
88
  * ```
89
89
  */
90
90
  reauth(id: string, body: AccountReauthParams, options?: RequestOptions): APIPromise<AccountReauthResponse> {
91
- return this._client.post(path`/x/accounts/${id}/reauth`, {
92
- body,
93
- ...options,
94
- __security: { apiKeyAuth: true },
95
- });
91
+ return this._client.post(path`/x/accounts/${id}/reauth`, { body, ...options });
96
92
  }
97
93
  }
98
94
 
@@ -104,6 +100,15 @@ export interface XAccount {
104
100
 
105
101
  createdAt: string;
106
102
 
103
+ /**
104
+ * Derived login/cookie health. `healthy` = cookies valid. `needsReauth` = user
105
+ * must submit fresh credentials. `locked` = X locked the account; unlock on x.com
106
+ * first. `suspended` = X banned the account. `recovering` = past cooldown, will
107
+ * auto-retry on next use. `temporaryIssue` = transient backend problem; retry
108
+ * shortly.
109
+ */
110
+ health: 'healthy' | 'locked' | 'needsReauth' | 'recovering' | 'suspended' | 'temporaryIssue';
111
+
107
112
  status: string;
108
113
 
109
114
  xUserId: string;
@@ -119,6 +124,8 @@ export interface XAccountDetail {
119
124
 
120
125
  createdAt: string;
121
126
 
127
+ health: 'healthy' | 'locked' | 'needsReauth' | 'recovering' | 'suspended' | 'temporaryIssue';
128
+
122
129
  status: string;
123
130
 
124
131
  xUserId: string;
@@ -132,14 +139,32 @@ export interface XAccountDetail {
132
139
  updatedAt?: string;
133
140
  }
134
141
 
142
+ /**
143
+ * Sanitized X account summary returned by connect and reauth. Includes an optional
144
+ * `loginCountry` field surfaced only when the declared proxy region had no Driver
145
+ * capacity and the login fell back to a single US consumer device for this
146
+ * one-time action. Future activity continues to use the selected `proxy_country`;
147
+ * the field is omitted on normal logins.
148
+ */
135
149
  export interface AccountCreateResponse {
136
150
  id: string;
137
151
 
152
+ createdAt: string;
153
+
154
+ health: 'healthy' | 'locked' | 'needsReauth' | 'recovering' | 'suspended' | 'temporaryIssue';
155
+
138
156
  status: string;
139
157
 
140
158
  xUserId: string;
141
159
 
142
160
  xUsername: string;
161
+
162
+ /**
163
+ * ISO-3166-1 alpha-2 country code of the Driver consumer device used for this
164
+ * login. Present only when the US fallback was triggered because Driver had no
165
+ * capacity in the declared region. Omitted otherwise.
166
+ */
167
+ loginCountry?: string;
143
168
  }
144
169
 
145
170
  export interface AccountListResponse {
@@ -157,12 +182,32 @@ export interface AccountBulkRetryResponse {
157
182
  cleared: number;
158
183
  }
159
184
 
185
+ /**
186
+ * Sanitized X account summary returned by connect and reauth. Includes an optional
187
+ * `loginCountry` field surfaced only when the declared proxy region had no Driver
188
+ * capacity and the login fell back to a single US consumer device for this
189
+ * one-time action. Future activity continues to use the selected `proxy_country`;
190
+ * the field is omitted on normal logins.
191
+ */
160
192
  export interface AccountReauthResponse {
161
193
  id: string;
162
194
 
195
+ createdAt: string;
196
+
197
+ health: 'healthy' | 'locked' | 'needsReauth' | 'recovering' | 'suspended' | 'temporaryIssue';
198
+
163
199
  status: string;
164
200
 
201
+ xUserId: string;
202
+
165
203
  xUsername: string;
204
+
205
+ /**
206
+ * ISO-3166-1 alpha-2 country code of the Driver consumer device used for this
207
+ * login. Present only when the US fallback was triggered because Driver had no
208
+ * capacity in the declared region. Omitted otherwise.
209
+ */
210
+ loginCountry?: string;
166
211
  }
167
212
 
168
213
  export interface AccountCreateParams {
@@ -198,6 +243,16 @@ export interface AccountReauthParams {
198
243
  */
199
244
  password: string;
200
245
 
246
+ /**
247
+ * Email for the X account (updates stored email)
248
+ */
249
+ email?: string;
250
+
251
+ /**
252
+ * Two-letter country code for login proxy region
253
+ */
254
+ proxy_country?: string;
255
+
201
256
  /**
202
257
  * TOTP secret for 2FA re-authentication
203
258
  */
@@ -6,7 +6,7 @@ import { APIPromise } from '../../core/api-promise';
6
6
  import { RequestOptions } from '../../internal/request-options';
7
7
 
8
8
  /**
9
- * X data lookups (subscription required)
9
+ * Look up, search, and analyze individual tweets
10
10
  */
11
11
  export class Bookmarks extends APIResource {
12
12
  /**
@@ -50,7 +50,7 @@ export class Communities extends APIResource {
50
50
  }
51
51
 
52
52
  /**
53
- * Get community details
53
+ * Get community name, description and member count
54
54
  *
55
55
  * @example
56
56
  * ```ts
@@ -64,7 +64,7 @@ export class Communities extends APIResource {
64
64
  }
65
65
 
66
66
  /**
67
- * Get community members
67
+ * List members of a community
68
68
  *
69
69
  * @example
70
70
  * ```ts
@@ -81,7 +81,7 @@ export class Communities extends APIResource {
81
81
  }
82
82
 
83
83
  /**
84
- * Get community moderators
84
+ * List moderators of a community
85
85
  *
86
86
  * @example
87
87
  * ```ts
@@ -98,7 +98,7 @@ export class Communities extends APIResource {
98
98
  }
99
99
 
100
100
  /**
101
- * Search tweets across communities
101
+ * Search for communities by keyword
102
102
  *
103
103
  * @example
104
104
  * ```ts
@@ -7,11 +7,11 @@ import { RequestOptions } from '../../../internal/request-options';
7
7
  import { path } from '../../../internal/utils/path';
8
8
 
9
9
  /**
10
- * X data lookups (subscription required)
10
+ * X Community info, members, and tweets
11
11
  */
12
12
  export class Tweets extends APIResource {
13
13
  /**
14
- * Search tweets across all communities
14
+ * List tweets across all communities
15
15
  *
16
16
  * @example
17
17
  * ```ts
@@ -24,7 +24,7 @@ export class Tweets extends APIResource {
24
24
  }
25
25
 
26
26
  /**
27
- * Get community tweets
27
+ * List tweets posted in a community
28
28
  *
29
29
  * @example
30
30
  * ```ts
@@ -5,11 +5,11 @@ import { APIPromise } from '../../core/api-promise';
5
5
  import { RequestOptions } from '../../internal/request-options';
6
6
 
7
7
  /**
8
- * X data lookups (subscription required)
8
+ * Look up, search, and explore user profiles and relationships
9
9
  */
10
10
  export class Followers extends APIResource {
11
11
  /**
12
- * Check follow relationship
12
+ * Check if one user follows another
13
13
  *
14
14
  * @example
15
15
  * ```ts
@@ -57,7 +57,6 @@ export {
57
57
  } from './profile';
58
58
  export {
59
59
  Tweets,
60
- type SearchTweet,
61
60
  type TweetAuthor,
62
61
  type TweetDetail,
63
62
  type TweetCreateResponse,
@@ -75,7 +74,6 @@ export {
75
74
  } from './tweets/index';
76
75
  export {
77
76
  Users,
78
- type UserProfile,
79
77
  type UserRetrieveBatchParams,
80
78
  type UserRetrieveFollowersParams,
81
79
  type UserRetrieveFollowersYouKnowParams,
@@ -94,4 +92,5 @@ export {
94
92
  type XGetTrendsResponse,
95
93
  type XGetHomeTimelineParams,
96
94
  type XGetNotificationsParams,
95
+ type XGetTrendsParams,
97
96
  } from './x';
@@ -7,11 +7,11 @@ import { RequestOptions } from '../../internal/request-options';
7
7
  import { path } from '../../internal/utils/path';
8
8
 
9
9
  /**
10
- * X data lookups (subscription required)
10
+ * X List followers, members, and tweets
11
11
  */
12
12
  export class Lists extends APIResource {
13
13
  /**
14
- * Get list followers
14
+ * List followers of an X List
15
15
  *
16
16
  * @example
17
17
  * ```ts
@@ -28,7 +28,7 @@ export class Lists extends APIResource {
28
28
  }
29
29
 
30
30
  /**
31
- * Get list members
31
+ * List members of an X List
32
32
  *
33
33
  * @example
34
34
  * ```ts
@@ -46,7 +46,7 @@ export class Lists extends APIResource {
46
46
  }
47
47
 
48
48
  /**
49
- * Get list tweets
49
+ * List tweets from an X List
50
50
  *
51
51
  * @example
52
52
  * ```ts
@@ -7,11 +7,11 @@ import { RequestOptions } from '../../internal/request-options';
7
7
  import { multipartFormRequestOptions } from '../../internal/uploads';
8
8
 
9
9
  /**
10
- * Media upload & download
10
+ * Media upload and download
11
11
  */
12
12
  export class Media extends APIResource {
13
13
  /**
14
- * Download tweet media
14
+ * Download images and videos from tweets
15
15
  *
16
16
  * @example
17
17
  * ```ts
@@ -16,7 +16,6 @@ export {
16
16
  } from './retweet';
17
17
  export {
18
18
  Tweets,
19
- type SearchTweet,
20
19
  type TweetAuthor,
21
20
  type TweetDetail,
22
21
  type TweetCreateResponse,
@@ -36,7 +36,7 @@ export class Tweets extends APIResource {
36
36
  }
37
37
 
38
38
  /**
39
- * Look up tweet
39
+ * Get tweet with full text, author, metrics and media
40
40
  *
41
41
  * @example
42
42
  * ```ts
@@ -76,7 +76,7 @@ export class Tweets extends APIResource {
76
76
  }
77
77
 
78
78
  /**
79
- * Get users who liked a tweet
79
+ * List users who liked a tweet
80
80
  *
81
81
  * @example
82
82
  * ```ts
@@ -94,7 +94,7 @@ export class Tweets extends APIResource {
94
94
  }
95
95
 
96
96
  /**
97
- * Get quote tweets of a tweet
97
+ * List quote tweets of a tweet
98
98
  *
99
99
  * @example
100
100
  * ```ts
@@ -112,7 +112,7 @@ export class Tweets extends APIResource {
112
112
  }
113
113
 
114
114
  /**
115
- * Get replies to a tweet
115
+ * List replies to a tweet
116
116
  *
117
117
  * @example
118
118
  * ```ts
@@ -130,7 +130,7 @@ export class Tweets extends APIResource {
130
130
  }
131
131
 
132
132
  /**
133
- * Get users who retweeted a tweet
133
+ * List users who retweeted a tweet
134
134
  *
135
135
  * @example
136
136
  * ```ts
@@ -148,7 +148,7 @@ export class Tweets extends APIResource {
148
148
  }
149
149
 
150
150
  /**
151
- * Get thread context for a tweet
151
+ * Get full conversation thread for a tweet
152
152
  *
153
153
  * @example
154
154
  * ```ts
@@ -166,7 +166,7 @@ export class Tweets extends APIResource {
166
166
  }
167
167
 
168
168
  /**
169
- * Search tweets
169
+ * Search tweets with X query operators and pagination
170
170
  *
171
171
  * @example
172
172
  * ```ts
@@ -180,48 +180,6 @@ export class Tweets extends APIResource {
180
180
  }
181
181
  }
182
182
 
183
- /**
184
- * Tweet returned from search results with inline author info.
185
- */
186
- export interface SearchTweet {
187
- id: string;
188
-
189
- text: string;
190
-
191
- author?: SearchTweet.Author;
192
-
193
- bookmarkCount?: number;
194
-
195
- createdAt?: string;
196
-
197
- /**
198
- * True for Note Tweets (long-form content, up to 25,000 characters)
199
- */
200
- isNoteTweet?: boolean;
201
-
202
- likeCount?: number;
203
-
204
- quoteCount?: number;
205
-
206
- replyCount?: number;
207
-
208
- retweetCount?: number;
209
-
210
- viewCount?: number;
211
- }
212
-
213
- export namespace SearchTweet {
214
- export interface Author {
215
- id: string;
216
-
217
- name: string;
218
-
219
- username: string;
220
-
221
- verified?: boolean;
222
- }
223
- }
224
-
225
183
  /**
226
184
  * Author of a tweet with follower count and verification status.
227
185
  */
@@ -338,17 +296,28 @@ export interface TweetCreateParams {
338
296
  */
339
297
  account: string;
340
298
 
341
- text: string;
342
-
343
299
  attachment_url?: string;
344
300
 
345
301
  community_id?: string;
346
302
 
347
303
  is_note_tweet?: boolean;
348
304
 
305
+ /**
306
+ * Array of media URLs to attach (mutually exclusive with media_ids)
307
+ */
308
+ media?: Array<string>;
309
+
310
+ /**
311
+ * Array of media IDs to attach (mutually exclusive with media)
312
+ */
349
313
  media_ids?: Array<string>;
350
314
 
351
315
  reply_to_tweet_id?: string;
316
+
317
+ /**
318
+ * Tweet text (optional when media is provided)
319
+ */
320
+ text?: string;
352
321
  }
353
322
 
354
323
  export interface TweetListParams {
@@ -462,7 +431,6 @@ Tweets.Retweet = Retweet;
462
431
 
463
432
  export declare namespace Tweets {
464
433
  export {
465
- type SearchTweet as SearchTweet,
466
434
  type TweetAuthor as TweetAuthor,
467
435
  type TweetDetail as TweetDetail,
468
436
  type TweetCreateResponse as TweetCreateResponse,
@@ -9,7 +9,6 @@ export {
9
9
  } from './follow';
10
10
  export {
11
11
  Users,
12
- type UserProfile,
13
12
  type UserRetrieveBatchParams,
14
13
  type UserRetrieveFollowersParams,
15
14
  type UserRetrieveFollowersYouKnowParams,
@@ -15,25 +15,25 @@ import { RequestOptions } from '../../../internal/request-options';
15
15
  import { path } from '../../../internal/utils/path';
16
16
 
17
17
  /**
18
- * X data lookups (subscription required)
18
+ * Look up, search, and explore user profiles and relationships
19
19
  */
20
20
  export class Users extends APIResource {
21
21
  follow: FollowAPI.Follow = new FollowAPI.Follow(this._client);
22
22
 
23
23
  /**
24
- * Look up X user
24
+ * Get user profile with follower counts and verification
25
25
  *
26
26
  * @example
27
27
  * ```ts
28
28
  * const userProfile = await client.x.users.retrieve('id');
29
29
  * ```
30
30
  */
31
- retrieve(id: string, options?: RequestOptions): APIPromise<UserProfile> {
31
+ retrieve(id: string, options?: RequestOptions): APIPromise<Shared.UserProfile> {
32
32
  return this._client.get(path`/x/users/${id}`, options);
33
33
  }
34
34
 
35
35
  /**
36
- * Get multiple users by IDs
36
+ * Look up multiple users by IDs in one call
37
37
  *
38
38
  * @example
39
39
  * ```ts
@@ -47,7 +47,7 @@ export class Users extends APIResource {
47
47
  }
48
48
 
49
49
  /**
50
- * Get user followers
50
+ * List followers of a user
51
51
  *
52
52
  * @example
53
53
  * ```ts
@@ -64,7 +64,7 @@ export class Users extends APIResource {
64
64
  }
65
65
 
66
66
  /**
67
- * Get followers you know for a user
67
+ * List mutual followers between you and a user
68
68
  *
69
69
  * @example
70
70
  * ```ts
@@ -81,7 +81,7 @@ export class Users extends APIResource {
81
81
  }
82
82
 
83
83
  /**
84
- * Get users this user follows
84
+ * List accounts a user follows
85
85
  *
86
86
  * @example
87
87
  * ```ts
@@ -98,7 +98,7 @@ export class Users extends APIResource {
98
98
  }
99
99
 
100
100
  /**
101
- * Get tweets liked by a user
101
+ * List tweets liked by a user
102
102
  *
103
103
  * @example
104
104
  * ```ts
@@ -116,7 +116,7 @@ export class Users extends APIResource {
116
116
  }
117
117
 
118
118
  /**
119
- * Get media tweets by a user
119
+ * List media tweets posted by a user
120
120
  *
121
121
  * @example
122
122
  * ```ts
@@ -134,7 +134,7 @@ export class Users extends APIResource {
134
134
  }
135
135
 
136
136
  /**
137
- * Get tweets mentioning a user
137
+ * List tweets mentioning a user
138
138
  *
139
139
  * @example
140
140
  * ```ts
@@ -168,7 +168,7 @@ export class Users extends APIResource {
168
168
  }
169
169
 
170
170
  /**
171
- * Get recent tweets by a user
171
+ * List recent tweets posted by a user
172
172
  *
173
173
  * @example
174
174
  * ```ts
@@ -186,7 +186,7 @@ export class Users extends APIResource {
186
186
  }
187
187
 
188
188
  /**
189
- * Get verified followers
189
+ * List verified followers of a user
190
190
  *
191
191
  * @example
192
192
  * ```ts
@@ -203,33 +203,6 @@ export class Users extends APIResource {
203
203
  }
204
204
  }
205
205
 
206
- /**
207
- * X user profile with bio, follower counts, and verification status.
208
- */
209
- export interface UserProfile {
210
- id: string;
211
-
212
- name: string;
213
-
214
- username: string;
215
-
216
- createdAt?: string;
217
-
218
- description?: string;
219
-
220
- followers?: number;
221
-
222
- following?: number;
223
-
224
- location?: string;
225
-
226
- profilePicture?: string;
227
-
228
- statusesCount?: number;
229
-
230
- verified?: boolean;
231
- }
232
-
233
206
  export interface UserRetrieveBatchParams {
234
207
  /**
235
208
  * Comma-separated user IDs (max 100)
@@ -339,7 +312,6 @@ Users.Follow = Follow;
339
312
 
340
313
  export declare namespace Users {
341
314
  export {
342
- type UserProfile as UserProfile,
343
315
  type UserRetrieveBatchParams as UserRetrieveBatchParams,
344
316
  type UserRetrieveFollowersParams as UserRetrieveFollowersParams,
345
317
  type UserRetrieveFollowersYouKnowParams as UserRetrieveFollowersYouKnowParams,