Docs
Functional Connect Usage

Functional Connect Usage

How to use the Functional Connect platform to connect to TikTok LIVE streams in any language.

What is Functional Connect?

Functional Connect is a fully managed hassle-free TikTok LIVE Cloud API solution. Connect to TikTok LIVE streams in less than 10 lines of code with just a standard WebSocket.

With 0 dependencies and less than 10 lines of code, connect to a TikTok livestream and get the data you need to build 3rd-party integrations in ANY language.

Where can I learn more?

For up-to-date examples, tips, and tricks on how to use Functional Connect, visit https://github.com/EulerStream/FunctionalConnect.

Usage Example

import asyncio
 
import websockets
 
API_KEY = '[YOUR_API_KEY]'
WS_URL = f'wss://tiktok.eulerstream.com/webcast/cloud/ws?apiKey={API_KEY}'
 
 
async def python_sample():
    """Connect to the WebSocket server and print messages received."""
 
    async with websockets.connect(WS_URL) as websocket:
        try:
            while websocket.open:
                message = await websocket.recv()
                print("Message received:", message)
        except websockets.exceptions.ConnectionClosed:
            print("Connection to the server closed.")
 
 
# Run the WebSocket client
if __name__ == '__main__':
    asyncio.run(python_sample())