Using the room name, how can I check the current s...
# ask-ai
m
Using the room name, how can I check the current status (is it active or was it deleted?) of the room using the Livekit API (via the Python SDK)?
t
Thanks for reaching out, Daniel. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! You can easily check the current status of a room using the LiveKit API with the Python SDK by listing the rooms and filtering by the room name. Here’s a quick example to get you started:
Copy code
from livekit import api

async def check_room(room_name):
    lkapi = api.LiveKitAPI()
    rooms_response = await lkapi.room.list_rooms(
        api.ListRoomsRequest(names=[room_name])
    )
    return rooms_response
If the room is active and exists, you’ll see it in the response. If it’s not there, it probably means the room was deleted or just doesn’t exist. Hope that helps! Sources: README.md