x-twitter-scraper 0.17.0 → 0.19.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.
- package/CHANGELOG.md +35 -0
- package/client.d.mts +7 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +7 -0
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +6 -0
- package/client.mjs.map +1 -1
- package/package.json +3 -3
- package/resources/account.d.mts +1 -1
- package/resources/account.d.mts.map +1 -1
- package/resources/account.d.ts +1 -1
- package/resources/account.d.ts.map +1 -1
- package/resources/activity.d.mts +214 -0
- package/resources/activity.d.mts.map +1 -0
- package/resources/activity.d.ts +214 -0
- package/resources/activity.d.ts.map +1 -0
- package/resources/activity.js +67 -0
- package/resources/activity.js.map +1 -0
- package/resources/activity.mjs +63 -0
- package/resources/activity.mjs.map +1 -0
- package/resources/credits.d.mts +24 -0
- package/resources/credits.d.mts.map +1 -1
- package/resources/credits.d.ts +24 -0
- package/resources/credits.d.ts.map +1 -1
- package/resources/credits.js.map +1 -1
- package/resources/credits.mjs.map +1 -1
- package/resources/events.d.mts +69 -0
- package/resources/events.d.mts.map +1 -1
- package/resources/events.d.ts +69 -0
- package/resources/events.d.ts.map +1 -1
- package/resources/events.js +2 -1
- package/resources/events.js.map +1 -1
- package/resources/events.mjs +2 -1
- package/resources/events.mjs.map +1 -1
- package/resources/extractions.d.mts +8 -0
- package/resources/extractions.d.mts.map +1 -1
- package/resources/extractions.d.ts +8 -0
- package/resources/extractions.d.ts.map +1 -1
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/monitors/posts.d.mts +45 -1
- package/resources/monitors/posts.d.mts.map +1 -1
- package/resources/monitors/posts.d.ts +45 -1
- package/resources/monitors/posts.d.ts.map +1 -1
- package/resources/monitors/posts.js +1 -1
- package/resources/monitors/posts.mjs +1 -1
- package/resources/shared.d.mts +67 -1
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +67 -1
- package/resources/shared.d.ts.map +1 -1
- package/resources/subscribe.d.mts +11 -0
- package/resources/subscribe.d.mts.map +1 -1
- package/resources/subscribe.d.ts +11 -0
- package/resources/subscribe.d.ts.map +1 -1
- package/resources/subscribe.js.map +1 -1
- package/resources/subscribe.mjs.map +1 -1
- package/resources/x/index.d.mts +1 -1
- package/resources/x/index.d.mts.map +1 -1
- package/resources/x/index.d.ts +1 -1
- package/resources/x/index.d.ts.map +1 -1
- package/resources/x/index.js.map +1 -1
- package/resources/x/index.mjs.map +1 -1
- package/resources/x/media.d.mts +36 -0
- package/resources/x/media.d.mts.map +1 -1
- package/resources/x/media.d.ts +36 -0
- package/resources/x/media.d.ts.map +1 -1
- package/resources/x/sports.d.mts +474 -4
- package/resources/x/sports.d.mts.map +1 -1
- package/resources/x/sports.d.ts +474 -4
- package/resources/x/sports.d.ts.map +1 -1
- package/resources/x/sports.js +64 -1
- package/resources/x/sports.js.map +1 -1
- package/resources/x/sports.mjs +64 -1
- package/resources/x/sports.mjs.map +1 -1
- package/resources/x/tweets/tweets.d.mts +31 -0
- package/resources/x/tweets/tweets.d.mts.map +1 -1
- package/resources/x/tweets/tweets.d.ts +31 -0
- package/resources/x/tweets/tweets.d.ts.map +1 -1
- package/resources/x/tweets/tweets.js.map +1 -1
- package/resources/x/tweets/tweets.mjs.map +1 -1
- package/resources/x/x.d.mts +2 -2
- package/resources/x/x.d.mts.map +1 -1
- package/resources/x/x.d.ts +2 -2
- package/resources/x/x.d.ts.map +1 -1
- package/resources/x/x.js.map +1 -1
- package/resources/x/x.mjs.map +1 -1
- package/skills/x-twitter-scraper/references/api-endpoints-draws.md +13 -13
- package/skills/x-twitter-scraper/references/draws.md +3 -3
- package/skills/x-twitter-scraper/references/python-examples.md +2 -2
- package/src/client.ts +23 -0
- package/src/resources/account.ts +1 -1
- package/src/resources/activity.ts +302 -0
- package/src/resources/credits.ts +29 -0
- package/src/resources/events.ts +85 -1
- package/src/resources/extractions.ts +9 -0
- package/src/resources/index.ts +8 -0
- package/src/resources/monitors/posts.ts +58 -1
- package/src/resources/shared.ts +113 -0
- package/src/resources/subscribe.ts +13 -0
- package/src/resources/x/index.ts +18 -0
- package/src/resources/x/media.ts +50 -0
- package/src/resources/x/sports.ts +583 -3
- package/src/resources/x/tweets/tweets.ts +35 -0
- package/src/resources/x/x.ts +36 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
|
|
5
5
|
import { APIResource } from '../../core/resource';
|
|
6
|
+
import * as Shared from '../shared';
|
|
6
7
|
import { APIPromise } from '../../core/api-promise';
|
|
7
8
|
import { RequestOptions } from '../../internal/request-options';
|
|
8
9
|
import { path } from '../../internal/utils/path';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
|
-
* NFL & college football games, scoreboards, box scores
|
|
12
|
+
* NFL & college football games, scoreboards, plays, box scores, audiences,
|
|
13
|
+
* rosters, player props & posts
|
|
12
14
|
*/
|
|
13
15
|
export class Sports extends APIResource {
|
|
14
16
|
/**
|
|
@@ -91,6 +93,84 @@ export class Sports extends APIResource {
|
|
|
91
93
|
const { league, ...query } = params;
|
|
92
94
|
return this._client.get(path`/x/sports/${league}/games/${id}/plays`, { query, ...options });
|
|
93
95
|
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Returns who follows 1 game on X. It has live viewers, fan picks per team &
|
|
99
|
+
* the game chat's state. Each request costs 1 credit.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```ts
|
|
103
|
+
* const sportsGameAudience = await client.x.sports.retrieveAudience('2055084502741811200', {
|
|
104
|
+
* league: 'nfl',
|
|
105
|
+
* });
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
retrieveAudience(
|
|
109
|
+
id: string,
|
|
110
|
+
params: SportRetrieveAudienceParams,
|
|
111
|
+
options?: RequestOptions,
|
|
112
|
+
): APIPromise<SportsGameAudience> {
|
|
113
|
+
const { league, ...query } = params;
|
|
114
|
+
return this._client.get(path`/x/sports/${league}/games/${id}/audience`, { query, ...options });
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Returns both teams' players for 1 NFL game. Each player has a jersey,
|
|
119
|
+
* position, headshot & X account. Each request costs 1 credit.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```ts
|
|
123
|
+
* const footballRoster = await client.x.sports.retrieveRoster('2055084502741811200', {
|
|
124
|
+
* league: 'nfl',
|
|
125
|
+
* });
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
retrieveRoster(
|
|
129
|
+
id: string,
|
|
130
|
+
params: SportRetrieveRosterParams,
|
|
131
|
+
options?: RequestOptions,
|
|
132
|
+
): APIPromise<FootballRoster> {
|
|
133
|
+
const { league, ...query } = params;
|
|
134
|
+
return this._client.get(path`/x/sports/${league}/games/${id}/roster`, { query, ...options });
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Returns the player prop lines & American odds X shows for 1 NFL game. X lists
|
|
139
|
+
* props before & during a game. Other games return no categories. Each request
|
|
140
|
+
* costs 1 credit.
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```ts
|
|
144
|
+
* const footballProps = await client.x.sports.retrievePlayerProps('2055084502741811200', {
|
|
145
|
+
* league: 'nfl',
|
|
146
|
+
* });
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
retrievePlayerProps(
|
|
150
|
+
id: string,
|
|
151
|
+
params: SportRetrievePlayerPropsParams,
|
|
152
|
+
options?: RequestOptions,
|
|
153
|
+
): APIPromise<FootballProps> {
|
|
154
|
+
const { league, ...query } = params;
|
|
155
|
+
return this._client.get(path`/x/sports/${league}/games/${id}/player-props`, { query, ...options });
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Returns the posts X shows on a game's page, with the X search that finds them.
|
|
160
|
+
* Works before, during & after the game. Pages hold up to 20 posts, & each post
|
|
161
|
+
* costs 1 credit.
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```ts
|
|
165
|
+
* const sportsGamePosts = await client.x.sports.listPosts('2055084502741811200', {
|
|
166
|
+
* league: 'nfl',
|
|
167
|
+
* });
|
|
168
|
+
* ```
|
|
169
|
+
*/
|
|
170
|
+
listPosts(id: string, params: SportListPostsParams, options?: RequestOptions): APIPromise<SportsGamePosts> {
|
|
171
|
+
const { league, ...query } = params;
|
|
172
|
+
return this._client.get(path`/x/sports/${league}/games/${id}/posts`, { query, ...options });
|
|
173
|
+
}
|
|
94
174
|
}
|
|
95
175
|
|
|
96
176
|
/**
|
|
@@ -260,6 +340,66 @@ export interface SportsTeamLogos {
|
|
|
260
340
|
dark: string | null;
|
|
261
341
|
}
|
|
262
342
|
|
|
343
|
+
/**
|
|
344
|
+
* The team's wins, losses & ties this season. X sends it only in college
|
|
345
|
+
* football games.
|
|
346
|
+
*/
|
|
347
|
+
export interface SportsTeamRecord {
|
|
348
|
+
/**
|
|
349
|
+
* Games the team won this season.
|
|
350
|
+
*/
|
|
351
|
+
wins: number | null;
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Games the team lost this season.
|
|
355
|
+
*/
|
|
356
|
+
losses: number | null;
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Games the team tied this season.
|
|
360
|
+
*/
|
|
361
|
+
ties: number | null;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* A recent game of a team, as X lists it with the team.
|
|
366
|
+
*/
|
|
367
|
+
export interface SportsTeamGame {
|
|
368
|
+
/**
|
|
369
|
+
* The game ID, which the game routes take.
|
|
370
|
+
*/
|
|
371
|
+
id: string;
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* When this game kicked off, in UTC. Null when X shows no time.
|
|
375
|
+
*/
|
|
376
|
+
startsAt: string | null;
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* The stadium. X has sent none in recent games so far.
|
|
380
|
+
*/
|
|
381
|
+
venue: string | null;
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* This game's status as X names it, such as Closed.
|
|
385
|
+
*/
|
|
386
|
+
status: string | null;
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* The game clock, as X writes it. X has sent none so far.
|
|
390
|
+
*/
|
|
391
|
+
clock: string | null;
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* The current or last quarter. X has sent none so far.
|
|
395
|
+
*/
|
|
396
|
+
quarter: number | null;
|
|
397
|
+
|
|
398
|
+
home: FootballTeamScore;
|
|
399
|
+
|
|
400
|
+
away: FootballTeamScore;
|
|
401
|
+
}
|
|
402
|
+
|
|
263
403
|
/**
|
|
264
404
|
* A team, as X's sports pages show it.
|
|
265
405
|
*/
|
|
@@ -290,8 +430,8 @@ export interface SportsTeam {
|
|
|
290
430
|
alternateId: string | null;
|
|
291
431
|
|
|
292
432
|
/**
|
|
293
|
-
* The school or place
|
|
294
|
-
*
|
|
433
|
+
* The school or place the team plays for. X sends it in college football
|
|
434
|
+
* schedules & in a game's audience.
|
|
295
435
|
*/
|
|
296
436
|
location: string | null;
|
|
297
437
|
|
|
@@ -309,6 +449,19 @@ export interface SportsTeam {
|
|
|
309
449
|
* The user ID of the team's X account.
|
|
310
450
|
*/
|
|
311
451
|
xUserId: string | null;
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* The team's wins, losses & ties this season. X sends it only in college
|
|
455
|
+
* football games.
|
|
456
|
+
*/
|
|
457
|
+
record: SportsTeamRecord | null;
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* The team's recent games, newest first. Games without a kickoff time come
|
|
461
|
+
* last. X sends them only with the teams of a college football game. The list
|
|
462
|
+
* is empty elsewhere.
|
|
463
|
+
*/
|
|
464
|
+
recentGames: Array<SportsTeamGame>;
|
|
312
465
|
}
|
|
313
466
|
|
|
314
467
|
/**
|
|
@@ -713,6 +866,22 @@ export interface FootballPlayerXUser {
|
|
|
713
866
|
* Whether the account has a blue check.
|
|
714
867
|
*/
|
|
715
868
|
blueVerified: boolean | null;
|
|
869
|
+
|
|
870
|
+
/**
|
|
871
|
+
* Whether the account protects its posts. Only rosters carry it.
|
|
872
|
+
*/
|
|
873
|
+
protected: boolean | null;
|
|
874
|
+
|
|
875
|
+
/**
|
|
876
|
+
* Whether the account can offer subscriptions. Only rosters carry it.
|
|
877
|
+
*/
|
|
878
|
+
superFollowEligible: boolean | null;
|
|
879
|
+
|
|
880
|
+
/**
|
|
881
|
+
* The label X highlights on the account, such as BusinessLabel. Only rosters
|
|
882
|
+
* carry it.
|
|
883
|
+
*/
|
|
884
|
+
labelType: string | null;
|
|
716
885
|
}
|
|
717
886
|
|
|
718
887
|
/**
|
|
@@ -1512,6 +1681,281 @@ export interface FootballPlays {
|
|
|
1512
1681
|
players: { [key: string]: FootballPlayer };
|
|
1513
1682
|
}
|
|
1514
1683
|
|
|
1684
|
+
/**
|
|
1685
|
+
* People watching the game on X at X's last count. Null before X counts any, as
|
|
1686
|
+
* before kickoff.
|
|
1687
|
+
*/
|
|
1688
|
+
export interface SportsGameAudienceViewers {
|
|
1689
|
+
/**
|
|
1690
|
+
* How many people watched the game on X.
|
|
1691
|
+
*/
|
|
1692
|
+
count: number;
|
|
1693
|
+
|
|
1694
|
+
/**
|
|
1695
|
+
* When X counted them.
|
|
1696
|
+
*/
|
|
1697
|
+
asOf: string;
|
|
1698
|
+
}
|
|
1699
|
+
|
|
1700
|
+
/**
|
|
1701
|
+
* 1 team's picks.
|
|
1702
|
+
*/
|
|
1703
|
+
export interface SportsGameAudienceTeamPick {
|
|
1704
|
+
/**
|
|
1705
|
+
* The team ID, a key in teams.
|
|
1706
|
+
*/
|
|
1707
|
+
teamId: string;
|
|
1708
|
+
|
|
1709
|
+
/**
|
|
1710
|
+
* How many people picked this team.
|
|
1711
|
+
*/
|
|
1712
|
+
count: number | null;
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
/**
|
|
1716
|
+
* How many people on X picked a team to root for.
|
|
1717
|
+
*/
|
|
1718
|
+
export interface SportsGameAudienceTeamPicks {
|
|
1719
|
+
/**
|
|
1720
|
+
* Picks for every team in the game.
|
|
1721
|
+
*/
|
|
1722
|
+
total: number | null;
|
|
1723
|
+
|
|
1724
|
+
/**
|
|
1725
|
+
* Picks per team.
|
|
1726
|
+
*/
|
|
1727
|
+
teams: Array<SportsGameAudienceTeamPick>;
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
/**
|
|
1731
|
+
* Time left until the chat opens. Null while it is open & after the game.
|
|
1732
|
+
*/
|
|
1733
|
+
export interface SportsGameAudienceChatOpensIn {
|
|
1734
|
+
/**
|
|
1735
|
+
* Whole days left.
|
|
1736
|
+
*/
|
|
1737
|
+
days: number | null;
|
|
1738
|
+
|
|
1739
|
+
/**
|
|
1740
|
+
* Hours left after the days.
|
|
1741
|
+
*/
|
|
1742
|
+
hours: number | null;
|
|
1743
|
+
|
|
1744
|
+
/**
|
|
1745
|
+
* Minutes left after the hours.
|
|
1746
|
+
*/
|
|
1747
|
+
minutes: number | null;
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
/**
|
|
1751
|
+
* The game's live chat on X.
|
|
1752
|
+
*/
|
|
1753
|
+
export interface SportsGameAudienceChat {
|
|
1754
|
+
/**
|
|
1755
|
+
* Whether the chat is open now.
|
|
1756
|
+
*/
|
|
1757
|
+
available: boolean | null;
|
|
1758
|
+
|
|
1759
|
+
/**
|
|
1760
|
+
* X's ID for the game's chat room.
|
|
1761
|
+
*/
|
|
1762
|
+
broadcastId: string | null;
|
|
1763
|
+
|
|
1764
|
+
/**
|
|
1765
|
+
* Time left until the chat opens. Null while it is open & after the game.
|
|
1766
|
+
*/
|
|
1767
|
+
opensIn: SportsGameAudienceChatOpensIn | null;
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
/**
|
|
1771
|
+
* Who watches & roots for 1 game on X.
|
|
1772
|
+
*/
|
|
1773
|
+
export interface SportsGameAudience {
|
|
1774
|
+
/**
|
|
1775
|
+
* The ID of the game, from your request.
|
|
1776
|
+
*/
|
|
1777
|
+
id: string;
|
|
1778
|
+
|
|
1779
|
+
/**
|
|
1780
|
+
* The game's league, from your request.
|
|
1781
|
+
*/
|
|
1782
|
+
league: FootballLeague;
|
|
1783
|
+
|
|
1784
|
+
/**
|
|
1785
|
+
* People watching the game on X at X's last count. Null before X counts any,
|
|
1786
|
+
* as before kickoff.
|
|
1787
|
+
*/
|
|
1788
|
+
viewers: SportsGameAudienceViewers | null;
|
|
1789
|
+
|
|
1790
|
+
/**
|
|
1791
|
+
* How many people on X picked a team to root for.
|
|
1792
|
+
*/
|
|
1793
|
+
teamPicks: SportsGameAudienceTeamPicks;
|
|
1794
|
+
|
|
1795
|
+
/**
|
|
1796
|
+
* The game's live chat on X.
|
|
1797
|
+
*/
|
|
1798
|
+
chat: SportsGameAudienceChat;
|
|
1799
|
+
|
|
1800
|
+
/**
|
|
1801
|
+
* The game's teams, by team ID. X's team picker sends no short name,
|
|
1802
|
+
* alternate ID, X account or record, so those are null.
|
|
1803
|
+
*/
|
|
1804
|
+
teams: { [key: string]: SportsTeam };
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
/**
|
|
1808
|
+
* 1 team's roster.
|
|
1809
|
+
*/
|
|
1810
|
+
export interface FootballRosterTeam {
|
|
1811
|
+
/**
|
|
1812
|
+
* The team this roster belongs to, a key of teams.
|
|
1813
|
+
*/
|
|
1814
|
+
teamId: string;
|
|
1815
|
+
|
|
1816
|
+
/**
|
|
1817
|
+
* The team's players in X's order, keys of players.
|
|
1818
|
+
*/
|
|
1819
|
+
playerIds: Array<string>;
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
/**
|
|
1823
|
+
* Both teams' rosters for 1 NFL game.
|
|
1824
|
+
*/
|
|
1825
|
+
export interface FootballRoster {
|
|
1826
|
+
/**
|
|
1827
|
+
* The ID of the game these rosters cover.
|
|
1828
|
+
*/
|
|
1829
|
+
id: string;
|
|
1830
|
+
|
|
1831
|
+
/**
|
|
1832
|
+
* The league of the game these rosters cover.
|
|
1833
|
+
*/
|
|
1834
|
+
league: 'nfl';
|
|
1835
|
+
|
|
1836
|
+
/**
|
|
1837
|
+
* Each team's roster, in X's order.
|
|
1838
|
+
*/
|
|
1839
|
+
rosters: Array<FootballRosterTeam>;
|
|
1840
|
+
|
|
1841
|
+
/**
|
|
1842
|
+
* The 2 teams, by team ID.
|
|
1843
|
+
*/
|
|
1844
|
+
teams: { [key: string]: SportsTeam };
|
|
1845
|
+
|
|
1846
|
+
/**
|
|
1847
|
+
* Every rostered player, by player ID. Rosters carry no college or birth
|
|
1848
|
+
* details & only a medium headshot, so the rest are null.
|
|
1849
|
+
*/
|
|
1850
|
+
players: { [key: string]: FootballPlayer };
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
/**
|
|
1854
|
+
* 1 player's line & odds in a prop category.
|
|
1855
|
+
*/
|
|
1856
|
+
export interface FootballPlayerProp {
|
|
1857
|
+
/**
|
|
1858
|
+
* The player the line is for, a key of players.
|
|
1859
|
+
*/
|
|
1860
|
+
playerId: string | null;
|
|
1861
|
+
|
|
1862
|
+
/**
|
|
1863
|
+
* The line's place in its category, from 1.
|
|
1864
|
+
*/
|
|
1865
|
+
rank: number | null;
|
|
1866
|
+
|
|
1867
|
+
/**
|
|
1868
|
+
* The line the odds price, such as 248.5 yards. Null when the prop has no
|
|
1869
|
+
* line, such as the first touchdown scorer.
|
|
1870
|
+
*/
|
|
1871
|
+
line: number | null;
|
|
1872
|
+
|
|
1873
|
+
/**
|
|
1874
|
+
* The American odds X shows first, such as -115 or 240.
|
|
1875
|
+
*/
|
|
1876
|
+
odds: number | null;
|
|
1877
|
+
|
|
1878
|
+
/**
|
|
1879
|
+
* The American odds X shows second. Null for a prop with 1 price.
|
|
1880
|
+
*/
|
|
1881
|
+
alternateOdds: number | null;
|
|
1882
|
+
|
|
1883
|
+
/**
|
|
1884
|
+
* Whether the sportsbook takes bets on the line.
|
|
1885
|
+
*/
|
|
1886
|
+
openForBetting: boolean | null;
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1889
|
+
/**
|
|
1890
|
+
* 1 kind of player prop & its lines.
|
|
1891
|
+
*/
|
|
1892
|
+
export interface FootballPropCategory {
|
|
1893
|
+
/**
|
|
1894
|
+
* X's key for the prop, such as passing_yards.
|
|
1895
|
+
*/
|
|
1896
|
+
key: string | null;
|
|
1897
|
+
|
|
1898
|
+
/**
|
|
1899
|
+
* The name X shows for the prop.
|
|
1900
|
+
*/
|
|
1901
|
+
name: string | null;
|
|
1902
|
+
|
|
1903
|
+
/**
|
|
1904
|
+
* The category's place in X's order, from 1.
|
|
1905
|
+
*/
|
|
1906
|
+
rank: number | null;
|
|
1907
|
+
|
|
1908
|
+
/**
|
|
1909
|
+
* Each player's line, in X's order.
|
|
1910
|
+
*/
|
|
1911
|
+
props: Array<FootballPlayerProp>;
|
|
1912
|
+
}
|
|
1913
|
+
|
|
1914
|
+
/**
|
|
1915
|
+
* The player props X shows for 1 NFL game.
|
|
1916
|
+
*/
|
|
1917
|
+
export interface FootballProps {
|
|
1918
|
+
/**
|
|
1919
|
+
* The ID of the game these props cover.
|
|
1920
|
+
*/
|
|
1921
|
+
id: string;
|
|
1922
|
+
|
|
1923
|
+
/**
|
|
1924
|
+
* The league of the game these props cover.
|
|
1925
|
+
*/
|
|
1926
|
+
league: 'nfl';
|
|
1927
|
+
|
|
1928
|
+
/**
|
|
1929
|
+
* The sportsbook page X links for these props.
|
|
1930
|
+
*/
|
|
1931
|
+
sportsbookUrl: string | null;
|
|
1932
|
+
|
|
1933
|
+
/**
|
|
1934
|
+
* Each kind of prop, such as passing yards, in X's order. A game without props
|
|
1935
|
+
* has none.
|
|
1936
|
+
*/
|
|
1937
|
+
categories: Array<FootballPropCategory>;
|
|
1938
|
+
|
|
1939
|
+
/**
|
|
1940
|
+
* The players these props name, by player ID. X sends only each player's
|
|
1941
|
+
* name, jersey & team, so other fields are null.
|
|
1942
|
+
*/
|
|
1943
|
+
players: { [key: string]: FootballPlayer };
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
/**
|
|
1947
|
+
* A page of 1 game's posts. Pass next_cursor as cursor for the next page.
|
|
1948
|
+
*/
|
|
1949
|
+
export interface SportsGamePosts extends Shared.PaginatedTweets {
|
|
1950
|
+
/**
|
|
1951
|
+
* The X search that finds this game's posts for the order asked. It names the
|
|
1952
|
+
* teams, hashtags, accounts & star players, with the game's time window. Send
|
|
1953
|
+
* it to client.x.tweets.search for more filters. Null when the game has no
|
|
1954
|
+
* such search.
|
|
1955
|
+
*/
|
|
1956
|
+
query: string | null;
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1515
1959
|
export interface SportListGamesParams {
|
|
1516
1960
|
/**
|
|
1517
1961
|
* Fields to keep in each row, comma-separated. Use dots for nested fields,
|
|
@@ -1621,6 +2065,124 @@ export interface SportRetrievePlaysParams {
|
|
|
1621
2065
|
omit?: string;
|
|
1622
2066
|
}
|
|
1623
2067
|
|
|
2068
|
+
export interface SportRetrieveAudienceParams {
|
|
2069
|
+
/**
|
|
2070
|
+
* Path param: nfl for the NFL or ncaafb for college football, in any case.
|
|
2071
|
+
* Another value gets a free 400 `invalid_league` before X is read.
|
|
2072
|
+
*/
|
|
2073
|
+
league: FootballLeague;
|
|
2074
|
+
|
|
2075
|
+
/**
|
|
2076
|
+
* Fields to keep in each row, comma-separated. Use dots for nested fields,
|
|
2077
|
+
* such as author.username. A list keeps the field in each item. Case &
|
|
2078
|
+
* underscores do not matter. A row that lacks a field leaves it out. Cursors,
|
|
2079
|
+
* counts & diagnostics always stay. An unknown name answers 400 unknown_field
|
|
2080
|
+
* with the valid names, before any read. The price stays the same. SDK row
|
|
2081
|
+
* types then hold only the named fields.
|
|
2082
|
+
*/
|
|
2083
|
+
fields?: string;
|
|
2084
|
+
|
|
2085
|
+
/**
|
|
2086
|
+
* Fields to drop from each row, comma-separated. It takes the same names as
|
|
2087
|
+
* fields. With fields, it drops from the kept fields.
|
|
2088
|
+
*/
|
|
2089
|
+
omit?: string;
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
export interface SportRetrieveRosterParams {
|
|
2093
|
+
/**
|
|
2094
|
+
* Path param: nfl, in any case. X has no college rosters or props, so ncaafb
|
|
2095
|
+
* gets a free 400 `unsupported_league`. Another value gets a free 400
|
|
2096
|
+
* `invalid_league`.
|
|
2097
|
+
*/
|
|
2098
|
+
league: 'nfl';
|
|
2099
|
+
|
|
2100
|
+
/**
|
|
2101
|
+
* Fields to keep in each row, comma-separated. Use dots for nested fields,
|
|
2102
|
+
* such as author.username. A list keeps the field in each item. Case &
|
|
2103
|
+
* underscores do not matter. A row that lacks a field leaves it out. Cursors,
|
|
2104
|
+
* counts & diagnostics always stay. An unknown name answers 400 unknown_field
|
|
2105
|
+
* with the valid names, before any read. The price stays the same. SDK row
|
|
2106
|
+
* types then hold only the named fields.
|
|
2107
|
+
*/
|
|
2108
|
+
fields?: string;
|
|
2109
|
+
|
|
2110
|
+
/**
|
|
2111
|
+
* Fields to drop from each row, comma-separated. It takes the same names as
|
|
2112
|
+
* fields. With fields, it drops from the kept fields.
|
|
2113
|
+
*/
|
|
2114
|
+
omit?: string;
|
|
2115
|
+
}
|
|
2116
|
+
|
|
2117
|
+
export interface SportRetrievePlayerPropsParams {
|
|
2118
|
+
/**
|
|
2119
|
+
* Path param: nfl, in any case. X has no college rosters or props, so ncaafb
|
|
2120
|
+
* gets a free 400 `unsupported_league`. Another value gets a free 400
|
|
2121
|
+
* `invalid_league`.
|
|
2122
|
+
*/
|
|
2123
|
+
league: 'nfl';
|
|
2124
|
+
|
|
2125
|
+
/**
|
|
2126
|
+
* Fields to keep in each row, comma-separated. Use dots for nested fields,
|
|
2127
|
+
* such as author.username. A list keeps the field in each item. Case &
|
|
2128
|
+
* underscores do not matter. A row that lacks a field leaves it out. Cursors,
|
|
2129
|
+
* counts & diagnostics always stay. An unknown name answers 400 unknown_field
|
|
2130
|
+
* with the valid names, before any read. The price stays the same. SDK row
|
|
2131
|
+
* types then hold only the named fields.
|
|
2132
|
+
*/
|
|
2133
|
+
fields?: string;
|
|
2134
|
+
|
|
2135
|
+
/**
|
|
2136
|
+
* Fields to drop from each row, comma-separated. It takes the same names as
|
|
2137
|
+
* fields. With fields, it drops from the kept fields.
|
|
2138
|
+
*/
|
|
2139
|
+
omit?: string;
|
|
2140
|
+
}
|
|
2141
|
+
|
|
2142
|
+
export interface SportListPostsParams {
|
|
2143
|
+
/**
|
|
2144
|
+
* Path param: nfl for the NFL or ncaafb for college football, in any case.
|
|
2145
|
+
* Another value gets a free 400 `invalid_league` before X is read.
|
|
2146
|
+
*/
|
|
2147
|
+
league: FootballLeague;
|
|
2148
|
+
|
|
2149
|
+
/**
|
|
2150
|
+
* Pagination cursor for collection results. Also read as next_cursor,
|
|
2151
|
+
* next_token, pagination_token or continuation_token.
|
|
2152
|
+
*/
|
|
2153
|
+
cursor?: string;
|
|
2154
|
+
|
|
2155
|
+
/**
|
|
2156
|
+
* Fields to keep in each row, comma-separated. Use dots for nested fields,
|
|
2157
|
+
* such as author.username. A list keeps the field in each item. Case &
|
|
2158
|
+
* underscores do not matter. A row that lacks a field leaves it out. Cursors,
|
|
2159
|
+
* counts & diagnostics always stay. An unknown name answers 400 unknown_field
|
|
2160
|
+
* with the valid names, before any read. The price stays the same. SDK row
|
|
2161
|
+
* types then hold only the named fields.
|
|
2162
|
+
*/
|
|
2163
|
+
fields?: string;
|
|
2164
|
+
|
|
2165
|
+
/**
|
|
2166
|
+
* Fields to drop from each row, comma-separated. It takes the same names as
|
|
2167
|
+
* fields. With fields, it drops from the kept fields.
|
|
2168
|
+
*/
|
|
2169
|
+
omit?: string;
|
|
2170
|
+
|
|
2171
|
+
/**
|
|
2172
|
+
* Items per page (1-100, default 20). Filters or credits can return fewer.
|
|
2173
|
+
* Follow next_cursor for more pages. Its aliases are limit, count, max_results,
|
|
2174
|
+
* maxItems, max_items & per_page.
|
|
2175
|
+
*/
|
|
2176
|
+
pageSize?: number;
|
|
2177
|
+
|
|
2178
|
+
/**
|
|
2179
|
+
* Top for the posts X ranks highest, or Latest for the newest. Any case works,
|
|
2180
|
+
* & so do Relevance & Recency. Alias order or sort. Send the same value with
|
|
2181
|
+
* each cursor.
|
|
2182
|
+
*/
|
|
2183
|
+
queryType?: 'Top' | 'Latest';
|
|
2184
|
+
}
|
|
2185
|
+
|
|
1624
2186
|
export declare namespace Sports {
|
|
1625
2187
|
export {
|
|
1626
2188
|
type FootballLeague as FootballLeague,
|
|
@@ -1671,5 +2233,23 @@ export declare namespace Sports {
|
|
|
1671
2233
|
type SportRetrieveScoreboardParams as SportRetrieveScoreboardParams,
|
|
1672
2234
|
type SportRetrieveBoxScoreParams as SportRetrieveBoxScoreParams,
|
|
1673
2235
|
type SportRetrievePlaysParams as SportRetrievePlaysParams,
|
|
2236
|
+
type SportsTeamRecord as SportsTeamRecord,
|
|
2237
|
+
type SportsTeamGame as SportsTeamGame,
|
|
2238
|
+
type SportsGameAudienceViewers as SportsGameAudienceViewers,
|
|
2239
|
+
type SportsGameAudienceTeamPick as SportsGameAudienceTeamPick,
|
|
2240
|
+
type SportsGameAudienceTeamPicks as SportsGameAudienceTeamPicks,
|
|
2241
|
+
type SportsGameAudienceChatOpensIn as SportsGameAudienceChatOpensIn,
|
|
2242
|
+
type SportsGameAudienceChat as SportsGameAudienceChat,
|
|
2243
|
+
type SportsGameAudience as SportsGameAudience,
|
|
2244
|
+
type SportRetrieveAudienceParams as SportRetrieveAudienceParams,
|
|
2245
|
+
type FootballRosterTeam as FootballRosterTeam,
|
|
2246
|
+
type FootballRoster as FootballRoster,
|
|
2247
|
+
type FootballPlayerProp as FootballPlayerProp,
|
|
2248
|
+
type FootballPropCategory as FootballPropCategory,
|
|
2249
|
+
type FootballProps as FootballProps,
|
|
2250
|
+
type SportsGamePosts as SportsGamePosts,
|
|
2251
|
+
type SportRetrieveRosterParams as SportRetrieveRosterParams,
|
|
2252
|
+
type SportRetrievePlayerPropsParams as SportRetrievePlayerPropsParams,
|
|
2253
|
+
type SportListPostsParams as SportListPostsParams,
|
|
1674
2254
|
};
|
|
1675
2255
|
}
|
|
@@ -542,6 +542,11 @@ export interface TweetDetail {
|
|
|
542
542
|
*/
|
|
543
543
|
limitedActions?: Array<TweetDetail.LimitedAction>;
|
|
544
544
|
|
|
545
|
+
/**
|
|
546
|
+
* The live event the post belongs to, such as an election.
|
|
547
|
+
*/
|
|
548
|
+
liveEventContext?: TweetDetail.LiveEventContext;
|
|
549
|
+
|
|
545
550
|
/**
|
|
546
551
|
* Media, omitted when unavailable.
|
|
547
552
|
*/
|
|
@@ -663,6 +668,12 @@ export interface TweetDetail {
|
|
|
663
668
|
'retweetCount' | 'replyCount' | 'likeCount' | 'quoteCount' | 'viewCount' | 'bookmarkCount'
|
|
664
669
|
>;
|
|
665
670
|
|
|
671
|
+
/**
|
|
672
|
+
* The fields X did not send for this post. text reads empty, so treat it as
|
|
673
|
+
* unknown rather than empty. Left out when X sent the text.
|
|
674
|
+
*/
|
|
675
|
+
unknownFields?: Array<'text'>;
|
|
676
|
+
|
|
666
677
|
/**
|
|
667
678
|
* User IDs that left this conversation.
|
|
668
679
|
*/
|
|
@@ -1219,6 +1230,23 @@ export namespace TweetDetail {
|
|
|
1219
1230
|
}
|
|
1220
1231
|
}
|
|
1221
1232
|
|
|
1233
|
+
export interface LiveEventContext {
|
|
1234
|
+
/**
|
|
1235
|
+
* The event's image.
|
|
1236
|
+
*/
|
|
1237
|
+
imageUrl?: string;
|
|
1238
|
+
|
|
1239
|
+
/**
|
|
1240
|
+
* Event name.
|
|
1241
|
+
*/
|
|
1242
|
+
title?: string;
|
|
1243
|
+
|
|
1244
|
+
/**
|
|
1245
|
+
* The event's page on X.
|
|
1246
|
+
*/
|
|
1247
|
+
url?: string;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1222
1250
|
/**
|
|
1223
1251
|
* Complete Note Tweet content and rich-text metadata.
|
|
1224
1252
|
*/
|
|
@@ -1603,6 +1631,13 @@ export namespace TweetDetail {
|
|
|
1603
1631
|
* Public post & user this reaction references.
|
|
1604
1632
|
*/
|
|
1605
1633
|
export interface ReactionContext {
|
|
1634
|
+
/**
|
|
1635
|
+
* The post this one reacts to, with the same fields. X often sends only its
|
|
1636
|
+
* ID, author & edit history. Then unknownFields lists text, and the flags X
|
|
1637
|
+
* did not send are left out.
|
|
1638
|
+
*/
|
|
1639
|
+
reactedToPost?: { [key: string]: unknown };
|
|
1640
|
+
|
|
1606
1641
|
/**
|
|
1607
1642
|
* Referenced post ID.
|
|
1608
1643
|
*/
|