@tapline/client 0.2.3 → 0.2.5
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/README.md +4 -2
- package/dist/cjs/client.d.ts +2 -0
- package/dist/cjs/client.d.ts.map +1 -1
- package/dist/cjs/client.js +3 -0
- package/dist/cjs/client.js.map +1 -1
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +4 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/services/airbnb/client.js +6 -6
- package/dist/cjs/services/airbnb/client.js.map +1 -1
- package/dist/cjs/services/airbnb/types.d.ts +1 -1
- package/dist/cjs/services/airbnb/types.d.ts.map +1 -1
- package/dist/cjs/services/geckoterminal/client.js +28 -28
- package/dist/cjs/services/geckoterminal/client.js.map +1 -1
- package/dist/cjs/services/gmgn/client.js +61 -61
- package/dist/cjs/services/gmgn/client.js.map +1 -1
- package/dist/cjs/services/goplus/client.js +3 -3
- package/dist/cjs/services/goplus/client.js.map +1 -1
- package/dist/cjs/services/ponsfamily/client.js +37 -37
- package/dist/cjs/services/ponsfamily/client.js.map +1 -1
- package/dist/cjs/services/twitter/client.d.ts +15 -0
- package/dist/cjs/services/twitter/client.d.ts.map +1 -0
- package/dist/cjs/services/twitter/client.js +32 -0
- package/dist/cjs/services/twitter/client.js.map +1 -0
- package/dist/cjs/services/twitter/index.d.ts +3 -0
- package/dist/cjs/services/twitter/index.d.ts.map +1 -0
- package/dist/cjs/services/twitter/index.js +22 -0
- package/dist/cjs/services/twitter/index.js.map +1 -0
- package/dist/cjs/services/twitter/types.d.ts +513 -0
- package/dist/cjs/services/twitter/types.d.ts.map +1 -0
- package/dist/cjs/services/twitter/types.js +4 -0
- package/dist/cjs/services/twitter/types.js.map +1 -0
- package/dist/cjs/services/youtube/client.js +11 -11
- package/dist/cjs/services/youtube/client.js.map +1 -1
- package/dist/client.d.ts +2 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +3 -0
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/services/airbnb/client.js +6 -6
- package/dist/services/airbnb/client.js.map +1 -1
- package/dist/services/airbnb/types.d.ts +1 -1
- package/dist/services/airbnb/types.d.ts.map +1 -1
- package/dist/services/geckoterminal/client.js +28 -28
- package/dist/services/geckoterminal/client.js.map +1 -1
- package/dist/services/gmgn/client.js +61 -61
- package/dist/services/gmgn/client.js.map +1 -1
- package/dist/services/goplus/client.js +3 -3
- package/dist/services/goplus/client.js.map +1 -1
- package/dist/services/ponsfamily/client.js +37 -37
- package/dist/services/ponsfamily/client.js.map +1 -1
- package/dist/services/twitter/client.d.ts +15 -0
- package/dist/services/twitter/client.d.ts.map +1 -0
- package/dist/services/twitter/client.js +28 -0
- package/dist/services/twitter/client.js.map +1 -0
- package/dist/services/twitter/index.d.ts +3 -0
- package/dist/services/twitter/index.d.ts.map +1 -0
- package/dist/services/twitter/index.js +4 -0
- package/dist/services/twitter/index.js.map +1 -0
- package/dist/services/twitter/types.d.ts +513 -0
- package/dist/services/twitter/types.d.ts.map +1 -0
- package/dist/services/twitter/types.js +3 -0
- package/dist/services/twitter/types.js.map +1 -0
- package/dist/services/youtube/client.js +11 -11
- package/dist/services/youtube/client.js.map +1 -1
- package/package.json +3 -2
|
@@ -6,173 +6,173 @@ export class PonsfamilyClient {
|
|
|
6
6
|
}
|
|
7
7
|
/** Protocol-wide launch, volume, trade and revenue totals plus the daily series behind them. Costs 2 credits. */
|
|
8
8
|
async getAnalytics() {
|
|
9
|
-
return this.base.get('/
|
|
9
|
+
return this.base.get('/v1/ponsfamily/analytics');
|
|
10
10
|
}
|
|
11
11
|
/** Community-takeover migrations: the old and new token, the deposit/claim schedule and how much has been migrated. Costs 2 credits. */
|
|
12
12
|
async listCtoMigrations() {
|
|
13
|
-
return this.base.get('/
|
|
13
|
+
return this.base.get('/v1/ponsfamily/cto-migrations');
|
|
14
14
|
}
|
|
15
15
|
/** The ETH/USD rate pons prices every launch with. Costs 2 credits. */
|
|
16
16
|
async getEthPrice() {
|
|
17
|
-
return this.base.get('/
|
|
17
|
+
return this.base.get('/v1/ponsfamily/eth-price');
|
|
18
18
|
}
|
|
19
19
|
/** Token communities ranked by market cap, burn share or real market cap. Costs 2 credits. */
|
|
20
20
|
async listForumCommunities(params) {
|
|
21
|
-
return this.base.get('/
|
|
21
|
+
return this.base.get('/v1/ponsfamily/forum/communities', { ...params });
|
|
22
22
|
}
|
|
23
23
|
/** One token community with its supply, burn and market-cap figures. Costs 2 credits. */
|
|
24
24
|
async getForumCommunity(params) {
|
|
25
25
|
const { slug } = params;
|
|
26
|
-
return this.base.get(`/
|
|
26
|
+
return this.base.get(`/v1/ponsfamily/forum/communities/${encodeURIComponent(slug)}`);
|
|
27
27
|
}
|
|
28
28
|
/** A wallet's balance in a community token and the posting tier that balance earns it. Costs 2 credits. */
|
|
29
29
|
async getForumHolding(params) {
|
|
30
30
|
const { token, wallet } = params;
|
|
31
|
-
return this.base.get(`/
|
|
31
|
+
return this.base.get(`/v1/ponsfamily/forum/holdings/${encodeURIComponent(token)}/${encodeURIComponent(wallet)}`);
|
|
32
32
|
}
|
|
33
33
|
/** The memestock board: US market session state, the community ticker rows and the equities they track. Costs 2 credits. */
|
|
34
34
|
async getForumMarket() {
|
|
35
|
-
return this.base.get('/
|
|
35
|
+
return this.base.get('/v1/ponsfamily/forum/market');
|
|
36
36
|
}
|
|
37
37
|
/** The memestock forum feed, optionally narrowed to one token community. Costs 2 credits. */
|
|
38
38
|
async listForumPosts(params) {
|
|
39
|
-
return this.base.get('/
|
|
39
|
+
return this.base.get('/v1/ponsfamily/forum/posts', { ...params });
|
|
40
40
|
}
|
|
41
41
|
/** One forum post with its vote counts and community metadata. Costs 2 credits. */
|
|
42
42
|
async getForumPost(params) {
|
|
43
43
|
const { post_id } = params;
|
|
44
|
-
return this.base.get(`/
|
|
44
|
+
return this.base.get(`/v1/ponsfamily/forum/posts/${encodeURIComponent(post_id)}`);
|
|
45
45
|
}
|
|
46
46
|
/** The comment thread under a forum post. Costs 2 credits. */
|
|
47
47
|
async getForumPostComments(params) {
|
|
48
48
|
const { post_id, ...query } = params;
|
|
49
|
-
return this.base.get(`/
|
|
49
|
+
return this.base.get(`/v1/ponsfamily/forum/posts/${encodeURIComponent(post_id)}/comments`, query);
|
|
50
50
|
}
|
|
51
51
|
/** The pons launchpad explore board: tokens still climbing the bonding curve plus a page of graduated tokens. Costs 2 credits. */
|
|
52
52
|
async listLaunches(params) {
|
|
53
|
-
return this.base.get('/
|
|
53
|
+
return this.base.get('/v1/ponsfamily/launches', { ...params });
|
|
54
54
|
}
|
|
55
55
|
/** The graduated tokens as full launch records, the catalog view of the graduations feed. Costs 2 credits. */
|
|
56
56
|
async listGraduatedCatalog() {
|
|
57
|
-
return this.base.get('/
|
|
57
|
+
return this.base.get('/v1/ponsfamily/launches/graduated');
|
|
58
58
|
}
|
|
59
59
|
/** Every graduation event pons has observed, as token address and graduation block. Costs 2 credits. */
|
|
60
60
|
async listGraduations() {
|
|
61
|
-
return this.base.get('/
|
|
61
|
+
return this.base.get('/v1/ponsfamily/launches/graduations');
|
|
62
62
|
}
|
|
63
63
|
/** Live price and graduation-progress snapshot for the launches currently trading. Costs 2 credits. */
|
|
64
64
|
async listLiveMarkets(params) {
|
|
65
|
-
return this.base.get('/
|
|
65
|
+
return this.base.get('/v1/ponsfamily/launches/live-markets', { ...params });
|
|
66
66
|
}
|
|
67
67
|
/** Search every pons launch by name, symbol or contract address. Costs 2 credits. */
|
|
68
68
|
async searchLaunches(params) {
|
|
69
|
-
return this.base.get('/
|
|
69
|
+
return this.base.get('/v1/ponsfamily/launches/search', { ...params });
|
|
70
70
|
}
|
|
71
71
|
/** Price, market cap, liquidity, recent trades and price points for one v1 token. Costs 2 credits. */
|
|
72
72
|
async getMarket(params) {
|
|
73
73
|
const { token, ...query } = params;
|
|
74
|
-
return this.base.get(`/
|
|
74
|
+
return this.base.get(`/v1/ponsfamily/markets/${encodeURIComponent(token)}`, query);
|
|
75
75
|
}
|
|
76
76
|
/** All-time-high price for a token and the block it was set in. Costs 2 credits. */
|
|
77
77
|
async getMarketAth(params) {
|
|
78
78
|
const { token } = params;
|
|
79
|
-
return this.base.get(`/
|
|
79
|
+
return this.base.get(`/v1/ponsfamily/markets/${encodeURIComponent(token)}/ath`);
|
|
80
80
|
}
|
|
81
81
|
/** Supply burned for a token, in wei. Costs 2 credits. */
|
|
82
82
|
async getMarketBurned(params) {
|
|
83
83
|
const { token } = params;
|
|
84
|
-
return this.base.get(`/
|
|
84
|
+
return this.base.get(`/v1/ponsfamily/markets/${encodeURIComponent(token)}/burned`);
|
|
85
85
|
}
|
|
86
86
|
/** Bucketed price and volume points for a token, at the resolution the range implies. Costs 2 credits. */
|
|
87
87
|
async getMarketChart(params) {
|
|
88
88
|
const { token, ...query } = params;
|
|
89
|
-
return this.base.get(`/
|
|
89
|
+
return this.base.get(`/v1/ponsfamily/markets/${encodeURIComponent(token)}/chart`, query);
|
|
90
90
|
}
|
|
91
91
|
/** What the deployer did with its own allocation: buys, sells, transfers, burns, and the dumped/moved/burned verdicts. Costs 2 credits. */
|
|
92
92
|
async getDeveloperTrades(params) {
|
|
93
93
|
const { token, ...query } = params;
|
|
94
|
-
return this.base.get(`/
|
|
94
|
+
return this.base.get(`/v1/ponsfamily/markets/${encodeURIComponent(token)}/dev-trades`, query);
|
|
95
95
|
}
|
|
96
96
|
/** Ranked token holders with balance, supply share and per-holder PnL where pons can compute it. Costs 2 credits. */
|
|
97
97
|
async getMarketHolders(params) {
|
|
98
98
|
const { token } = params;
|
|
99
|
-
return this.base.get(`/
|
|
99
|
+
return this.base.get(`/v1/ponsfamily/markets/${encodeURIComponent(token)}/holders`);
|
|
100
100
|
}
|
|
101
101
|
/** Resting limit-order depth around the current price, bucketed into price bands. Costs 2 credits. */
|
|
102
102
|
async getMarketOrderDepth(params) {
|
|
103
103
|
const { token } = params;
|
|
104
|
-
return this.base.get(`/
|
|
104
|
+
return this.base.get(`/v1/ponsfamily/markets/${encodeURIComponent(token)}/order-depth`);
|
|
105
105
|
}
|
|
106
106
|
/** The latest observed pool price, the cheap poll the launchpad UI uses. Costs 2 credits. */
|
|
107
107
|
async getMarketTip(params) {
|
|
108
108
|
const { token } = params;
|
|
109
|
-
return this.base.get(`/
|
|
109
|
+
return this.base.get(`/v1/ponsfamily/markets/${encodeURIComponent(token)}/tip`);
|
|
110
110
|
}
|
|
111
111
|
/** The most recent buys and sells against a token's pool. Costs 2 credits. */
|
|
112
112
|
async getMarketTrades(params) {
|
|
113
113
|
const { token } = params;
|
|
114
|
-
return this.base.get(`/
|
|
114
|
+
return this.base.get(`/v1/ponsfamily/markets/${encodeURIComponent(token)}/trades`);
|
|
115
115
|
}
|
|
116
116
|
/** The share of supply each deployer still holds of the token it launched. Costs 2 credits. */
|
|
117
117
|
async getCreatorHoldings(body) {
|
|
118
|
-
return this.base.post('/
|
|
118
|
+
return this.base.post('/v1/ponsfamily/tokens/creator-holdings', body);
|
|
119
119
|
}
|
|
120
120
|
/** Whether each token routes its creator fees to holders. Costs 2 credits. */
|
|
121
121
|
async getFeeSharing(params) {
|
|
122
|
-
return this.base.get('/
|
|
122
|
+
return this.base.get('/v1/ponsfamily/tokens/fee-sharing', { ...params });
|
|
123
123
|
}
|
|
124
124
|
/** Resolved logo URLs keyed by lower-cased token address. Costs 2 credits. */
|
|
125
125
|
async getTokenImages(params) {
|
|
126
|
-
return this.base.get('/
|
|
126
|
+
return this.base.get('/v1/ponsfamily/tokens/images', { ...params });
|
|
127
127
|
}
|
|
128
128
|
/** Static token metadata: supply, socials, pool wiring and the deployer that launched it. Costs 2 credits. */
|
|
129
129
|
async getToken(params) {
|
|
130
130
|
const { token } = params;
|
|
131
|
-
return this.base.get(`/
|
|
131
|
+
return this.base.get(`/v1/ponsfamily/tokens/${encodeURIComponent(token)}`);
|
|
132
132
|
}
|
|
133
133
|
/** Bucketed price and volume points for a v2 launch, with the quote asset's USD rate. Costs 2 credits. */
|
|
134
134
|
async getV2MarketChart(params) {
|
|
135
135
|
const { token, ...query } = params;
|
|
136
|
-
return this.base.get(`/
|
|
136
|
+
return this.base.get(`/v1/ponsfamily/v2-markets/${encodeURIComponent(token)}/chart`, query);
|
|
137
137
|
}
|
|
138
138
|
/** Creator-fee escrow for a v2 launch: recipient, quote asset and what has been earned so far. Costs 2 credits. */
|
|
139
139
|
async getV2CreatorFees(params) {
|
|
140
140
|
const { token } = params;
|
|
141
|
-
return this.base.get(`/
|
|
141
|
+
return this.base.get(`/v1/ponsfamily/v2-markets/${encodeURIComponent(token)}/creator-fees`);
|
|
142
142
|
}
|
|
143
143
|
/** Holder fee-sharing distributor state for a v2 launch, including the latest payout epoch. Costs 2 credits. */
|
|
144
144
|
async getV2Distributor(params) {
|
|
145
145
|
const { token } = params;
|
|
146
|
-
return this.base.get(`/
|
|
146
|
+
return this.base.get(`/v1/ponsfamily/v2-markets/${encodeURIComponent(token)}/distributor`);
|
|
147
147
|
}
|
|
148
148
|
/** Ranked holders of a v2 launch. Costs 2 credits. */
|
|
149
149
|
async getV2MarketHolders(params) {
|
|
150
150
|
const { token } = params;
|
|
151
|
-
return this.base.get(`/
|
|
151
|
+
return this.base.get(`/v1/ponsfamily/v2-markets/${encodeURIComponent(token)}/holders`);
|
|
152
152
|
}
|
|
153
153
|
/** Trades against a v2 (curve) launch, quoted in the launch's own quote asset. Costs 2 credits. */
|
|
154
154
|
async getV2MarketTrades(params) {
|
|
155
155
|
const { token } = params;
|
|
156
|
-
return this.base.get(`/
|
|
156
|
+
return this.base.get(`/v1/ponsfamily/v2-markets/${encodeURIComponent(token)}/trades`);
|
|
157
157
|
}
|
|
158
158
|
/** Public pons profiles (username, avatar, bio) for the given wallets. Costs 2 credits. */
|
|
159
159
|
async getWalletIdentities(params) {
|
|
160
|
-
return this.base.get('/
|
|
160
|
+
return this.base.get('/v1/ponsfamily/wallets/identities', { ...params });
|
|
161
161
|
}
|
|
162
162
|
/** Portfolio value over time for a wallet, with the change over the requested window. Costs 2 credits. */
|
|
163
163
|
async getPortfolioChart(params) {
|
|
164
164
|
const { address, ...query } = params;
|
|
165
|
-
return this.base.get(`/
|
|
165
|
+
return this.base.get(`/v1/ponsfamily/wallets/${encodeURIComponent(address)}/portfolio-chart`, query);
|
|
166
166
|
}
|
|
167
167
|
/** A wallet's open and closed positions, its trade activity, and realized/unrealized PnL totals. Costs 2 credits. */
|
|
168
168
|
async getWalletPositions(params) {
|
|
169
169
|
const { address } = params;
|
|
170
|
-
return this.base.get(`/
|
|
170
|
+
return this.base.get(`/v1/ponsfamily/wallets/${encodeURIComponent(address)}/positions`);
|
|
171
171
|
}
|
|
172
172
|
/** The launches a wallet deployed or earns fees from, with its claimed and claimable fees on each, alongside the ETH/USD rate pons priced them with. Costs 2 credits. */
|
|
173
173
|
async getProfile(params) {
|
|
174
174
|
const { address } = params;
|
|
175
|
-
return this.base.get(`/
|
|
175
|
+
return this.base.get(`/v1/ponsfamily/wallets/${encodeURIComponent(address)}/profile`);
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
//# sourceMappingURL=client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/services/ponsfamily/client.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAKpE,MAAM,OAAO,gBAAgB;IACE;IAA7B,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD,iHAAiH;IACjH,KAAK,CAAC,YAAY;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAuB,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/services/ponsfamily/client.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAKpE,MAAM,OAAO,gBAAgB;IACE;IAA7B,YAA6B,IAAgB;QAAhB,SAAI,GAAJ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iBAAiB,CAAC,MAA+B;QACrD,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;QACzB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAA4B,6BAA6B,kBAAkB,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACnH,CAAC;IAED,2FAA2F;IAC3F,KAAK,CAAC,mBAAmB,CAAC,MAAiC;QACzD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAA8B,mCAAmC,EAAE,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;IACxG,CAAC;IAED,0GAA0G;IAC1G,KAAK,CAAC,iBAAiB,CAAC,MAA+B;QACrD,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACrC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAA4B,0BAA0B,kBAAkB,CAAC,OAAO,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;IAClI,CAAC;IAED,qHAAqH;IACrH,KAAK,CAAC,kBAAkB,CAAC,MAAgC;QACvD,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;QAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAA6B,0BAA0B,kBAAkB,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACtH,CAAC;IAED,yKAAyK;IACzK,KAAK,CAAC,UAAU,CAAC,MAAwB;QACvC,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;QAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAqB,0BAA0B,kBAAkB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC5G,CAAC;CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { BaseClient } from '../../base.js';
|
|
2
|
+
import type { GetCommunityParams, GetTweetParams, GetUserProfileByIdParams, GetUserProfileParams, TwitterCommunityResponse, TwitterProfileResponse, TwitterTweetDetailResponse } from './types.js';
|
|
3
|
+
export declare class TwitterClient {
|
|
4
|
+
private readonly base;
|
|
5
|
+
constructor(base: BaseClient);
|
|
6
|
+
/** An X (Twitter) Community as x.com shows it to logged-out visitors, as X's Community object in the shape Scrape Creators returns it: `rest_id`, name, description, member count, `created_at` (Unix milliseconds), join policy, topic, banners, rules, creator and member facepile. `tweets` adds the 20 community posts x.com ranks by likes, flattened the way Scrape Creators flattens community posts: the post's `legacy` fields plus `id`, `view_count` and the author as `user`. This is a fixed window: x.com offers no latest feed and no further pages logged-out. A logged-out viewer is not a member, so `is_member` is false and `role` is NonMember. `success`, `credits_charged` and `credits_remaining` (the wallet balance after this charge) sit at the top level of the body, as in Scrape Creators' answers. Fields x.com does not show logged-out visitors are left out, never filled with placeholder values: for example `favourites_count`, `listed_count`, `media_count` and a post's `source`. Fields that depend on the viewer hold what every logged-out viewer gets: `favorited`, `retweeted`, `bookmarked`, `relationship_perspectives`, `can_dm` and the other viewer flags are false. A post's author (`core.user_results.result`, or `user` on a community post) carries what x.com embeds with posts plus what only the author's profile page shows: `location`, the exact join date (`core.created_at`), the bio (`legacy.description` and `profile_bio`), the bio link (`legacy.url` and `legacy.entities`), the banner (`legacy.profile_banner_url`), `legacy.pinned_tweet_ids_str`, `legacy.possibly_sensitive` and `verification.verified`. They come from the author's profile in the same response when there is one, else from the author's profile page, fetched at no extra charge and cached for 2 minutes, so they can be up to 2 minutes old. Author profiles are best-effort. An author whose profile page fails or takes more than 8 seconds keeps only what x.com embeds, and its join date comes from the timestamp inside the user id, which can run up to about 25 minutes before X's own value. Accounts created before about 2016 have ids without a timestamp, so their join date is left out only if that fetch fails or times out. Costs 2 credits. */
|
|
7
|
+
getCommunity(params: GetCommunityParams): Promise<TwitterCommunityResponse>;
|
|
8
|
+
/** One X (Twitter) post as x.com shows it to logged-out visitors, as X's Tweet object in the shape Scrape Creators returns it: `rest_id`, the author under `core.user_results.result`, `legacy` (full text, created time, counts, entities with every t.co link mapped, media with video variants and bitrates, reply and quote ids), `views`, `note_tweet` with the full text of a long post, `article`, `card`, `edit_control`, and the quoted post under `quoted_status_result`. `parent_tweets` holds the posts above a reply that x.com shows logged-out, oldest first; in samples that is only the post it replies to, so follow `legacy.in_reply_to_status_id_str` to walk further up. `replies` holds the top replies x.com shows logged-out (0 to 4 in samples, not every reply); x.com offers no further reply pages logged-out. Both lists hold Tweet objects plus their `url`. `success`, `credits_charged` and `credits_remaining` (the wallet balance after this charge) sit at the top level of the body, as in Scrape Creators' answers. Fields x.com does not show logged-out visitors are left out, never filled with placeholder values: for example `favourites_count`, `listed_count`, `media_count` and a post's `source`. Fields that depend on the viewer hold what every logged-out viewer gets: `favorited`, `retweeted`, `bookmarked`, `relationship_perspectives`, `can_dm` and the other viewer flags are false. A post's author (`core.user_results.result`, or `user` on a community post) carries what x.com embeds with posts plus what only the author's profile page shows: `location`, the exact join date (`core.created_at`), the bio (`legacy.description` and `profile_bio`), the bio link (`legacy.url` and `legacy.entities`), the banner (`legacy.profile_banner_url`), `legacy.pinned_tweet_ids_str`, `legacy.possibly_sensitive` and `verification.verified`. They come from the author's profile in the same response when there is one, else from the author's profile page, fetched at no extra charge and cached for 2 minutes, so they can be up to 2 minutes old. Author profiles are best-effort. An author whose profile page fails or takes more than 8 seconds keeps only what x.com embeds, and its join date comes from the timestamp inside the user id, which can run up to about 25 minutes before X's own value. Accounts created before about 2016 have ids without a timestamp, so their join date is left out only if that fetch fails or times out. Costs 1 credit. */
|
|
9
|
+
getTweet(params: GetTweetParams): Promise<TwitterTweetDetailResponse>;
|
|
10
|
+
/** An X (Twitter) account's public profile as x.com shows it to logged-out visitors, as X's User object in the shape Scrape Creators returns it: `rest_id`, `core` (name, handle, join date), `legacy` (bio, follower, following and post counts, avatar, banner, bio link, pinned post id), `location`, `privacy`, `verification` and `is_blue_verified`. `pinned_tweet` and `tweets` add the pinned post and the newest original posts x.com shows logged-out (4 or 5 in samples) from the same page fetch, each an X Tweet object plus its `url`. This is a fixed window: x.com offers no further pages logged-out, so there is no cursor. A protected account returns its profile with no posts. Tapline caches each profile page for 2 minutes, so a profile and its posts can be up to 2 minutes old. `success`, `credits_charged` and `credits_remaining` (the wallet balance after this charge) sit at the top level of the body, as in Scrape Creators' answers. Fields x.com does not show logged-out visitors are left out, never filled with placeholder values: for example `favourites_count`, `listed_count`, `media_count` and a post's `source`. Fields that depend on the viewer hold what every logged-out viewer gets: `favorited`, `retweeted`, `bookmarked`, `relationship_perspectives`, `can_dm` and the other viewer flags are false. A post's author (`core.user_results.result`, or `user` on a community post) carries what x.com embeds with posts plus what only the author's profile page shows: `location`, the exact join date (`core.created_at`), the bio (`legacy.description` and `profile_bio`), the bio link (`legacy.url` and `legacy.entities`), the banner (`legacy.profile_banner_url`), `legacy.pinned_tweet_ids_str`, `legacy.possibly_sensitive` and `verification.verified`. They come from the author's profile in the same response when there is one, else from the author's profile page, fetched at no extra charge and cached for 2 minutes, so they can be up to 2 minutes old. Author profiles are best-effort. An author whose profile page fails or takes more than 8 seconds keeps only what x.com embeds, and its join date comes from the timestamp inside the user id, which can run up to about 25 minutes before X's own value. Accounts created before about 2016 have ids without a timestamp, so their join date is left out only if that fetch fails or times out. Looks the account up by its numeric user id. Costs 1 credit. */
|
|
11
|
+
getUserProfileById(params: GetUserProfileByIdParams): Promise<TwitterProfileResponse>;
|
|
12
|
+
/** An X (Twitter) account's public profile as x.com shows it to logged-out visitors, as X's User object in the shape Scrape Creators returns it: `rest_id`, `core` (name, handle, join date), `legacy` (bio, follower, following and post counts, avatar, banner, bio link, pinned post id), `location`, `privacy`, `verification` and `is_blue_verified`. `pinned_tweet` and `tweets` add the pinned post and the newest original posts x.com shows logged-out (4 or 5 in samples) from the same page fetch, each an X Tweet object plus its `url`. This is a fixed window: x.com offers no further pages logged-out, so there is no cursor. A protected account returns its profile with no posts. Tapline caches each profile page for 2 minutes, so a profile and its posts can be up to 2 minutes old. `success`, `credits_charged` and `credits_remaining` (the wallet balance after this charge) sit at the top level of the body, as in Scrape Creators' answers. Fields x.com does not show logged-out visitors are left out, never filled with placeholder values: for example `favourites_count`, `listed_count`, `media_count` and a post's `source`. Fields that depend on the viewer hold what every logged-out viewer gets: `favorited`, `retweeted`, `bookmarked`, `relationship_perspectives`, `can_dm` and the other viewer flags are false. A post's author (`core.user_results.result`, or `user` on a community post) carries what x.com embeds with posts plus what only the author's profile page shows: `location`, the exact join date (`core.created_at`), the bio (`legacy.description` and `profile_bio`), the bio link (`legacy.url` and `legacy.entities`), the banner (`legacy.profile_banner_url`), `legacy.pinned_tweet_ids_str`, `legacy.possibly_sensitive` and `verification.verified`. They come from the author's profile in the same response when there is one, else from the author's profile page, fetched at no extra charge and cached for 2 minutes, so they can be up to 2 minutes old. Author profiles are best-effort. An author whose profile page fails or takes more than 8 seconds keeps only what x.com embeds, and its join date comes from the timestamp inside the user id, which can run up to about 25 minutes before X's own value. Accounts created before about 2016 have ids without a timestamp, so their join date is left out only if that fetch fails or times out. Looks the account up by its handle. Costs 1 credit. */
|
|
13
|
+
getUserProfile(params: GetUserProfileParams): Promise<TwitterProfileResponse>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/services/twitter/client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAEnM,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C,mrEAAmrE;IAC7qE,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAKjF,w4EAAw4E;IACl4E,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAK3E,s2EAAs2E;IACh2E,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAK3F,61EAA61E;IACv1E,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAIpF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Generated by generate-client from spec/openapi.json. Do not edit.
|
|
2
|
+
export class TwitterClient {
|
|
3
|
+
base;
|
|
4
|
+
constructor(base) {
|
|
5
|
+
this.base = base;
|
|
6
|
+
}
|
|
7
|
+
/** An X (Twitter) Community as x.com shows it to logged-out visitors, as X's Community object in the shape Scrape Creators returns it: `rest_id`, name, description, member count, `created_at` (Unix milliseconds), join policy, topic, banners, rules, creator and member facepile. `tweets` adds the 20 community posts x.com ranks by likes, flattened the way Scrape Creators flattens community posts: the post's `legacy` fields plus `id`, `view_count` and the author as `user`. This is a fixed window: x.com offers no latest feed and no further pages logged-out. A logged-out viewer is not a member, so `is_member` is false and `role` is NonMember. `success`, `credits_charged` and `credits_remaining` (the wallet balance after this charge) sit at the top level of the body, as in Scrape Creators' answers. Fields x.com does not show logged-out visitors are left out, never filled with placeholder values: for example `favourites_count`, `listed_count`, `media_count` and a post's `source`. Fields that depend on the viewer hold what every logged-out viewer gets: `favorited`, `retweeted`, `bookmarked`, `relationship_perspectives`, `can_dm` and the other viewer flags are false. A post's author (`core.user_results.result`, or `user` on a community post) carries what x.com embeds with posts plus what only the author's profile page shows: `location`, the exact join date (`core.created_at`), the bio (`legacy.description` and `profile_bio`), the bio link (`legacy.url` and `legacy.entities`), the banner (`legacy.profile_banner_url`), `legacy.pinned_tweet_ids_str`, `legacy.possibly_sensitive` and `verification.verified`. They come from the author's profile in the same response when there is one, else from the author's profile page, fetched at no extra charge and cached for 2 minutes, so they can be up to 2 minutes old. Author profiles are best-effort. An author whose profile page fails or takes more than 8 seconds keeps only what x.com embeds, and its join date comes from the timestamp inside the user id, which can run up to about 25 minutes before X's own value. Accounts created before about 2016 have ids without a timestamp, so their join date is left out only if that fetch fails or times out. Costs 2 credits. */
|
|
8
|
+
async getCommunity(params) {
|
|
9
|
+
const { community_id } = params;
|
|
10
|
+
return this.base.get(`/v1/twitter/communities/${encodeURIComponent(community_id)}`);
|
|
11
|
+
}
|
|
12
|
+
/** One X (Twitter) post as x.com shows it to logged-out visitors, as X's Tweet object in the shape Scrape Creators returns it: `rest_id`, the author under `core.user_results.result`, `legacy` (full text, created time, counts, entities with every t.co link mapped, media with video variants and bitrates, reply and quote ids), `views`, `note_tweet` with the full text of a long post, `article`, `card`, `edit_control`, and the quoted post under `quoted_status_result`. `parent_tweets` holds the posts above a reply that x.com shows logged-out, oldest first; in samples that is only the post it replies to, so follow `legacy.in_reply_to_status_id_str` to walk further up. `replies` holds the top replies x.com shows logged-out (0 to 4 in samples, not every reply); x.com offers no further reply pages logged-out. Both lists hold Tweet objects plus their `url`. `success`, `credits_charged` and `credits_remaining` (the wallet balance after this charge) sit at the top level of the body, as in Scrape Creators' answers. Fields x.com does not show logged-out visitors are left out, never filled with placeholder values: for example `favourites_count`, `listed_count`, `media_count` and a post's `source`. Fields that depend on the viewer hold what every logged-out viewer gets: `favorited`, `retweeted`, `bookmarked`, `relationship_perspectives`, `can_dm` and the other viewer flags are false. A post's author (`core.user_results.result`, or `user` on a community post) carries what x.com embeds with posts plus what only the author's profile page shows: `location`, the exact join date (`core.created_at`), the bio (`legacy.description` and `profile_bio`), the bio link (`legacy.url` and `legacy.entities`), the banner (`legacy.profile_banner_url`), `legacy.pinned_tweet_ids_str`, `legacy.possibly_sensitive` and `verification.verified`. They come from the author's profile in the same response when there is one, else from the author's profile page, fetched at no extra charge and cached for 2 minutes, so they can be up to 2 minutes old. Author profiles are best-effort. An author whose profile page fails or takes more than 8 seconds keeps only what x.com embeds, and its join date comes from the timestamp inside the user id, which can run up to about 25 minutes before X's own value. Accounts created before about 2016 have ids without a timestamp, so their join date is left out only if that fetch fails or times out. Costs 1 credit. */
|
|
13
|
+
async getTweet(params) {
|
|
14
|
+
const { tweet_id } = params;
|
|
15
|
+
return this.base.get(`/v1/twitter/tweets/${encodeURIComponent(tweet_id)}`);
|
|
16
|
+
}
|
|
17
|
+
/** An X (Twitter) account's public profile as x.com shows it to logged-out visitors, as X's User object in the shape Scrape Creators returns it: `rest_id`, `core` (name, handle, join date), `legacy` (bio, follower, following and post counts, avatar, banner, bio link, pinned post id), `location`, `privacy`, `verification` and `is_blue_verified`. `pinned_tweet` and `tweets` add the pinned post and the newest original posts x.com shows logged-out (4 or 5 in samples) from the same page fetch, each an X Tweet object plus its `url`. This is a fixed window: x.com offers no further pages logged-out, so there is no cursor. A protected account returns its profile with no posts. Tapline caches each profile page for 2 minutes, so a profile and its posts can be up to 2 minutes old. `success`, `credits_charged` and `credits_remaining` (the wallet balance after this charge) sit at the top level of the body, as in Scrape Creators' answers. Fields x.com does not show logged-out visitors are left out, never filled with placeholder values: for example `favourites_count`, `listed_count`, `media_count` and a post's `source`. Fields that depend on the viewer hold what every logged-out viewer gets: `favorited`, `retweeted`, `bookmarked`, `relationship_perspectives`, `can_dm` and the other viewer flags are false. A post's author (`core.user_results.result`, or `user` on a community post) carries what x.com embeds with posts plus what only the author's profile page shows: `location`, the exact join date (`core.created_at`), the bio (`legacy.description` and `profile_bio`), the bio link (`legacy.url` and `legacy.entities`), the banner (`legacy.profile_banner_url`), `legacy.pinned_tweet_ids_str`, `legacy.possibly_sensitive` and `verification.verified`. They come from the author's profile in the same response when there is one, else from the author's profile page, fetched at no extra charge and cached for 2 minutes, so they can be up to 2 minutes old. Author profiles are best-effort. An author whose profile page fails or takes more than 8 seconds keeps only what x.com embeds, and its join date comes from the timestamp inside the user id, which can run up to about 25 minutes before X's own value. Accounts created before about 2016 have ids without a timestamp, so their join date is left out only if that fetch fails or times out. Looks the account up by its numeric user id. Costs 1 credit. */
|
|
18
|
+
async getUserProfileById(params) {
|
|
19
|
+
const { user_id } = params;
|
|
20
|
+
return this.base.get(`/v1/twitter/users/by-id/${encodeURIComponent(user_id)}`);
|
|
21
|
+
}
|
|
22
|
+
/** An X (Twitter) account's public profile as x.com shows it to logged-out visitors, as X's User object in the shape Scrape Creators returns it: `rest_id`, `core` (name, handle, join date), `legacy` (bio, follower, following and post counts, avatar, banner, bio link, pinned post id), `location`, `privacy`, `verification` and `is_blue_verified`. `pinned_tweet` and `tweets` add the pinned post and the newest original posts x.com shows logged-out (4 or 5 in samples) from the same page fetch, each an X Tweet object plus its `url`. This is a fixed window: x.com offers no further pages logged-out, so there is no cursor. A protected account returns its profile with no posts. Tapline caches each profile page for 2 minutes, so a profile and its posts can be up to 2 minutes old. `success`, `credits_charged` and `credits_remaining` (the wallet balance after this charge) sit at the top level of the body, as in Scrape Creators' answers. Fields x.com does not show logged-out visitors are left out, never filled with placeholder values: for example `favourites_count`, `listed_count`, `media_count` and a post's `source`. Fields that depend on the viewer hold what every logged-out viewer gets: `favorited`, `retweeted`, `bookmarked`, `relationship_perspectives`, `can_dm` and the other viewer flags are false. A post's author (`core.user_results.result`, or `user` on a community post) carries what x.com embeds with posts plus what only the author's profile page shows: `location`, the exact join date (`core.created_at`), the bio (`legacy.description` and `profile_bio`), the bio link (`legacy.url` and `legacy.entities`), the banner (`legacy.profile_banner_url`), `legacy.pinned_tweet_ids_str`, `legacy.possibly_sensitive` and `verification.verified`. They come from the author's profile in the same response when there is one, else from the author's profile page, fetched at no extra charge and cached for 2 minutes, so they can be up to 2 minutes old. Author profiles are best-effort. An author whose profile page fails or takes more than 8 seconds keeps only what x.com embeds, and its join date comes from the timestamp inside the user id, which can run up to about 25 minutes before X's own value. Accounts created before about 2016 have ids without a timestamp, so their join date is left out only if that fetch fails or times out. Looks the account up by its handle. Costs 1 credit. */
|
|
23
|
+
async getUserProfile(params) {
|
|
24
|
+
const { screen_name } = params;
|
|
25
|
+
return this.base.get(`/v1/twitter/users/${encodeURIComponent(screen_name)}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/services/twitter/client.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAKpE,MAAM,OAAO,aAAa;IACK;IAA7B,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD,mrEAAmrE;IACnrE,KAAK,CAAC,YAAY,CAAC,MAA0B;QAC3C,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;QAChC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAA2B,2BAA2B,kBAAkB,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;IAChH,CAAC;IAED,w4EAAw4E;IACx4E,KAAK,CAAC,QAAQ,CAAC,MAAsB;QACnC,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;QAC5B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAA6B,sBAAsB,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACzG,CAAC;IAED,s2EAAs2E;IACt2E,KAAK,CAAC,kBAAkB,CAAC,MAAgC;QACvD,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;QAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAyB,2BAA2B,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACzG,CAAC;IAED,61EAA61E;IAC71E,KAAK,CAAC,cAAc,CAAC,MAA4B;QAC/C,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;QAC/B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAyB,qBAAqB,kBAAkB,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IACvG,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/twitter/index.ts"],"names":[],"mappings":"AAEA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/twitter/index.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAEpE,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
|