tiktok-live-api 1.4.0 ā 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -66,14 +66,14 @@ That's it. **No complex setup, no protobuf, no reverse engineering, no breakages
|
|
|
66
66
|
|
|
67
67
|
---
|
|
68
68
|
|
|
69
|
-
## š Try It Now ā
|
|
69
|
+
## š Try It Now ā Live Demo
|
|
70
70
|
|
|
71
|
-
Copy-paste this into a file and run it. Connects to a live TikTok stream
|
|
71
|
+
Copy-paste this into a file and run it. Connects to a live TikTok stream and prints every event in real time. Works on the free Community tier ā no time limit, runs as long as the stream is live.
|
|
72
72
|
|
|
73
73
|
**Save as `demo.mjs` and run with `node demo.mjs`:**
|
|
74
74
|
|
|
75
75
|
```javascript
|
|
76
|
-
// demo.mjs ā TikTok LIVE in
|
|
76
|
+
// demo.mjs ā TikTok LIVE in real time
|
|
77
77
|
// npm install tiktok-live-api
|
|
78
78
|
import { TikTokLive } from 'tiktok-live-api';
|
|
79
79
|
|
|
@@ -90,11 +90,11 @@ client.on('member', e => { events++; console.log(`š ${e.user.uniqueId} j
|
|
|
90
90
|
client.on('follow', e => { events++; console.log(`ā ${e.user.uniqueId} followed`); });
|
|
91
91
|
client.on('roomUserSeq', e => { events++; console.log(`š Viewers: ${e.viewerCount}`); });
|
|
92
92
|
|
|
93
|
-
client.on('connected', () => console.log(`\nā
Connected to @${LIVE_USERNAME} ā
|
|
94
|
-
client.on('disconnected', () => console.log(`\nš
|
|
93
|
+
client.on('connected', () => console.log(`\nā
Connected to @${LIVE_USERNAME} ā streaming events...\n`));
|
|
94
|
+
client.on('disconnected', () => console.log(`\nš Disconnected. Received ${events} events.\n`));
|
|
95
95
|
|
|
96
96
|
client.connect();
|
|
97
|
-
|
|
97
|
+
// Press Ctrl+C to stop. Community tier has no per-connection time limit.
|
|
98
98
|
```
|
|
99
99
|
|
|
100
100
|
<details>
|
|
@@ -111,7 +111,7 @@ const LIVE_USERNAME = 'tv_asahi_news';
|
|
|
111
111
|
const ws = new WebSocket(`wss://api.tik.tools?uniqueId=${LIVE_USERNAME}&apiKey=${API_KEY}`);
|
|
112
112
|
let events = 0;
|
|
113
113
|
|
|
114
|
-
ws.on('open', () => console.log(`\nā
Connected to @${LIVE_USERNAME} ā
|
|
114
|
+
ws.on('open', () => console.log(`\nā
Connected to @${LIVE_USERNAME} ā streaming events...\n`));
|
|
115
115
|
ws.on('message', (raw) => {
|
|
116
116
|
const msg = JSON.parse(raw);
|
|
117
117
|
events++;
|
|
@@ -127,9 +127,8 @@ ws.on('message', (raw) => {
|
|
|
127
127
|
default: console.log(`š¦ ${msg.event}`); break;
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
|
-
ws.on('close', () => console.log(`\nš
|
|
131
|
-
|
|
132
|
-
setTimeout(() => ws.close(), 300_000);
|
|
130
|
+
ws.on('close', () => console.log(`\nš Disconnected. Received ${events} events.\n`));
|
|
131
|
+
// Press Ctrl+C to stop. Community tier has no per-connection time limit.
|
|
133
132
|
```
|
|
134
133
|
|
|
135
134
|
</details>
|
|
@@ -152,7 +151,7 @@ client.connect();
|
|
|
152
151
|
2. Sign up (no credit card required)
|
|
153
152
|
3. Copy your API key
|
|
154
153
|
|
|
155
|
-
The free
|
|
154
|
+
The free **Community** tier gives you 2,500 requests/day and 15 WebSocket connections with no per-connection time limit. Forever free.
|
|
156
155
|
|
|
157
156
|
## Environment Variable
|
|
158
157
|
|
|
@@ -372,7 +371,7 @@ client.on('gift', (event: GiftEvent) => {
|
|
|
372
371
|
| **Maintenance** | ā Zero ā we handle it | ā You fix breakages | ā You fix breakages |
|
|
373
372
|
| **CAPTCHA Solving** | ā Built-in (Pro+) | ā | ā |
|
|
374
373
|
| **Feed Discovery** | ā See who's live | ā | ā |
|
|
375
|
-
| **Free Tier** | ā
|
|
374
|
+
| **Free Tier** | ā 2,500 req/day, 15 WS, no time limit | ā Free (unreliable) | ā Free (unreliable) |
|
|
376
375
|
| **ESM + CJS** | ā Both supported | ā | N/A |
|
|
377
376
|
|
|
378
377
|
## Pricing
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tiktok-live-api",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Unofficial TikTok LIVE API Client ā Real-time chat, gifts, viewers, battles, and AI live captions from any TikTok livestream. Managed WebSocket API with 99.9% uptime.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|