flaky-beard-91685
02/13/2025, 10:36 AMgray-monkey-83525
02/13/2025, 10:36 AMListRooms
method from the LiveKit API. Here's a basic example:
from livekit import api
import asyncio
async def list_active_rooms():
# Initialize the LiveKit API client
lkapi = api.LiveKitAPI("<URL>")
# List all active rooms
room_list = await lkapi.room.list_rooms(api.ListRoomsRequest())
print("Active Rooms:", room_list)
# Close the API connection
await lkapi.aclose()
if __name__ == "__main__":
asyncio.get_event_loop().run_until_complete(list_active_rooms())
This script initializes the LiveKit API client, lists all active rooms, and prints them. Make sure to replace <URL>
with your LiveKit server URL.
Would you like more details on this process?
Sources:
- LiveKit Room Management
- LiveKit Python SDK Example 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.