x-twitter-scraper 0.6.1 → 0.7.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 (53) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/package.json +1 -1
  3. package/resources/compose.d.mts +23 -4
  4. package/resources/compose.d.mts.map +1 -1
  5. package/resources/compose.d.ts +23 -4
  6. package/resources/compose.d.ts.map +1 -1
  7. package/resources/compose.js +4 -4
  8. package/resources/compose.mjs +4 -4
  9. package/resources/radar.d.mts +72 -5
  10. package/resources/radar.d.mts.map +1 -1
  11. package/resources/radar.d.ts +72 -5
  12. package/resources/radar.d.ts.map +1 -1
  13. package/resources/x/account-connection-attempts.d.mts +70 -0
  14. package/resources/x/account-connection-attempts.d.mts.map +1 -0
  15. package/resources/x/account-connection-attempts.d.ts +70 -0
  16. package/resources/x/account-connection-attempts.d.ts.map +1 -0
  17. package/resources/x/account-connection-attempts.js +27 -0
  18. package/resources/x/account-connection-attempts.js.map +1 -0
  19. package/resources/x/account-connection-attempts.mjs +23 -0
  20. package/resources/x/account-connection-attempts.mjs.map +1 -0
  21. package/resources/x/accounts.d.mts +12 -22
  22. package/resources/x/accounts.d.mts.map +1 -1
  23. package/resources/x/accounts.d.ts +12 -22
  24. package/resources/x/accounts.d.ts.map +1 -1
  25. package/resources/x/accounts.js +1 -1
  26. package/resources/x/accounts.mjs +1 -1
  27. package/resources/x/index.d.mts +1 -0
  28. package/resources/x/index.d.mts.map +1 -1
  29. package/resources/x/index.d.ts +1 -0
  30. package/resources/x/index.d.ts.map +1 -1
  31. package/resources/x/index.js +3 -1
  32. package/resources/x/index.js.map +1 -1
  33. package/resources/x/index.mjs +1 -0
  34. package/resources/x/index.mjs.map +1 -1
  35. package/resources/x/x.d.mts +4 -0
  36. package/resources/x/x.d.mts.map +1 -1
  37. package/resources/x/x.d.ts +4 -0
  38. package/resources/x/x.d.ts.map +1 -1
  39. package/resources/x/x.js +4 -0
  40. package/resources/x/x.js.map +1 -1
  41. package/resources/x/x.mjs +4 -0
  42. package/resources/x/x.mjs.map +1 -1
  43. package/src/resources/compose.ts +28 -4
  44. package/src/resources/radar.ts +83 -3
  45. package/src/resources/x/account-connection-attempts.ts +100 -0
  46. package/src/resources/x/accounts.ts +12 -27
  47. package/src/resources/x/index.ts +4 -0
  48. package/src/resources/x/x.ts +13 -0
  49. package/src/version.ts +1 -1
  50. package/version.d.mts +1 -1
  51. package/version.d.ts +1 -1
  52. package/version.js +1 -1
  53. package/version.mjs +1 -1
