Daily.co: Video Call API for Developers
AI TOOLS Feb. 12, 2026, 11:30 a.m.

Daily.co: Video Call API for Developers

Daily.co (now known as Daily) offers a powerful, developer‑first video call API that lets you spin up high‑quality, WebRTC‑based meetings with just a few lines of code. Whether you’re building a telehealth platform, an online classroom, or a support chat widget, Daily abstracts the heavy lifting—signaling, TURN servers, and media negotiation—so you can focus on the user experience. In this guide we’ll walk through the core concepts, set up a sandbox project, and explore three practical code examples that you can drop into a real‑world app.

What Makes Daily Different?

Daily’s API is built around the concept of “rooms” – lightweight containers that represent a single video session. A room can be created on the fly via a REST endpoint, and each participant joins by receiving a unique URL or token. This model eliminates the need for persistent server‑side state; you can generate a room, share the link, and let the client SDK handle the rest.

Another standout is the “no‑backend” option. Daily provides a client‑side JavaScript library that can create rooms directly from the browser, which is perfect for prototypes or low‑traffic apps. For production workloads you can still route calls through your own backend to enforce authentication, add custom metadata, or integrate with billing systems.

Key Features at a Glance

  • One‑click screen sharing and recording.
  • Dynamic layout control (grid, speaker view, custom CSS).
  • Low‑latency, 1080p video with adaptive bitrate.
  • Server‑side SDKs for Python, Node, and Go.
  • Built‑in analytics and webhook events.

Getting Started: Your First Room

The first step is to sign up on daily.co and retrieve your API key from the dashboard. Treat this key like a password – store it in environment variables or a secret manager, never hard‑code it.

Below is a minimal Python script that creates a new room using Daily’s REST API. We’ll use the requests library, which is included in most Python environments.

import os
import requests
import json

API_KEY = os.getenv('DAILY_API_KEY')
BASE_URL = 'https://api.daily.co/v1/rooms'

def create_room(name: str, privacy: str = 'private') -> dict:
    """Create a Daily room and return the JSON response."""
    headers = {
        'Authorization': f'Bearer {API_KEY}',
        'Content-Type': 'application/json'
    }
    payload = {
        'name': name,
        'privacy': privacy,
        'properties': {
            'enable_recording': True,
            'start_video_off': False,
            'start_audio_off': False
        }
    }
    response = requests.post(BASE_URL, headers=headers, data=json.dumps(payload))
    response.raise_for_status()
    return response.json()

if __name__ == '__main__':
    room = create_room('demo-room-123')
    print('Room URL:', room['url'])
    print('Room ID:', room['id'])

