x-twitter-scraper 0.6.1 → 0.8.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 (121) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +6 -0
  3. package/package.json +1 -1
  4. package/resources/compose.d.mts +23 -4
  5. package/resources/compose.d.mts.map +1 -1
  6. package/resources/compose.d.ts +23 -4
  7. package/resources/compose.d.ts.map +1 -1
  8. package/resources/compose.js +4 -4
  9. package/resources/compose.mjs +4 -4
  10. package/resources/radar.d.mts +72 -5
  11. package/resources/radar.d.mts.map +1 -1
  12. package/resources/radar.d.ts +72 -5
  13. package/resources/radar.d.ts.map +1 -1
  14. package/resources/shared.d.mts +382 -15
  15. package/resources/shared.d.mts.map +1 -1
  16. package/resources/shared.d.ts +382 -15
  17. package/resources/shared.d.ts.map +1 -1
  18. package/resources/support/tickets.d.mts +19 -19
  19. package/resources/support/tickets.d.mts.map +1 -1
  20. package/resources/support/tickets.d.ts +19 -19
  21. package/resources/support/tickets.d.ts.map +1 -1
  22. package/resources/trends.d.mts +12 -0
  23. package/resources/trends.d.mts.map +1 -1
  24. package/resources/trends.d.ts +12 -0
  25. package/resources/trends.d.ts.map +1 -1
  26. package/resources/x/account-connection-attempts.d.mts +70 -0
  27. package/resources/x/account-connection-attempts.d.mts.map +1 -0
  28. package/resources/x/account-connection-attempts.d.ts +70 -0
  29. package/resources/x/account-connection-attempts.d.ts.map +1 -0
  30. package/resources/x/account-connection-attempts.js +27 -0
  31. package/resources/x/account-connection-attempts.js.map +1 -0
  32. package/resources/x/account-connection-attempts.mjs +23 -0
  33. package/resources/x/account-connection-attempts.mjs.map +1 -0
  34. package/resources/x/account-connection-challenges.d.mts +1 -1
  35. package/resources/x/account-connection-challenges.d.mts.map +1 -1
  36. package/resources/x/account-connection-challenges.d.ts +1 -1
  37. package/resources/x/account-connection-challenges.d.ts.map +1 -1
  38. package/resources/x/accounts.d.mts +45 -18
  39. package/resources/x/accounts.d.mts.map +1 -1
  40. package/resources/x/accounts.d.ts +45 -18
  41. package/resources/x/accounts.d.ts.map +1 -1
  42. package/resources/x/accounts.js +1 -1
  43. package/resources/x/accounts.mjs +1 -1
  44. package/resources/x/communities/communities.d.mts +2 -12
  45. package/resources/x/communities/communities.d.mts.map +1 -1
  46. package/resources/x/communities/communities.d.ts +2 -12
  47. package/resources/x/communities/communities.d.ts.map +1 -1
  48. package/resources/x/communities/communities.js.map +1 -1
  49. package/resources/x/communities/communities.mjs.map +1 -1
  50. package/resources/x/communities/tweets.d.mts +4 -8
  51. package/resources/x/communities/tweets.d.mts.map +1 -1
  52. package/resources/x/communities/tweets.d.ts +4 -8
  53. package/resources/x/communities/tweets.d.ts.map +1 -1
  54. package/resources/x/index.d.mts +2 -1
  55. package/resources/x/index.d.mts.map +1 -1
  56. package/resources/x/index.d.ts +2 -1
  57. package/resources/x/index.d.ts.map +1 -1
  58. package/resources/x/index.js +3 -1
  59. package/resources/x/index.js.map +1 -1
  60. package/resources/x/index.mjs +1 -0
  61. package/resources/x/index.mjs.map +1 -1
  62. package/resources/x/lists.d.mts +2 -4
  63. package/resources/x/lists.d.mts.map +1 -1
  64. package/resources/x/lists.d.ts +2 -4
  65. package/resources/x/lists.d.ts.map +1 -1
  66. package/resources/x/tweets/index.d.mts +1 -1
  67. package/resources/x/tweets/index.d.mts.map +1 -1
  68. package/resources/x/tweets/index.d.ts +1 -1
  69. package/resources/x/tweets/index.d.ts.map +1 -1
  70. package/resources/x/tweets/index.js.map +1 -1
  71. package/resources/x/tweets/index.mjs.map +1 -1
  72. package/resources/x/tweets/tweets.d.mts +301 -22
  73. package/resources/x/tweets/tweets.d.mts.map +1 -1
  74. package/resources/x/tweets/tweets.d.ts +301 -22
  75. package/resources/x/tweets/tweets.d.ts.map +1 -1
  76. package/resources/x/tweets/tweets.js +5 -8
  77. package/resources/x/tweets/tweets.js.map +1 -1
  78. package/resources/x/tweets/tweets.mjs +5 -8
  79. package/resources/x/tweets/tweets.mjs.map +1 -1
  80. package/resources/x/users/users.d.mts +10 -20
  81. package/resources/x/users/users.d.mts.map +1 -1
  82. package/resources/x/users/users.d.ts +10 -20
  83. package/resources/x/users/users.d.ts.map +1 -1
  84. package/resources/x/users/users.js.map +1 -1
  85. package/resources/x/users/users.mjs.map +1 -1
  86. package/resources/x/x.d.mts +18 -3
  87. package/resources/x/x.d.mts.map +1 -1
  88. package/resources/x/x.d.ts +18 -3
  89. package/resources/x/x.d.ts.map +1 -1
  90. package/resources/x/x.js +4 -0
  91. package/resources/x/x.js.map +1 -1
  92. package/resources/x/x.mjs +4 -0
  93. package/resources/x/x.mjs.map +1 -1
  94. package/skills/x-twitter-scraper/SKILL.md +8 -4
  95. package/skills/x-twitter-scraper/metadata.json +1 -1
  96. package/skills/x-twitter-scraper/references/mcp-setup.md +12 -5
  97. package/skills/x-twitter-scraper/references/mcp-tools.md +7 -1
  98. package/skills/x-twitter-scraper/references/types-x-api.md +62 -12
  99. package/skills/x-twitter-scraper/skill-card.md +2 -2
  100. package/skills/x-twitter-scraper/skillspector-report.md +4 -1
  101. package/src/resources/compose.ts +28 -4
  102. package/src/resources/radar.ts +83 -3
  103. package/src/resources/shared.ts +514 -16
  104. package/src/resources/support/tickets.ts +19 -19
  105. package/src/resources/trends.ts +15 -0
  106. package/src/resources/x/account-connection-attempts.ts +100 -0
  107. package/src/resources/x/account-connection-challenges.ts +1 -1
  108. package/src/resources/x/accounts.ts +59 -18
  109. package/src/resources/x/communities/communities.ts +2 -14
  110. package/src/resources/x/communities/tweets.ts +4 -8
  111. package/src/resources/x/index.ts +5 -0
  112. package/src/resources/x/lists.ts +2 -4
  113. package/src/resources/x/tweets/index.ts +1 -0
  114. package/src/resources/x/tweets/tweets.ts +393 -22
  115. package/src/resources/x/users/users.ts +10 -20
  116. package/src/resources/x/x.ts +30 -2
  117. package/src/version.ts +1 -1
  118. package/version.d.mts +1 -1
  119. package/version.d.ts +1 -1
  120. package/version.js +1 -1
  121. package/version.mjs +1 -1
