x-twitter-scraper 0.2.1 → 0.3.1

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 (201) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +51 -3
  3. package/client.d.mts +14 -27
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +14 -27
  6. package/client.d.ts.map +1 -1
  7. package/client.js +12 -27
  8. package/client.js.map +1 -1
  9. package/client.mjs +12 -27
  10. package/client.mjs.map +1 -1
  11. package/internal/request-options.d.mts +0 -4
  12. package/internal/request-options.d.mts.map +1 -1
  13. package/internal/request-options.d.ts +0 -4
  14. package/internal/request-options.d.ts.map +1 -1
  15. package/internal/request-options.js.map +1 -1
  16. package/internal/request-options.mjs.map +1 -1
  17. package/internal/utils/env.js +2 -2
  18. package/internal/utils/env.js.map +1 -1
  19. package/internal/utils/env.mjs +2 -2
  20. package/internal/utils/env.mjs.map +1 -1
  21. package/package.json +31 -10
  22. package/resources/account.d.mts +7 -6
  23. package/resources/account.d.mts.map +1 -1
  24. package/resources/account.d.ts +7 -6
  25. package/resources/account.d.ts.map +1 -1
  26. package/resources/account.js +3 -3
  27. package/resources/account.js.map +1 -1
  28. package/resources/account.mjs +3 -3
  29. package/resources/account.mjs.map +1 -1
  30. package/resources/api-keys.js +3 -3
  31. package/resources/api-keys.js.map +1 -1
  32. package/resources/api-keys.mjs +3 -3
  33. package/resources/api-keys.mjs.map +1 -1
  34. package/resources/compose.d.mts +1 -1
  35. package/resources/compose.d.ts +1 -1
  36. package/resources/compose.js +1 -1
  37. package/resources/compose.mjs +1 -1
  38. package/resources/credits.d.mts +1 -1
  39. package/resources/credits.d.ts +1 -1
  40. package/resources/credits.js +1 -1
  41. package/resources/credits.mjs +1 -1
  42. package/resources/drafts.d.mts +1 -1
  43. package/resources/drafts.d.ts +1 -1
  44. package/resources/drafts.js +1 -1
  45. package/resources/drafts.mjs +1 -1
  46. package/resources/events.js +1 -1
  47. package/resources/events.js.map +1 -1
  48. package/resources/events.mjs +1 -1
  49. package/resources/events.mjs.map +1 -1
  50. package/resources/extractions.d.mts +3 -2
  51. package/resources/extractions.d.mts.map +1 -1
  52. package/resources/extractions.d.ts +3 -2
  53. package/resources/extractions.d.ts.map +1 -1
  54. package/resources/index.d.mts +1 -3
  55. package/resources/index.d.mts.map +1 -1
  56. package/resources/index.d.ts +1 -3
  57. package/resources/index.d.ts.map +1 -1
  58. package/resources/index.js +1 -5
  59. package/resources/index.js.map +1 -1
  60. package/resources/index.mjs +0 -2
  61. package/resources/index.mjs.map +1 -1
  62. package/resources/monitors.d.mts +1 -1
  63. package/resources/monitors.d.ts +1 -1
  64. package/resources/monitors.js +1 -1
  65. package/resources/monitors.mjs +1 -1
  66. package/resources/radar.d.mts +45 -10
  67. package/resources/radar.d.mts.map +1 -1
  68. package/resources/radar.d.ts +45 -10
  69. package/resources/radar.d.ts.map +1 -1
  70. package/resources/radar.js +1 -1
  71. package/resources/radar.mjs +1 -1
  72. package/resources/shared.d.mts +47 -6
  73. package/resources/shared.d.mts.map +1 -1
  74. package/resources/shared.d.ts +47 -6
  75. package/resources/shared.d.ts.map +1 -1
  76. package/resources/styles.d.mts +1 -1
  77. package/resources/styles.d.ts +1 -1
  78. package/resources/styles.js +1 -1
  79. package/resources/styles.mjs +1 -1
  80. package/resources/subscribe.d.mts +1 -1
  81. package/resources/subscribe.d.ts +1 -1
  82. package/resources/subscribe.js +1 -1
  83. package/resources/subscribe.mjs +1 -1
  84. package/resources/trends.d.mts +2 -2
  85. package/resources/trends.d.ts +2 -2
  86. package/resources/trends.js +2 -2
  87. package/resources/trends.mjs +2 -2
  88. package/resources/webhooks.d.mts +2 -2
  89. package/resources/webhooks.d.ts +2 -2
  90. package/resources/webhooks.js +2 -2
  91. package/resources/webhooks.mjs +2 -2
  92. package/resources/x/accounts.d.mts +48 -0
  93. package/resources/x/accounts.d.mts.map +1 -1
  94. package/resources/x/accounts.d.ts +48 -0
  95. package/resources/x/accounts.d.ts.map +1 -1
  96. package/resources/x/accounts.js +6 -10
  97. package/resources/x/accounts.js.map +1 -1
  98. package/resources/x/accounts.mjs +6 -10
  99. package/resources/x/accounts.mjs.map +1 -1
  100. package/resources/x/bookmarks.d.mts +1 -1
  101. package/resources/x/bookmarks.d.ts +1 -1
  102. package/resources/x/bookmarks.js +1 -1
  103. package/resources/x/bookmarks.mjs +1 -1
  104. package/resources/x/communities/communities.d.mts +4 -4
  105. package/resources/x/communities/communities.d.ts +4 -4
  106. package/resources/x/communities/communities.js +4 -4
  107. package/resources/x/communities/communities.mjs +4 -4
  108. package/resources/x/communities/tweets.d.mts +3 -3
  109. package/resources/x/communities/tweets.d.ts +3 -3
  110. package/resources/x/communities/tweets.js +3 -3
  111. package/resources/x/communities/tweets.mjs +3 -3
  112. package/resources/x/followers.d.mts +2 -2
  113. package/resources/x/followers.d.ts +2 -2
  114. package/resources/x/followers.js +2 -2
  115. package/resources/x/followers.mjs +2 -2
  116. package/resources/x/index.d.mts +3 -3
  117. package/resources/x/index.d.mts.map +1 -1
  118. package/resources/x/index.d.ts +3 -3
  119. package/resources/x/index.d.ts.map +1 -1
  120. package/resources/x/index.js.map +1 -1
  121. package/resources/x/index.mjs.map +1 -1
  122. package/resources/x/lists.d.mts +4 -4
  123. package/resources/x/lists.d.ts +4 -4
  124. package/resources/x/lists.js +4 -4
  125. package/resources/x/lists.mjs +4 -4
  126. package/resources/x/media.d.mts +2 -2
  127. package/resources/x/media.d.ts +2 -2
  128. package/resources/x/media.js +2 -2
  129. package/resources/x/media.mjs +2 -2
  130. package/resources/x/tweets/index.d.mts +1 -1
  131. package/resources/x/tweets/index.d.mts.map +1 -1
  132. package/resources/x/tweets/index.d.ts +1 -1
  133. package/resources/x/tweets/index.d.ts.map +1 -1
  134. package/resources/x/tweets/index.js.map +1 -1
  135. package/resources/x/tweets/index.mjs.map +1 -1
  136. package/resources/x/tweets/tweets.d.mts +19 -36
  137. package/resources/x/tweets/tweets.d.mts.map +1 -1
  138. package/resources/x/tweets/tweets.d.ts +19 -36
  139. package/resources/x/tweets/tweets.d.ts.map +1 -1
  140. package/resources/x/tweets/tweets.js +7 -7
  141. package/resources/x/tweets/tweets.js.map +1 -1
  142. package/resources/x/tweets/tweets.mjs +7 -7
  143. package/resources/x/tweets/tweets.mjs.map +1 -1
  144. package/resources/x/users/index.d.mts +1 -1
  145. package/resources/x/users/index.d.mts.map +1 -1
  146. package/resources/x/users/index.d.ts +1 -1
  147. package/resources/x/users/index.d.ts.map +1 -1
  148. package/resources/x/users/index.js.map +1 -1
  149. package/resources/x/users/index.mjs.map +1 -1
  150. package/resources/x/users/users.d.mts +13 -29
  151. package/resources/x/users/users.d.mts.map +1 -1
  152. package/resources/x/users/users.d.ts +13 -29
  153. package/resources/x/users/users.d.ts.map +1 -1
  154. package/resources/x/users/users.js +11 -11
  155. package/resources/x/users/users.js.map +1 -1
  156. package/resources/x/users/users.mjs +11 -11
  157. package/resources/x/users/users.mjs.map +1 -1
  158. package/resources/x/x.d.mts +17 -10
  159. package/resources/x/x.d.mts.map +1 -1
  160. package/resources/x/x.d.ts +17 -10
  161. package/resources/x/x.d.ts.map +1 -1
  162. package/resources/x/x.js +3 -6
  163. package/resources/x/x.js.map +1 -1
  164. package/resources/x/x.mjs +3 -6
  165. package/resources/x/x.mjs.map +1 -1
  166. package/src/client.ts +16 -56
  167. package/src/internal/request-options.ts +0 -2
  168. package/src/internal/utils/env.ts +2 -2
  169. package/src/resources/account.ts +10 -8
  170. package/src/resources/api-keys.ts +3 -3
  171. package/src/resources/compose.ts +1 -1
  172. package/src/resources/credits.ts +1 -1
  173. package/src/resources/drafts.ts +1 -1
  174. package/src/resources/events.ts +1 -1
  175. package/src/resources/extractions.ts +5 -3
  176. package/src/resources/index.ts +1 -13
  177. package/src/resources/monitors.ts +1 -1
  178. package/src/resources/radar.ts +50 -10
  179. package/src/resources/shared.ts +74 -14
  180. package/src/resources/styles.ts +1 -1
  181. package/src/resources/subscribe.ts +1 -1
  182. package/src/resources/trends.ts +2 -2
  183. package/src/resources/webhooks.ts +2 -2
  184. package/src/resources/x/accounts.ts +65 -10
  185. package/src/resources/x/bookmarks.ts +1 -1
  186. package/src/resources/x/communities/communities.ts +4 -4
  187. package/src/resources/x/communities/tweets.ts +3 -3
  188. package/src/resources/x/followers.ts +2 -2
  189. package/src/resources/x/index.ts +1 -2
  190. package/src/resources/x/lists.ts +4 -4
  191. package/src/resources/x/media.ts +2 -2
  192. package/src/resources/x/tweets/index.ts +0 -1
  193. package/src/resources/x/tweets/tweets.ts +20 -52
  194. package/src/resources/x/users/index.ts +0 -1
  195. package/src/resources/x/users/users.ts +12 -40
  196. package/src/resources/x/x.ts +19 -10
  197. package/src/version.ts +1 -1
  198. package/version.d.mts +1 -1
  199. package/version.d.ts +1 -1
  200. package/version.js +1 -1
  201. package/version.mjs +1 -1
