Skip to main content

Overview

Seam provides a universal API to connect and control many brands of devices. This guide provides a rapid introduction to connecting your Tapo cameras to Seam, retrieving them as devices, and receiving their motion events. Seam reaches Tapo cameras on the local network through a Seam Bridge. To learn more about other device brands supported by Seam, head over to our integration page.
Tapo cameras are in beta. Seam turns on Tapo, camera events, event media, and live video for each workspace separately, so contact Seam to enable the ones you need for your workspace, including your sandbox workspace, before you follow this guide.

1 — Install Seam SDK

Seam provides client libraries for many languages, such as JavaScript, Python, Ruby, PHP, and others, as well as a Postman collection and OpenAPI spec.
Once installed, sign up for Seam to get your API key, and export it as an environment variable:
This guide uses a Sandbox Workspace. Only virtual devices can be connected. If you need to connect a real Tapo camera, use a non-sandbox workspace and API key.

To use a Tapo camera through the Seam API, you must first authorize your Seam workspace to reach the camera. To do so, Seam provides Connect Webviews: pre-built UX flows that walk you through pairing a Seam Bridge and entering the camera’s connection details. Tapo is a beta provider, so include tapo in the Connect Webview’s accepted_providers list. The Tapo login in the Connect Webview works only after Seam turns on Tapo for your workspace, including your sandbox workspace.

Request a Connect Webview

Authorize Your Workspace

Navigate to the URL returned by the Webview object. Since you are using a sandbox workspace, you don’t need to install Seam Bridge. Continue past the Seam Bridge instructions, submit the prefilled sandbox pairing token, and then enter the Tapo sandbox camera details below:
  • Camera address: camera.test
  • ONVIF port: 2020
  • Camera Account username: tapo-test-user
  • Camera Account password: tapo-test-password
  • Tapo account password (optional): tapo-sandbox-account-password
Confirm the Connect Webview was successful by querying its status:

3 — Retrieve the Tapo Camera Device

After a Tapo camera is linked with Seam, you can retrieve it as a device. Each Tapo connected account contains exactly one camera, with the tapo_camera device type. The can_stream_live_video capability flag is true when the camera supports live video and is online. To stream its live video, live video must also be turned on for your workspace. Otherwise, /cameras/live_views/create returns a camera_not_available error. The sandbox camera reports true, but the sandbox can’t stream video, so use a real camera to try live view.

4 — Receive Motion Events

When a connected Tapo camera detects motion, Seam creates a camera.activated event with activation_reason set to motion_detected. To receive these events as they happen, set up a webhook. You can also list events for the camera.
The Tapo sandbox camera doesn’t simulate motion, so this step returns no events in a sandbox workspace. Use a real camera in a non-sandbox workspace to see motion events.
Example camera.activated event:
The event includes media_ids when event media is turned on for your workspace. video_url and image_url point to /media/get with format=redirect, and are included for compatibility. Use media_ids in new integrations.

5 — Retrieve Event Recordings

If you enter the Tapo account password when you connect a real camera, Seam retrieves the camera’s microSD recording of each motion event. The event’s media_ids list a video clip and a thumbnail, which you fetch with /media/get. The returned url expires within minutes, and the media’s expires_at is 7 days after Seam stores the clip. The camera needs a microSD card and Third-Party Compatibility turned on in the Tapo app. For the full flow, see Retrieve Event Media and Tapo event recordings. The sandbox camera accepts the sandbox Tapo account password so that you can test the Connect Webview, but it has no microSD recordings, so its media would end in the unavailable status.

6 — Stream Live Video

You can stream a Tapo camera’s live video to a browser over WebRTC when its can_stream_live_video capability flag is true and live video is turned on for your workspace. The flag means the camera supports live video and is online. It doesn’t reflect whether live video is turned on for your workspace: if it isn’t, /cameras/live_views/create returns a camera_not_available error. The flag is false while the camera or its Seam Bridge is offline. Live view uses a client session token scoped to the camera, so your users’ browsers never see your API key. For the full flow, see Stream Live Video.

Next Steps

Now that you’ve completed this guide, you can try to connect a real Tapo camera. To do so, make sure to switch to a non-sandbox workspace and API key, as real devices cannot be connected to sandbox workspaces. See the Tapo Setup Guide for the Seam Bridge and Camera Account steps. In addition, if you’d like to explore other aspects of Seam, here is a list of helpful resources: If you have any questions or want to report an issue, email us at support@seam.co.