@@ -133,28 +133,28 @@ export namespace TicketCreateResponse {
133
133
  }
134
134
 
135
135
  export interface TicketRetrieveResponse {
136
- createdAt?: string;
136
+ createdAt: string;
137
137
 
138
- messages?: Array<TicketRetrieveResponse.Message>;
138
+ messages: Array<TicketRetrieveResponse.Message>;
139
139
 
140
- publicId?: string;
140
+ publicId: string;
141
141
 
142
- status?: string;
142
+ status: 'open' | 'in_progress' | 'resolved' | 'closed';
143
143
 
144
- subject?: string;
144
+ subject: string;
145
145
 
146
- updatedAt?: string;
146
+ updatedAt: string;
147
147
  }
148
148
 
149
149
  export namespace TicketRetrieveResponse {
150
150
  export interface Message {
151
- attachments?: Array<Message.Attachment>;
151
+ attachments: Array<Message.Attachment>;
152
152
 
153
- body?: string;
153
+ body: string;
154
154
 
155
- createdAt?: string;
155
+ createdAt: string;
156
156
 
157
- sender?: string;
157
+ sender: 'user' | 'support' | 'system';
158
158
  }
159
159
 
160
160
  export namespace Message {
@@ -196,28 +196,28 @@ export namespace TicketRetrieveResponse {
196
196
  }
197
197
 
198
198
  export interface TicketUpdateResponse {
199
- publicId?: string;
199
+ publicId: string;
200
200
 
201
- status?: string;
201
+ status: 'open' | 'resolved' | 'closed';
202
202
  }
203
203
 
204
204
  export interface TicketListResponse {
205
- tickets?: Array<TicketListResponse.Ticket>;
205
+ tickets: Array<TicketListResponse.Ticket>;
206
206
  }
207
207
 
208
208
  export namespace TicketListResponse {
209
209
  export interface Ticket {
210
- createdAt?: string;
210
+ createdAt: string;
211
211
 
212
- messageCount?: number;
212
+ messageCount: number;
213
213
 
214
- publicId?: string;
214
+ publicId: string;
215
215
 
216
- status?: string;
216
+ status: 'open' | 'in_progress' | 'resolved' | 'closed';
217
217
 
218
- subject?: string;
218
+ subject: string;
219
219
 
220
- updatedAt?: string;
220
+ updatedAt: string;
221
221
  }
222
222
  }
223
223
 
@@ -37,9 +37,24 @@ export namespace TrendListResponse {
37
37
 
38
38
  description?: string;
39
39
 
40
+ /**
41
+ * Promotion identifier from X. Null for organic trends.
42
+ */
43
+ promotedContent?: string | null;
44
+
40
45
  query?: string;
41
46
 
42
47
  rank?: number;
48
+
49
+ /**
50
+ * Approximate public post volume when X supplies it.
51
+ */
52
+ tweetVolume?: number | null;
53
+
54
+ /**
55
+ * X search URL for the trend.
56
+ */
57
+ url?: string;
43
58
  }
44
59
  }
45
60
 
@@ -0,0 +1,100 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { RequestOptions } from '../../internal/request-options';
6
+ import { path } from '../../internal/utils/path';
7
+
8
+ /**
9
+ * Connected X account management
10
+ */
11
+ export class AccountConnectionAttempts extends APIResource {
12
+ /**
13
+ * Get X account connection status
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const accountConnectionAttempt =
18
+ * await client.x.accountConnectionAttempts.retrieve(
19
+ * 'xatt_0123456789abcdef0123456789abcdef',
20
+ * );
21
+ * ```
22
+ */
23
+ retrieve(id: string, options?: RequestOptions): APIPromise<AccountConnectionAttemptRetrieveResponse> {
24
+ return this._client.get(path`/x/account-connection-attempts/${id}`, options);
25
+ }
26
+ }
27
+
28
+ /**
29
+ * The connection is still in progress.
30
+ */
31
+ export type AccountConnectionAttemptRetrieveResponse =
32
+ | AccountConnectionAttemptRetrieveResponse.XAccountConnectionAttemptPending
33
+ | AccountConnectionAttemptRetrieveResponse.XAccountConnectionAttemptSuccess
34
+ | AccountConnectionAttemptRetrieveResponse.XAccountConnectionAttemptFailed
35
+ | AccountConnectionAttemptRetrieveResponse.XAccountConnectionChallenge;
36
+
37
+ export namespace AccountConnectionAttemptRetrieveResponse {
38
+ /**
39
+ * The connection is still in progress.
40
+ */
41
+ export interface XAccountConnectionAttemptPending {
42
+ id: string;
43
+
44
+ object: 'x_account_connection_attempt';
45
+
46
+ pollAfterMs: number;
47
+
48
+ status: 'pending';
49
+ }
50
+
51
+ /**
52
+ * The account connected successfully.
53
+ */
54
+ export interface XAccountConnectionAttemptSuccess {
55
+ id: string;
56
+
57
+ object: 'x_account_connection_attempt';
58
+
59
+ status: 'success';
60
+ }
61
+
62
+ /**
63
+ * The connection reached a final failure.
64
+ */
65
+ export interface XAccountConnectionAttemptFailed {
66
+ id: string;
67
+
68
+ error: string;
69
+
70
+ object: 'x_account_connection_attempt';
71
+
72
+ retryable: boolean;
73
+
74
+ status: 'failed';
75
+
76
+ reason?: string;
77
+ }
78
+
79
+ /**
80
+ * Resumable account connection challenge. Submit the email code to finish the same
81
+ * connection attempt.
82
+ */
83
+ export interface XAccountConnectionChallenge {
84
+ id: string;
85
+
86
+ expiresAt: string;
87
+
88
+ message: string;
89
+
90
+ object: 'x_account_connection_challenge';
91
+
92
+ status: 'requires_email_code';
93
+
94
+ username: string;
95
+ }
96
+ }
97
+
98
+ export declare namespace AccountConnectionAttempts {
99
+ export { type AccountConnectionAttemptRetrieveResponse as AccountConnectionAttemptRetrieveResponse };
100
+ }
@@ -43,7 +43,7 @@ export interface AccountConnectionChallengeSubmitResponse {
43
43
 
44
44
  health: 'healthy' | 'locked' | 'needsReauth' | 'recovering' | 'suspended' | 'temporaryIssue';
45
45
 
46
- status: string;
46
+ status: 'active';
47
47
 
48
48
  xUserId: string;
49
49
 
@@ -21,8 +21,8 @@ export class Accounts extends APIResource {
21
21
  * const account = await client.x.accounts.create({
22
22
  * email: 'account@example.invalid',
23
23
  * password: '<ACCOUNT_PASSWORD>',
24
- * username: 'your_x_username',
25
24
  * totp_secret: '<TOTP_SECRET>',
25
+ * username: 'your_x_username',
26
26
  * });
27
27
  * ```
28
28
  */
@@ -107,11 +107,11 @@ export interface XAccount {
107
107
  createdAt: string;
108
108
 
109
109
  /**
110
- * Derived connection health. `healthy` = session active. `needsReauth` = user must
110
+ * Derived connection health. `healthy` = ready to use. `needsReauth` = user must
111
111
  * submit fresh credentials. `locked` = X locked the account; unlock on x.com
112
- * first. `suspended` = X banned the account. `recovering` = past cooldown, will
113
- * auto-retry on next use. `temporaryIssue` = temporary connection problem; retry
114
- * shortly.
112
+ * first. `suspended` = X banned the account. `recovering` = cooldown ended; the
113
+ * account can reconnect on its next use. `temporaryIssue` = temporary connection
114
+ * problem; wait before the next use.
115
115
  */
116
116
  health: 'healthy' | 'locked' | 'needsReauth' | 'recovering' | 'suspended' | 'temporaryIssue';
117
117
 
@@ -150,18 +150,59 @@ export interface XAccountDetail {
150
150
  /**
151
151
  * Sanitized X account summary returned by connect and reauth.
152
152
  */
153
- export interface AccountCreateResponse {
154
- id: string;
153
+ export type AccountCreateResponse =
154
+ | AccountCreateResponse.SanitizedXAccount
155
+ | AccountCreateResponse.XAccountConnectionAttemptPending
156
+ | AccountCreateResponse.XAccountConnectionChallenge;
155
157
 
156
- createdAt: string;
158
+ export namespace AccountCreateResponse {
159
+ /**
160
+ * Sanitized X account summary returned by connect and reauth.
161
+ */
162
+ export interface SanitizedXAccount {
163
+ id: string;
157
164
 
158
- health: 'healthy' | 'locked' | 'needsReauth' | 'recovering' | 'suspended' | 'temporaryIssue';
165
+ createdAt: string;
159
166
 
160
- status: string;
167
+ health: 'healthy' | 'locked' | 'needsReauth' | 'recovering' | 'suspended' | 'temporaryIssue';
161
168
 
162
- xUserId: string;
169
+ status: 'active';
163
170
 
164
- xUsername: string;
171
+ xUserId: string;
172
+
173
+ xUsername: string;
174
+ }
175
+
176
+ /**
177
+ * The connection is still in progress.
178
+ */
179
+ export interface XAccountConnectionAttemptPending {
180
+ id: string;
181
+
182
+ object: 'x_account_connection_attempt';
183
+
184
+ pollAfterMs: number;
185
+
186
+ status: 'pending';
187
+ }
188
+
189
+ /**
190
+ * Resumable account connection challenge. Submit the email code to finish the same
191
+ * connection attempt.
192
+ */
193
+ export interface XAccountConnectionChallenge {
194
+ id: string;
195
+
196
+ expiresAt: string;
197
+
198
+ message: string;
199
+
200
+ object: 'x_account_connection_challenge';
201
+
202
+ status: 'requires_email_code';
203
+
204
+ username: string;
205
+ }
165
206
  }
166
207
 
167
208
  export interface AccountListResponse {
@@ -189,7 +230,7 @@ export interface AccountReauthResponse {
189
230
 
190
231
  health: 'healthy' | 'locked' | 'needsReauth' | 'recovering' | 'suspended' | 'temporaryIssue';
191
232
 
192
- status: string;
233
+ status: 'active';
193
234
 
194
235
  xUserId: string;
195
236
 
@@ -208,14 +249,14 @@ export interface AccountCreateParams {
208
249
  password: string;
209
250
 
210
251
  /**
211
- * X username
252
+ * Authenticator App TOTP secret required for durable login
212
253
  */
213
- username: string;
254
+ totp_secret: string;
214
255
 
215
256
  /**
216
- * TOTP secret for 2FA
257
+ * X username
217
258
  */
218
- totp_secret?: string;
259
+ username: string;
219
260
  }
220
261
 
221
262
  export interface AccountReauthParams {
@@ -230,7 +271,7 @@ export interface AccountReauthParams {
230
271
  email?: string;
231
272
 
232
273
  /**
233
- * TOTP secret for 2FA re-authentication
274
+ * Replacement Authenticator App TOTP secret. Omit it to reuse the saved secret.
234
275
  */
235
276
  totp_secret?: string;
236
277
  }
@@ -665,11 +665,6 @@ export namespace CommunityRetrieveInfoResponse {
665
665
  */
666
666
  invites_policy?: string;
667
667
 
668
- /**
669
- * Whether the authenticated viewer is a member
670
- */
671
- is_member?: boolean;
672
-
673
668
  /**
674
669
  * Whether the community is marked sensitive
675
670
  */
@@ -700,11 +695,6 @@ export namespace CommunityRetrieveInfoResponse {
700
695
  */
701
696
  primary_topic?: Community.PrimaryTopic;
702
697
 
703
- /**
704
- * Authenticated viewer's community role
705
- */
706
- role?: string;
707
-
708
698
  /**
709
699
  * Community rules
710
700
  */
@@ -824,10 +814,8 @@ export interface CommunityRetrieveSearchParams {
824
814
  cursor?: string;
825
815
 
826
816
  /**
827
- * Maximum items requested from this page (1-100, default 20). The response can
828
- * contain fewer items because the source returned fewer, filters removed items, or
829
- * the available usage balance covers fewer results. Keep requesting next_cursor while
830
- * has_next_page is true, even when a page is empty. The deprecated limit and count
817
+ * Maximum page items (1-100, default 20). Source, filters, or credits can reduce
818
+ * results. Continue while has_next_page is true. Deprecated limit and count
831
819
  * aliases remain accepted.
832
820
  */
833
821
  pageSize?: number;
@@ -65,10 +65,8 @@ export interface TweetListParams {
65
65
  cursor?: string;
66
66
 
67
67
  /**
68
- * Maximum items requested from this page (1-100, default 20). The response can
69
- * contain fewer items because the source returned fewer, filters removed items, or
70
- * the available usage balance covers fewer results. Keep requesting next_cursor while
71
- * has_next_page is true, even when a page is empty. The deprecated limit and count
68
+ * Maximum page items (1-100, default 20). Source, filters, or credits can reduce
69
+ * results. Continue while has_next_page is true. Deprecated limit and count
72
70
  * aliases remain accepted.
73
71
  */
74
72
  pageSize?: number;
@@ -86,10 +84,8 @@ export interface TweetListByCommunityParams {
86
84
  cursor?: string;
87
85
 
88
86
  /**
89
- * Maximum items requested from this page (1-100, default 20). The response can
90
- * contain fewer items because the source returned fewer, filters removed items, or
91
- * the available usage balance covers fewer results. Keep requesting next_cursor while
92
- * has_next_page is true, even when a page is empty. The deprecated limit and count
87
+ * Maximum page items (1-100, default 20). Source, filters, or credits can reduce
88
+ * results. Continue while has_next_page is true. Deprecated limit and count
93
89
  * aliases remain accepted.
94
90
  */
95
91
  pageSize?: number;
@@ -4,6 +4,10 @@
4
4
 
5
5
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
6
6
 
7
+ export {
8
+ AccountConnectionAttempts,
9
+ type AccountConnectionAttemptRetrieveResponse,
10
+ } from './account-connection-attempts';
7
11
  export {
8
12
  AccountConnectionChallenges,
9
13
  type AccountConnectionChallengeSubmitResponse,
@@ -70,6 +74,7 @@ export {
70
74
  type TweetCreateResponse,
71
75
  type TweetRetrieveResponse,
72
76
  type TweetDeleteResponse,
77
+ type TweetGetRepliesResponse,
73
78
  type TweetCreateParams,
74
79
  type TweetListParams,
75
80
  type TweetDeleteParams,
@@ -107,10 +107,8 @@ export interface ListRetrieveTweetsParams {
107
107
  includeReplies?: boolean;
108
108
 
109
109
  /**
110
- * Maximum items requested from this page (1-100, default 20). The response can
111
- * contain fewer items because the source returned fewer, filters removed items, or
112
- * the available usage balance covers fewer results. Keep requesting next_cursor while
113
- * has_next_page is true, even when a page is empty. The deprecated limit and count
110
+ * Maximum page items (1-100, default 20). Source, filters, or credits can reduce
111
+ * results. Continue while has_next_page is true. Deprecated limit and count
114
112
  * aliases remain accepted.
115
113
  */
116
114
  pageSize?: number;
@@ -25,6 +25,7 @@ export {
25
25
  type TweetCreateResponse,
26
26
  type TweetRetrieveResponse,
27
27
  type TweetDeleteResponse,
28
+ type TweetGetRepliesResponse,
28
29
  type TweetCreateParams,
29
30
  type TweetListParams,
30
31
  type TweetDeleteParams,