Embed a real-time browser view in your app using the streaming URL
Every TinyFish automation provides a streaming_url, a live feed of the browser as it runs. Drop it in an iframe to show users what’s happening in real time.You’ll see our little fish swimming through the web for you, navigating pages, clicking buttons, and extracting data while you watch.
Start an automation, listen for the STREAMING_URL event in the SSE stream, and set it as the iframe source to display the live browser.
import { TinyFish, EventType } from "@tiny-fish/sdk";const client = new TinyFish();const stream = await client.agent.stream( { url: "https://example.com/products", goal: "Extract all product names and prices", }, { onStreamingUrl: (event) => { // Set iframe src to show the live browser const iframe = document.getElementById("preview"); if (iframe) { iframe.setAttribute("src", event.streaming_url); } }, },);for await (const event of stream) { if (event.type === EventType.COMPLETE) { console.log("Result:", event.result); }}
from tinyfish import TinyFish, StreamingUrlEventclient = TinyFish()with client.agent.stream( url="https://example.com/products", goal="Extract all product names and prices",) as stream: for event in stream: if isinstance(event, StreamingUrlEvent): # Use this URL in an iframe to show the live browser print("Embed this:", event.streaming_url) break
Keep your API key server-side. Call the SSE endpoint from your backend and pass the streaming_url to the frontend. The streaming URL itself is safe to expose to the browser.
Show a loading state. The streaming URL arrives a few seconds after the automation starts, so show a spinner or placeholder until then.
The iframe is read-only. Users can watch but can’t interact with the browser session.