@tiktool/live 2.6.6 → 2.6.7
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 +15 -32
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
#
|
|
1
|
+
# TikTok LIVE API — Node.js & TypeScript
|
|
2
2
|
|
|
3
|
-
###
|
|
3
|
+
### The managed TikTok Live Connector — receive chat, gifts, viewers, battles & 18+ events from any TikTok LIVE stream via WebSocket.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@tiktool/live)
|
|
6
|
+
[](https://www.npmjs.com/package/@tiktool/live)
|
|
6
7
|
[](https://opensource.org/licenses/MIT)
|
|
7
8
|
[](https://nodejs.org)
|
|
8
9
|
[](https://www.typescriptlang.org)
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
> **99.9% uptime** — Never breaks when TikTok updates. No protobuf, no reverse engineering, no maintenance. Also available for [Python](https://pypi.org/project/tiktok-live-api/), [Java, Go, C#, and any language via WebSocket](https://tik.tools/docs).
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
**🎤 NEW:** [Real-Time Live Captions](#-real-time-live-captions) — AI-powered speech-to-text transcription & translation with speaker diarization. **No other TikTok library offers this.**
|
|
13
14
|
|
|
14
|
-
[
|
|
15
|
+
[Try It Now](#-try-it-now--5-minute-live-demo) · [Events](#-events) · [Live Captions](#-real-time-live-captions) · [API](#-api-reference) · [Rate Limits](#-rate-limits) · [Get API Key](https://tik.tools)
|
|
15
16
|
|
|
16
17
|
---
|
|
17
18
|
|
|
@@ -21,34 +22,16 @@ Real-time chat, gifts, viewers, battles, follows & 18+ event types from any TikT
|
|
|
21
22
|
npm install @tiktool/live
|
|
22
23
|
```
|
|
23
24
|
|
|
24
|
-
Get your free API key at [tik.tools](https://tik.tools)
|
|
25
|
+
Get your free API key at [tik.tools](https://tik.tools) — then run the demo below.
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
import { TikTokLive } from '@tiktool/live';
|
|
28
|
-
|
|
29
|
-
const live = new TikTokLive({
|
|
30
|
-
uniqueId: 'tv_asahi_news',
|
|
31
|
-
apiKey: 'YOUR_API_KEY',
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
live.on('chat', e => console.log(`${e.user.uniqueId}: ${e.comment}`));
|
|
35
|
-
live.on('gift', e => console.log(`${e.user.uniqueId} sent ${e.giftName} (${e.diamondCount} diamonds)`));
|
|
36
|
-
live.on('member', e => console.log(`${e.user.uniqueId} joined`));
|
|
37
|
-
live.on('roomUserSeq', e => console.log(`Viewers: ${e.viewerCount}`));
|
|
38
|
-
|
|
39
|
-
await live.connect();
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## 🚀 Try It Now — 60-Second Live Demo
|
|
27
|
+
## 🚀 Try It Now — 5-Minute Live Demo
|
|
45
28
|
|
|
46
|
-
Copy-paste this into a file and run it. Connects to a live TikTok stream, prints every event for
|
|
29
|
+
Copy-paste this into a file and run it. Connects to a live TikTok stream, prints every event for 5 minutes, then exits. Works on the free Sandbox tier.
|
|
47
30
|
|
|
48
31
|
**Save as `demo.mjs` and run with `node demo.mjs`:**
|
|
49
32
|
|
|
50
33
|
```javascript
|
|
51
|
-
// demo.mjs — TikTok LIVE in
|
|
34
|
+
// demo.mjs — TikTok LIVE in 5 minutes
|
|
52
35
|
// npm install @tiktool/live
|
|
53
36
|
import { TikTokLive } from '@tiktool/live';
|
|
54
37
|
|
|
@@ -68,11 +51,11 @@ live.on('roomUserSeq', e => { events++; console.log(`👀 Viewers: ${e.viewerCou
|
|
|
68
51
|
live.on('subscribe', e => { events++; console.log(`⭐ ${e.user.uniqueId} subscribed`); });
|
|
69
52
|
live.on('battle', e => { events++; console.log(`⚔️ Battle update`); });
|
|
70
53
|
|
|
71
|
-
live.on('connected', () => console.log(`\n✅ Connected to @${LIVE_USERNAME} — listening for
|
|
54
|
+
live.on('connected', () => console.log(`\n✅ Connected to @${LIVE_USERNAME} — listening for 5 min...\n`));
|
|
72
55
|
live.on('disconnected', () => console.log(`\n📊 Done! Received ${events} events.\n`));
|
|
73
56
|
|
|
74
57
|
await live.connect();
|
|
75
|
-
setTimeout(() => { live.disconnect(); },
|
|
58
|
+
setTimeout(() => { live.disconnect(); }, 300_000);
|
|
76
59
|
```
|
|
77
60
|
|
|
78
61
|
<details>
|
|
@@ -91,7 +74,7 @@ const LIVE_USERNAME = 'tv_asahi_news';
|
|
|
91
74
|
const ws = new WebSocket(`wss://api.tik.tools?uniqueId=${LIVE_USERNAME}&apiKey=${API_KEY}`);
|
|
92
75
|
let events = 0;
|
|
93
76
|
|
|
94
|
-
ws.on('open', () => console.log(`\n✅ Connected to @${LIVE_USERNAME} — listening for
|
|
77
|
+
ws.on('open', () => console.log(`\n✅ Connected to @${LIVE_USERNAME} — listening for 5 min...\n`));
|
|
95
78
|
ws.on('message', (raw) => {
|
|
96
79
|
const msg = JSON.parse(raw);
|
|
97
80
|
events++;
|
|
@@ -109,7 +92,7 @@ ws.on('message', (raw) => {
|
|
|
109
92
|
});
|
|
110
93
|
ws.on('close', () => console.log(`\n📊 Done! Received ${events} events.\n`));
|
|
111
94
|
|
|
112
|
-
setTimeout(() => ws.close(),
|
|
95
|
+
setTimeout(() => ws.close(), 300_000);
|
|
113
96
|
```
|
|
114
97
|
|
|
115
98
|
</details>
|
|
@@ -331,7 +314,7 @@ All API requests require an API key. Get yours at [tik.tools](https://tik.tools)
|
|
|
331
314
|
|
|
332
315
|
| Tier | Requests/Day | Rate Limit | WS Connections | WS Duration | WS Connects | Bulk Check | CAPTCHA | Feed Discovery | Price |
|
|
333
316
|
|------|-------------|-----------|----------------|-------------|-------------|------------|---------|----------------|-------|
|
|
334
|
-
| **Sandbox** | 50 | 5/min | 1 |
|
|
317
|
+
| **Sandbox** | 50 | 5/min | 1 | 5 min | 10/hr · 30/day | 1 | ✕ | ✕ | Free |
|
|
335
318
|
| **Basic** | 10,000 | 60/min | 3 | 8 hours | 60/hr · 200/day | 10 | ✕ | ✕ | From $7/wk |
|
|
336
319
|
| **Pro** | 75,000 | Unlimited | 50 | 8 hours | Unlimited | 50 | 50/day | 100/day | From $15/wk |
|
|
337
320
|
| **Ultra** | 300,000 | Unlimited | 500 | 8 hours | Unlimited | 500 | 500/day | 2,000/day | From $45/wk |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiktool/live",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.7",
|
|
4
4
|
"description": "TikTok LIVE API Client — Real-time chat, gifts, viewers, live captions (speech-to-text), AI transcription & translation from any TikTok livestream.",
|
|
5
5
|
"author": "tiktool",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"homepage": "https://tik.tools",
|
|
35
35
|
"repository": {
|
|
36
36
|
"type": "git",
|
|
37
|
-
"url": "https://github.com/tiktool/live"
|
|
37
|
+
"url": "git+https://github.com/tiktool/tiktok-live-api.git"
|
|
38
38
|
},
|
|
39
39
|
"bugs": {
|
|
40
40
|
"url": "https://github.com/tiktool/live/issues"
|