@@ -37,12 +37,26 @@ export interface RadarItem {
37
37
 
38
38
  createdAt: string;
39
39
 
40
+ /**
41
+ * BCP-47 language code. und means the source did not identify a language.
42
+ */
40
43
  language: string;
41
44
 
42
45
  /**
43
46
  * Source-specific fields. Shape varies per source:
44
47
  *
45
- * - reddit: { subreddit: string, author: string }
48
+ * - reddit: { author, authorId?, subreddit, subredditId?, subredditSubscribers?,
49
+ * sourceFormat, score?, upvoteRatio?, estimatedUpvotes?, estimatedDownvotes?,
50
+ * numberComments?, numberCrossposts?, selftext?, contentUrl?, domain?,
51
+ * postHint?, linkFlairText?, distinguished?, totalAwardsReceived?, viewCount?,
52
+ * editedAt?, galleryImageUrls?, redditVideo?, archived?, contestMode?,
53
+ * isCrosspostable?, isMeta?, isNsfw?, isOriginalContent?, isRobotIndexable?,
54
+ * isSelf?, isSpoiler?, isVideo?, locked?, stickied? }. `score` is Reddit's
55
+ * public net score. Exact public upvote and downvote counts are not available.
56
+ * Estimated counts derive from the public score and upvote ratio, which Reddit
57
+ * may fuzz. Comment bodies are not included. Current items combine public
58
+ * listing discovery with server-rendered post data and use `sourceFormat: html`;
59
+ * `json` and `rss` remain for legacy rows.
46
60
  * - github: { starsToday: number }
47
61
  * - hacker_news: { points: number, numberComments: number }
48
62
  * - google_trends: { approxTraffic: number }
@@ -50,9 +64,14 @@ export interface RadarItem {
50
64
  * - wikipedia: { views: number }
51
65
  * - trustmrr: { mrr, growthPercent, last30Days, total, customers,
52
66
  * activeSubscriptions, onSale, xHandle?, category?, askingPrice?, country?,
53
- * growthMrrPercent?, multiple?, paymentProvider?, rank? }
67
+ * foundedDate?, googleSearchImpressionsLast30Days?, growthMrrPercent?,
68
+ * multiple?, paymentProvider?, profitMarginLast30Days?, rank?,
69
+ * revenuePerVisitor?, targetAudience?, visitorsLast30Days? } For the startup
70
+ * growth source, xHandle is the founder's X username without @. The rank field
71
+ * is the source's revenue rank. Result order represents reported 30-day
72
+ * revenue-growth rank.
54
73
  */
55
- metadata: { [key: string]: unknown };
74
+ metadata: RadarItem.Metadata;
56
75
 
57
76
  publishedAt: string;
58
77
 
@@ -71,11 +90,72 @@ export interface RadarItem {
71
90
 
72
91
  description?: string;
73
92
 
93
+ /**
94
+ * Source image. Startup growth items return the logo here.
95
+ */
74
96
  imageUrl?: string;
75
97
 
76
98
  url?: string;
77
99
  }
78
100
 
101
+ export namespace RadarItem {
102
+ /**
103
+ * Source-specific fields. Shape varies per source:
104
+ *
105
+ * - reddit: { author, authorId?, subreddit, subredditId?, subredditSubscribers?,
106
+ * sourceFormat, score?, upvoteRatio?, estimatedUpvotes?, estimatedDownvotes?,
107
+ * numberComments?, numberCrossposts?, selftext?, contentUrl?, domain?,
108
+ * postHint?, linkFlairText?, distinguished?, totalAwardsReceived?, viewCount?,
109
+ * editedAt?, galleryImageUrls?, redditVideo?, archived?, contestMode?,
110
+ * isCrosspostable?, isMeta?, isNsfw?, isOriginalContent?, isRobotIndexable?,
111
+ * isSelf?, isSpoiler?, isVideo?, locked?, stickied? }. `score` is Reddit's
112
+ * public net score. Exact public upvote and downvote counts are not available.
113
+ * Estimated counts derive from the public score and upvote ratio, which Reddit
114
+ * may fuzz. Comment bodies are not included. Current items combine public
115
+ * listing discovery with server-rendered post data and use `sourceFormat: html`;
116
+ * `json` and `rss` remain for legacy rows.
117
+ * - github: { starsToday: number }
118
+ * - hacker_news: { points: number, numberComments: number }
119
+ * - google_trends: { approxTraffic: number }
120
+ * - polymarket: { volume24hr: number }
121
+ * - wikipedia: { views: number }
122
+ * - trustmrr: { mrr, growthPercent, last30Days, total, customers,
123
+ * activeSubscriptions, onSale, xHandle?, category?, askingPrice?, country?,
124
+ * foundedDate?, googleSearchImpressionsLast30Days?, growthMrrPercent?,
125
+ * multiple?, paymentProvider?, profitMarginLast30Days?, rank?,
126
+ * revenuePerVisitor?, targetAudience?, visitorsLast30Days? } For the startup
127
+ * growth source, xHandle is the founder's X username without @. The rank field
128
+ * is the source's revenue rank. Result order represents reported 30-day
129
+ * revenue-growth rank.
130
+ */
131
+ export interface Metadata {
132
+ author?: string;
133
+
134
+ contentUrl?: string;
135
+
136
+ estimatedDownvotes?: number;
137
+
138
+ estimatedUpvotes?: number;
139
+
140
+ numberComments?: number;
141
+
142
+ score?: number;
143
+
144
+ selftext?: string;
145
+
146
+ /**
147
+ * Current items use html. json and rss are retained for legacy rows.
148
+ */
149
+ sourceFormat?: 'html' | 'json' | 'rss';
150
+
151
+ subreddit?: string;
152
+
153
+ upvoteRatio?: number;
154
+
155
+ [k: string]: unknown;
156
+ }
157
+ }
158
+
79
159
  export interface RadarRetrieveTrendingTopicsResponse {
80
160
  hasMore: boolean;
81
161
 
@@ -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
+ }
@@ -21,12 +21,12 @@ 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
  */
29
- create(body: AccountCreateParams, options?: RequestOptions): APIPromise<AccountCreateResponse> {
29
+ create(body: AccountCreateParams, options?: RequestOptions): APIPromise<unknown> {
30
30
  return this._client.post('/x/accounts', { body, ...options });
31
31
  }
32
32
 
@@ -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
 
@@ -147,22 +147,7 @@ export interface XAccountDetail {
147
147
  updatedAt?: string;
148
148
  }
149
149
 
150
- /**
151
- * Sanitized X account summary returned by connect and reauth.
152
- */
153
- export interface AccountCreateResponse {
154
- id: string;
155
-
156
- createdAt: string;
157
-
158
- health: 'healthy' | 'locked' | 'needsReauth' | 'recovering' | 'suspended' | 'temporaryIssue';
159
-
160
- status: string;
161
-
162
- xUserId: string;
163
-
164
- xUsername: string;
165
- }
150
+ export type AccountCreateResponse = unknown;
166
151
 
167
152
  export interface AccountListResponse {
168
153
  accounts: Array<XAccount>;
@@ -208,14 +193,14 @@ export interface AccountCreateParams {
208
193
  password: string;
209
194
 
210
195
  /**
211
- * X username
196
+ * Authenticator App TOTP secret required for durable login
212
197
  */
213
- username: string;
198
+ totp_secret: string;
214
199
 
215
200
  /**
216
- * TOTP secret for 2FA
201
+ * X username
217
202
  */
218
- totp_secret?: string;
203
+ username: string;
219
204
  }
220
205
 
221
206
  export interface AccountReauthParams {
@@ -230,7 +215,7 @@ export interface AccountReauthParams {
230
215
  email?: string;
231
216
 
232
217
  /**
233
- * TOTP secret for 2FA re-authentication
218
+ * Replacement Authenticator App TOTP secret. Omit it to reuse the saved secret.
234
219
  */
235
220
  totp_secret?: string;
236
221
  }
@@ -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,
@@ -6,6 +6,11 @@
6
6
 
7
7
  import { APIResource } from '../../core/resource';
8
8
  import * as Shared from '../shared';
9
+ import * as AccountConnectionAttemptsAPI from './account-connection-attempts';
10
+ import {
11
+ AccountConnectionAttemptRetrieveResponse,
12
+ AccountConnectionAttempts,
13
+ } from './account-connection-attempts';
9
14
  import * as AccountConnectionChallengesAPI from './account-connection-challenges';
10
15
  import {
11
16
  AccountConnectionChallengeSubmitParams,
@@ -122,6 +127,8 @@ export class X extends APIResource {
122
127
  accounts: AccountsAPI.Accounts = new AccountsAPI.Accounts(this._client);
123
128
  accountConnectionChallenges: AccountConnectionChallengesAPI.AccountConnectionChallenges =
124
129
  new AccountConnectionChallengesAPI.AccountConnectionChallenges(this._client);
130
+ accountConnectionAttempts: AccountConnectionAttemptsAPI.AccountConnectionAttempts =
131
+ new AccountConnectionAttemptsAPI.AccountConnectionAttempts(this._client);
125
132
  bookmarks: BookmarksAPI.Bookmarks = new BookmarksAPI.Bookmarks(this._client);
126
133
  lists: ListsAPI.Lists = new ListsAPI.Lists(this._client);
127
134
 
@@ -391,6 +398,7 @@ X.Profile = Profile;
391
398
  X.Communities = Communities;
392
399
  X.Accounts = Accounts;
393
400
  X.AccountConnectionChallenges = AccountConnectionChallenges;
401
+ X.AccountConnectionAttempts = AccountConnectionAttempts;
394
402
  X.Bookmarks = Bookmarks;
395
403
  X.Lists = Lists;
396
404
 
@@ -505,6 +513,11 @@ export declare namespace X {
505
513
  type AccountConnectionChallengeSubmitParams as AccountConnectionChallengeSubmitParams,
506
514
  };
507
515
 
516
+ export {
517
+ AccountConnectionAttempts as AccountConnectionAttempts,
518
+ type AccountConnectionAttemptRetrieveResponse as AccountConnectionAttemptRetrieveResponse,
519
+ };
520
+
508
521
  export {
509
522
  Bookmarks as Bookmarks,
510
523
  type BookmarkRetrieveFoldersResponse as BookmarkRetrieveFoldersResponse,
package/src/version.ts CHANGED
@@ -2,4 +2,4 @@
2
2
  //
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
 
5
- export const VERSION = '0.6.1'; // x-release-please-version
5
+ export const VERSION = '0.7.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.6.1";
1
+ export declare const VERSION = "0.7.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.6.1";
1
+ export declare const VERSION = "0.7.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -4,5 +4,5 @@
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.VERSION = void 0;
7
- exports.VERSION = '0.6.1'; // x-release-please-version
7
+ exports.VERSION = '0.7.0'; // x-release-please-version
8
8
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // SPDX-FileCopyrightText: 2026 Xquik contributors
2
2
  //
3
3
  // SPDX-License-Identifier: Apache-2.0
4
- export const VERSION = '0.6.1'; // x-release-please-version
4
+ export const VERSION = '0.7.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.mjs.map