SignatureRateLimitError: "Too many connections started"
You see SignatureRateLimitError with the message "Too many connections started, try again later." in TikTok-Live-Connector (Node), or "Too many connections started, try again in N seconds." in TikTokLive (Python). The connect call fails before any LIVE event arrives.
The error
SignatureRateLimitError: [Rate Limited] Too many connections started, try again later.
# Python (TikTokLive)
SignatureRateLimitError: Too many connections started, try again in N seconds.What it means
Both libraries ask a sign service for a signed connection URL before they open the WebSocket to TikTok. That service limits how many connections can be started in a time window. When the limit is reached it answers with HTTP 429 and the library raises SignatureRateLimitError.
A common trigger is a reconnect loop: a script that reconnects immediately after every disconnect, or many creators started at once from one process.
Fix it in the library
- Wait before you retry. In TikTok-Live-Connector the error exposes
retryAfter(milliseconds) andresetTime; schedule the nextconnect()after that time instead of retrying right away. In TikTokLive the wait is in the message, in seconds. - Add a backoff to your reconnect handler (for example 5 s, 10 s, 30 s, 60 s) and stagger start-up when you watch several creators.
- Upgrade TikTok-Live-Connector to 2.5.0 or later:
npm install tiktok-live-connector@latest. Before that release a 429 response could surface as aTypeErrorinstead ofSignatureRateLimitError(issue #330, fixed by PR #331, released in v2.5.0). - If you connect often, pass your own key for the sign service with the
signApiKeyoption, as described in the library README, so the limit of your own plan applies.
Or use the hosted API
With the TikTools SDK the connection limits are part of your plan and listed on the pricing page, so you know the number up front. The SDK is a few lines and keeps the same event handlers.
npm install @tiktool/live// Before: const { TikTokLiveConnection } = require('tiktok-live-connector');
const { TikTokLive } = require('@tiktool/live');
const connection = new TikTokLive({
uniqueId: process.argv[2] || 'username',
apiKey: process.env.TIKTOOL_API_KEY || 'YOUR_API_KEY',
});
connection.on('connected', () => console.log(`Connected to roomId ${connection.roomId}`));
connection.on('chat', data => console.log(`${data.user.uniqueId} (userId:${data.user.id}) writes: ${data.comment}`));
connection.on('gift', data => {
if (data.giftType === 1 && !data.repeatEnd) return; // streak still running
console.log(`${data.user.uniqueId} sent ${data.giftName} x${data.repeatCount} (${data.diamondCount * data.repeatCount} diamonds)`);
});
connection.on('like', data => console.log(`${data.user.uniqueId} liked x${data.likeCount} (total ${data.totalLikes})`));
connection.on('member', data => console.log(`${data.user.uniqueId} joined`));
connection.on('roomUserSeq', data => console.log(`Viewers: ${data.viewerCount}`));
connection.on('disconnected', (code, reason) => console.log(`Disconnected ${code} ${reason}`));
connection.connect().catch(err => console.error('Failed to connect', err)); Python: pip install tiktok-live-api. Side-by-side code for both languages and the full event name map are in the migration guide. Plans and connection limits are on the pricing page; Sandbox is a 7-day evaluation, no credit card.