Run the script after setting DAILY_API_KEY in your environment. The output will include a fully qualified URL (e.g., https://demo-room-123.daily.co/demo-room-123) that you can embed in any web page.

Embedding the Call in a Web Page

Daily’s JavaScript SDK makes it trivial to turn that URL into a live video call. Add the SDK script tag to your HTML, then call DailyIframe.createFrame() with the room URL.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Daily Demo</title>
  <script src="https://cdn.jsdelivr.net/npm/@daily-co/daily-js">

This snippet produces a responsive iframe that automatically handles permissions, media devices, and network fallback. The showLeaveButton option adds a built‑in “Leave” button, saving you from writing extra UI code.

Advanced Use Cases

Now that the basics are covered, let’s explore how Daily can power more sophisticated scenarios. We’ll look at three common patterns: authenticated access, custom UI overlays, and server‑side recording.

1. Authenticated Access with Tokens

In many applications you’ll want to restrict who can join a room. Daily supports JWT‑based tokens that you generate on your backend. The token can embed user metadata (e.g., user ID, role) and enforce expiration.

import os
import jwt
import datetime

API_KEY = os.getenv('DAILY_API_KEY')
API_SECRET = os.getenv('DAILY_API_SECRET')

def generate_token(room_url: str, user_id: str, role: str = 'participant') -> str:
    """Create a signed JWT for a Daily room."""
    payload = {
        'url': room_url,
        'exp': datetime.datetime.utcnow() + datetime.timedelta(hours=2),
        'user_name': user_id,
        'custom_data': {'role': role}
    }
    token = jwt.encode(payload, API_SECRET, algorithm='HS256')
    return token

# Example usage
room_url = 'https://demo-room-123.daily.co/demo-room-123'
print('JWT Token:', generate_token(room_url, 'alice@example.com', 'host'))

Pass the generated token to the JavaScript SDK via the join() method. The SDK validates the token client‑side, and Daily’s server enforces the same constraints, ensuring only authorized users can connect.

const token = 'eyJhbGciOi...'; // fetched from your backend
callFrame.join({ url: roomUrl, token });

2. Custom UI Overlays

Daily’s iframe can be styled with CSS, but sometimes you need native controls—like a “Raise Hand” button or a real‑time participant list. The SDK emits events you can listen to, allowing you to synchronize UI state with the call.

// Assume callFrame is already created
const participantsDiv = document.getElementById('participants');

function renderParticipants() {
  const participants = callFrame.participants();
  participantsDiv.innerHTML = '';
  Object.values(participants).forEach(p => {
    const el = document.createElement('div');
    el.textContent = `${p.user_name} (${p.state})`;
    participantsDiv.appendChild(el);
  });
}

// Update UI whenever participants change
callFrame.on('participant-joined', renderParticipants);
callFrame.on('participant-left', renderParticipants);
callFrame.on('participant-updated', renderParticipants);

Pair this with a simple CSS overlay, and you have a fully custom meeting UI while still leveraging Daily’s robust media pipeline.

3. Server‑Side Recording & Playback

Daily can record meetings to an S3 bucket or to Daily’s own storage. Once a room is created, you can enable recording via the API and later retrieve the media file for playback or compliance.

def start_recording(room_name: str) -> dict:
    """Enable recording for an existing room."""
    url = f'{BASE_URL}/{room_name}'
    headers = {
        'Authorization': f'Bearer {API_KEY}',
        'Content-Type': 'application/json'
    }
    payload = {
        'properties': {
            'enable_recording': True,
            'recording_options': {
                'auto_start': True,
                'recording_mode': 'composite',  # or 'individual'
                'recording_layout': 'grid'
            }
        }
    }
    response = requests.patch(url, headers=headers, json=payload)
    response.raise_for_status()
    return response.json()

# Start recording on the demo room
recording_info = start_recording('demo-room-123')
print('Recording started:', recording_info['properties']['recording_options'])

After the call ends, Daily posts a webhook to your endpoint with a downloadable URL. You can then embed the video in a “Meeting History” page or feed it into a transcription service.

Pro tip: Use Daily’s composite recording mode for a single‑file output that matches the on‑screen layout. It simplifies storage and playback, especially when you need to serve recordings to non‑technical users.

Real‑World Use Cases

Telehealth platforms often require secure, HIPAA‑compliant video. Daily’s token‑based authentication, end‑to‑end encryption, and ability to host recordings in a private S3 bucket make it a solid foundation for doctor‑patient consultations.

Online education benefits from Daily’s screen‑share and layout controls. An instructor can broadcast a slide deck while students see a grid of peers. Using the participant‑list event, you can build a “raise‑hand” system that integrates with a learning management system (LMS).

Customer support widgets embed a video call directly on a product page. Because Daily’s iframe can be toggled on demand, you can keep the UI lightweight and only load the heavy WebRTC stack when a user clicks “Live Help.”

Case Study: Remote Pair Programming

Imagine a SaaS company that offers on‑demand code reviews. By creating a temporary room per session, generating a JWT for the reviewer, and embedding the call alongside a collaborative code editor (e.g., Monaco), the team can provide real‑time feedback without installing third‑party apps. The recording feature captures the session for later reference, and the webhook can trigger a post‑call survey.

Case Study: Virtual Events

Large conferences often need breakout rooms. Daily’s “room‑list” API lets you pre‑create dozens of rooms, each with a unique slug. Attendees receive a personalized URL that routes them to the appropriate breakout session, while the host dashboard aggregates participant counts across all rooms.

Performance & Scalability Considerations

Daily runs its own globally distributed TURN/STUN infrastructure, which means you rarely need to configure your own media relays. However, for ultra‑low latency (e.g., gaming), you might want to colocate your signaling server in the same region as your user base.

When scaling to thousands of concurrent rooms, keep an eye on your API usage limits. Daily offers tiered plans with per‑minute room creation caps. If you anticipate burst traffic, request a higher quota or use the “pre‑warm” endpoint to keep rooms alive for a short window.

Pro tip: Cache the room URL on the client for the duration of a session and only hit the REST endpoint when you need a new room. This reduces API calls and avoids hitting rate limits during high‑traffic periods.

Best Practices for Production Deployments

  • Secure your API key. Store it in a secret manager (AWS Secrets Manager, Vault) and never expose it to the browser.
  • Validate tokens server‑side. Even though the client SDK checks JWT signatures, enforce the same checks on your backend before granting access to sensitive resources.
  • Handle network interruptions. Daily emits network-quality-change events; use them to display a “Reconnecting…” banner and optionally switch to a lower‑resolution mode.
  • Respect user privacy. Offer a clear “Leave” button and inform participants when recording starts. Daily automatically adds a “Recording” indicator, but you should also log consent.
  • Test across browsers. Daily supports Chrome, Firefox, Safari, and Edge, but screen‑share permissions differ. Write fallback logic for browsers that require user gestures.

Troubleshooting Common Issues

Problem: Participants see a black screen.

Solution: Verify that the browser has camera permissions and that the device isn’t being used by another application. Use callFrame.on('error', ...) to log the specific error code; Daily often returns mediaDeviceFailed when the webcam is locked.

Problem: High latency on mobile networks.

Solution: Enable adaptive bitrate by setting properties: { video: { max_framerate: 15 } } when creating the room. This caps the frame rate, reducing bandwidth usage without breaking the call.

Conclusion

Daily’s Video Call API blends simplicity with enterprise‑grade features, making it a go‑to choice for developers who need reliable, scalable video without reinventing the WebRTC stack. By leveraging room creation, JWT authentication, and the JavaScript SDK, you can build anything from a single‑page support widget to a full‑blown virtual classroom. Remember to secure your keys, respect privacy, and monitor performance, and you’ll be able to ship video experiences that delight users and scale with demand.

Share this article