@@ -17,7 +17,6 @@ export {
17
17
  type AccountSetXUsernameParams,
18
18
  type AccountUpdateLocaleParams,
19
19
  } from './account';
20
- export { Bot } from './bot/bot';
21
20
  export { Compose, type ComposeCreateResponse, type ComposeCreateParams } from './compose';
22
21
  export {
23
22
  Credits,
@@ -59,18 +58,6 @@ export {
59
58
  type ExtractionExportResultsParams,
60
59
  type ExtractionRunParams,
61
60
  } from './extractions';
62
- export {
63
- Integrations,
64
- type Integration,
65
- type IntegrationDelivery,
66
- type IntegrationListResponse,
67
- type IntegrationDeleteResponse,
68
- type IntegrationListDeliveriesResponse,
69
- type IntegrationSendTestResponse,
70
- type IntegrationCreateParams,
71
- type IntegrationUpdateParams,
72
- type IntegrationListDeliveriesParams,
73
- } from './integrations';
74
61
  export {
75
62
  Monitors,
76
63
  type Monitor,
@@ -119,4 +106,5 @@ export {
119
106
  type XGetTrendsResponse,
120
107
  type XGetHomeTimelineParams,
121
108
  type XGetNotificationsParams,
109
+ type XGetTrendsParams,
122
110
  } from './x/x';
@@ -16,7 +16,7 @@ export class Monitors extends APIResource {
16
16
  * @example
17
17
  * ```ts
18
18
  * const monitor = await client.monitors.create({
19
- * eventTypes: ['tweet.new', 'follower.gained'],
19
+ * eventTypes: ['tweet.new', 'tweet.reply'],
20
20
  * username: 'elonmusk',
21
21
  * });
22
22
  * ```
@@ -5,7 +5,7 @@ import { APIPromise } from '../core/api-promise';
5
5
  import { RequestOptions } from '../internal/request-options';
6
6
 
7
7
  /**
8
- * Tweet composition, drafts, writing styles & radar
8
+ * AI tweet composition, drafts, writing styles, and radar
9
9
  */
10
10
  export class Radar extends APIResource {
11
11
  /**
@@ -20,10 +20,35 @@ export class Radar extends APIResource {
20
20
  }
21
21
 
22
22
  /**
23
- * Trending topic with score, category, source, and region.
23
+ * Trending topic with score, category, source, region, language, and
24
+ * source-specific metadata.
24
25
  */
25
26
  export interface RadarItem {
26
- category: string;
27
+ /**
28
+ * Internal numeric identifier (stringified bigint).
29
+ */
30
+ id: string;
31
+
32
+ category: 'general' | 'tech' | 'dev' | 'science' | 'culture' | 'politics' | 'business' | 'entertainment';
33
+
34
+ createdAt: string;
35
+
36
+ language: string;
37
+
38
+ /**
39
+ * Source-specific fields. Shape varies per source:
40
+ *
41
+ * - reddit: { subreddit: string, author: string }
42
+ * - github: { starsToday: number }
43
+ * - hacker_news: { points: number, numberComments: number }
44
+ * - google_trends: { approxTraffic: number }
45
+ * - polymarket: { volume24hr: number }
46
+ * - wikipedia: { views: number }
47
+ * - trustmrr: { mrr, growthPercent, last30Days, total, customers,
48
+ * activeSubscriptions, onSale, xHandle?, category?, askingPrice?, country?,
49
+ * growthMrrPercent?, multiple?, paymentProvider?, rank? }
50
+ */
51
+ metadata: { [key: string]: unknown };
27
52
 
28
53
  publishedAt: string;
29
54
 
@@ -31,7 +56,12 @@ export interface RadarItem {
31
56
 
32
57
  score: number;
33
58
 
34
- source: string;
59
+ source: 'github' | 'google_trends' | 'hacker_news' | 'polymarket' | 'reddit' | 'trustmrr' | 'wikipedia';
60
+
61
+ /**
62
+ * Source-specific identifier used for deduplication.
63
+ */
64
+ sourceId: string;
35
65
 
36
66
  title: string;
37
67
 
@@ -43,27 +73,37 @@ export interface RadarItem {
43
73
  }
44
74
 
45
75
  export interface RadarRetrieveTrendingTopicsResponse {
76
+ hasMore: boolean;
77
+
46
78
  items: Array<RadarItem>;
47
79
 
48
- total: number;
80
+ /**
81
+ * Opaque cursor for the next page (present only when hasMore is true).
82
+ */
83
+ nextCursor?: string;
49
84
  }
50
85
 
51
86
  export interface RadarRetrieveTrendingTopicsParams {
52
87
  /**
53
- * Filter by category (general, tech, dev, etc.)
88
+ * Cursor for pagination (from prior response nextCursor).
54
89
  */
55
- category?: string;
90
+ after?: string;
56
91
 
57
92
  /**
58
- * Number of items to return
93
+ * Filter by category.
59
94
  */
60
- count?: number;
95
+ category?: 'general' | 'tech' | 'dev' | 'science' | 'culture' | 'politics' | 'business' | 'entertainment';
61
96
 
62
97
  /**
63
- * Lookback window in hours
98
+ * Lookback window in hours (1-168, default 24).
64
99
  */
65
100
  hours?: number;
66
101
 
102
+ /**
103
+ * Number of items to return (1-100, default 50).
104
+ */
105
+ limit?: number;
106
+
67
107
  /**
68
108
  * Region filter (us, global, etc.)
69
109
  */
@@ -1,8 +1,5 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import * as TweetsAPI from './x/tweets/tweets';
4
- import * as UsersAPI from './x/users/users';
5
-
6
3
  /**
7
4
  * Error response containing a machine-readable error code.
8
5
  */
@@ -17,17 +14,17 @@ export interface Error {
17
14
  | 'invalid_tweet_id'
18
15
  | 'invalid_tweet_url'
19
16
  | 'invalid_username'
17
+ | 'insufficient_credits'
20
18
  | 'missing_params'
21
19
  | 'missing_query'
22
20
  | 'monitor_already_exists'
23
21
  | 'monitor_limit_reached'
22
+ | 'no_credits'
24
23
  | 'no_subscription'
25
24
  | 'not_found'
26
- | 'stream_registration_failed'
27
25
  | 'subscription_inactive'
28
26
  | 'tweet_not_found'
29
27
  | 'unauthenticated'
30
- | 'usage_limit_reached'
31
28
  | 'user_not_found'
32
29
  | 'webhook_inactive'
33
30
  | 'x_api_rate_limited'
@@ -38,13 +35,7 @@ export interface Error {
38
35
  /**
39
36
  * Type of monitor event fired when account activity occurs.
40
37
  */
41
- export type EventType =
42
- | 'tweet.new'
43
- | 'tweet.reply'
44
- | 'tweet.retweet'
45
- | 'tweet.quote'
46
- | 'follower.gained'
47
- | 'follower.lost';
38
+ export type EventType = 'tweet.new' | 'tweet.reply' | 'tweet.retweet' | 'tweet.quote';
48
39
 
49
40
  /**
50
41
  * Paginated list of tweets with cursor-based navigation.
@@ -54,7 +45,7 @@ export interface PaginatedTweets {
54
45
 
55
46
  next_cursor: string;
56
47
 
57
- tweets: Array<TweetsAPI.SearchTweet>;
48
+ tweets: Array<SearchTweet>;
58
49
  }
59
50
 
60
51
  /**
@@ -65,5 +56,74 @@ export interface PaginatedUsers {
65
56
 
66
57
  next_cursor: string;
67
58
 
68
- users: Array<UsersAPI.UserProfile>;
59
+ users: Array<UserProfile>;
60
+ }
61
+
62
+ /**
63
+ * Tweet returned from search results with inline author info.
64
+ */
65
+ export interface SearchTweet {
66
+ id: string;
67
+
68
+ text: string;
69
+
70
+ author?: SearchTweet.Author;
71
+
72
+ bookmarkCount?: number;
73
+
74
+ createdAt?: string;
75
+
76
+ /**
77
+ * True for Note Tweets (long-form content, up to 25,000 characters)
78
+ */
79
+ isNoteTweet?: boolean;
80
+
81
+ likeCount?: number;
82
+
83
+ quoteCount?: number;
84
+
85
+ replyCount?: number;
86
+
87
+ retweetCount?: number;
88
+
89
+ viewCount?: number;
90
+ }
91
+
92
+ export namespace SearchTweet {
93
+ export interface Author {
94
+ id: string;
95
+
96
+ name: string;
97
+
98
+ username: string;
99
+
100
+ verified?: boolean;
101
+ }
102
+ }
103
+
104
+ /**
105
+ * X user profile with bio, follower counts, and verification status.
106
+ */
107
+ export interface UserProfile {
108
+ id: string;
109
+
110
+ name: string;
111
+
112
+ username: string;
113
+
114
+ createdAt?: string;
115
+
116
+ description?: string;
117
+
118
+ followers?: number;
119
+
120
+ following?: number;
121
+
122
+ location?: string;
123
+
124
+ profilePicture?: string;
125
+
126
+ statusesCount?: number;
127
+
128
+ verified?: boolean;
69
129
  }
@@ -7,7 +7,7 @@ import { RequestOptions } from '../internal/request-options';
7
7
  import { path } from '../internal/utils/path';
8
8
 
9
9
  /**
10
- * Tweet composition, drafts, writing styles & radar
10
+ * AI tweet composition, drafts, writing styles, and radar
11
11
  */
12
12
  export class Styles extends APIResource {
13
13
  /**
@@ -5,7 +5,7 @@ import { APIPromise } from '../core/api-promise';
5
5
  import { RequestOptions } from '../internal/request-options';
6
6
 
7
7
  /**
8
- * Subscription & billing
8
+ * Subscription, billing, and credits
9
9
  */
10
10
  export class Subscribe extends APIResource {
11
11
  /**
@@ -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,