Skip to main content
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. TinyFish live browser preview showing the fish navigating a webpage

Getting the Streaming URL

When you use the SSE endpoint, one of the events you’ll receive is STREAMING_URL:
{
  "type": "STREAMING_URL",
  "run_id": "abc123",
  "streaming_url": "https://tf-abc123.fra0-tinyfish.unikraft.app/stream/0"
}
This URL is valid for 24 hours after the run completes.

Embedding It

Once you have the URL, embed it in an iframe:
<iframe
  src="YOUR_STREAMING_URL"
  width="100%"
  height="600"
  style="border: 1px solid #e5e7eb; border-radius: 8px;"
></iframe>
For a responsive container that maintains a 16:9 aspect ratio:
<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;">
  <iframe
    src="YOUR_STREAMING_URL"
    style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; border-radius: 8px;"
  ></iframe>
</div>

Full Example

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.
// Start automation and embed the live preview
const response = await fetch("https://agent.tinyfish.ai/v1/automation/run-sse", {
  method: "POST",
  headers: {
    "X-API-Key": "YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    url: "https://example.com/products",
    goal: "Extract all product names and prices",
  }),
});

// Parse SSE events to find the streaming URL
for await (const chunk of response.body) {
  const text = new TextDecoder().decode(chunk);
  for (const line of text.split("\n")) {
    if (!line.startsWith("data: ")) continue;
    const event = JSON.parse(line.slice(6));

    if (event.type === "STREAMING_URL") {
      // Set iframe src to show the live browser
      document.getElementById("preview").src = event.streaming_url;
    }
  }
}

Tips

  • 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.