> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tinyfish.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# TinyAgent Tutorial

> Run your first TinyAgent automation in the Playground or with the API

## Target

You'll run one automation that visits a live store and returns the first two
product names and prices as structured JSON — no selectors, no scraping
rules, just a goal in plain English. Pick a tab below: through the
Playground, or with the API.

```json Expected result theme={null}
{
  "products": [
    { "name": "Bulbasaur", "price": "£63.00" },
    { "name": "Ivysaur", "price": "£87.00" }
  ]
}
```

## Steps to do

> [tab] Playground
>
> **1. Sign up or log in**
>
> Go to [agent.tinyfish.ai](https://agent.tinyfish.ai) and click **Sign up** —
> or **Sign in** if you already have an account. New accounts start
> with \$8 of free usage, no credit card required.
>
> ![TinyFish homepage with the Sign up button in the top right](https://mintcdn.com/tinyfish/6Yr77veemMps6Ft4/images/agent-tutorial/01-homepage-signup.png?fit=max\&auto=format\&n=6Yr77veemMps6Ft4\&q=85\&s=f7d00258f646619456596100dc66ef96)
>
> Click **Sign up** in the top right of the homepage.
>
> Create an account with GitHub, Google, Microsoft, X, or just an email address.
>
> ![TinyFish create account screen with social sign-in options and an email field](https://mintcdn.com/tinyfish/6Yr77veemMps6Ft4/images/agent-tutorial/02-create-account.png?fit=max\&auto=format\&n=6Yr77veemMps6Ft4\&q=85\&s=5fd1e699e76e0bc82b0b89181251688b)
>
> Pick a sign-in method, or enter your email and click **Continue**.
>
> **2. Open the Agent Playground**
>
> After signing in you land on your console. Click **Agent** — either
> under **Playground** in the left sidebar, or the **Agent** card in
> the middle of the page.
>
> ![TinyFish console home page with both Agent entry points highlighted: the sidebar link and the Agent card](https://mintcdn.com/tinyfish/6Yr77veemMps6Ft4/images/agent-tutorial/03-console-home.png?fit=max\&auto=format\&n=6Yr77veemMps6Ft4\&q=85\&s=a03c33b908cffd0fabe6b31c1c404b1e)
>
> Two ways in: the **Agent** link in the sidebar, or the **Agent** card below.
>
> **3. Describe your task**
>
> The Agent Playground asks what you want the agent to do.
>
> ![Agent Playground with an empty goal field, ready for input](https://mintcdn.com/tinyfish/6Yr77veemMps6Ft4/images/agent-tutorial/04-agent-playground-empty.png?fit=max\&auto=format\&n=6Yr77veemMps6Ft4\&q=85\&s=2b1fe2d8e9ef0fd231fffbcb04a50833)
>
> The goal box is where you describe the task, in plain English.
>
> **4. Type your goal, then Run**
>
> There's one box, not separate URL and instruction fields — include
> the site right in the goal:
> `Get to https://scrapeme.live/shop/ and extract the first 2 product
>                 names and prices. Return as JSON.` Then click **Run**.
>
> ![Agent Playground with the goal field filled in and the Run button highlighted](https://mintcdn.com/tinyfish/6Yr77veemMps6Ft4/images/agent-tutorial/05-agent-playground-goal-filled.png?fit=max\&auto=format\&n=6Yr77veemMps6Ft4\&q=85\&s=bffec82575c2f206290f3c8aaeb52a82)
>
> One box for the whole goal, URL included — then click **Run**.
>
> **5. Watch it run live**
>
> The Playground streams the browser live while the agent works,
> checking off each step of its plan as it completes it.
>
> ![Agent run in progress, showing a live view of the browser navigating the target page](https://mintcdn.com/tinyfish/6Yr77veemMps6Ft4/images/agent-tutorial/06-run-live.png?fit=max\&auto=format\&n=6Yr77veemMps6Ft4\&q=85\&s=2eb495ee3d015debc74f94e3fc29e4e4)
>
> Watch the live browser view update in real time as the agent works.
>
> **6. Read the result**
>
> Once every step is checked off, the run is complete.
>
> ![Completed agent run with every plan step checked off](https://mintcdn.com/tinyfish/6Yr77veemMps6Ft4/images/agent-tutorial/07-run-steps-complete.png?fit=max\&auto=format\&n=6Yr77veemMps6Ft4\&q=85\&s=ee205929b14e3e15f2e4b7e2fe1f1ff7)
>
> Each plan step gets a checkmark as the agent finishes it.
>
> The result appears below — as raw JSON, the same shape shown above:
>
> ![Agent run result shown as raw JSON matching the expected output](https://mintcdn.com/tinyfish/6Yr77veemMps6Ft4/images/agent-tutorial/08-result-json.png?fit=max\&auto=format\&n=6Yr77veemMps6Ft4\&q=85\&s=5d774f538807f860e30fc68a1101c837)
>
> Default view: the raw JSON result. Click the eye icon to switch views.
>
> or toggle to a readable table for the same data:
>
> ![Agent run result shown as a readable product table](https://mintcdn.com/tinyfish/6Yr77veemMps6Ft4/images/agent-tutorial/09-result-table.png?fit=max\&auto=format\&n=6Yr77veemMps6Ft4\&q=85\&s=07fa9b7c1d2db8bcdd7e5ae8127b8b8e)
>
> Table view of the same result — handy for a quick human read.

> [tab] API
>
> **1. Get an API key**
>
> Create one at [API Keys](https://agent.tinyfish.ai/api-keys), then
> store it in your environment:
>
> ```bash theme={null}
> export TINYFISH_API_KEY="your_api_key_here"
> ```
>
> **2. Call the TinyAgent API**
>
> ```python Python theme={null}
> from tinyfish import TinyFish
>
> client = TinyFish()  # Reads TINYFISH_API_KEY from environment
>
> with client.agent.stream(
>     url="https://scrapeme.live/shop",
>     goal="Extract the first 2 product names and prices. Return as JSON.",
> ) as stream:
>     for event in stream:
>         print(event)
> ```
>
> ```typescript TypeScript theme={null}
> import { TinyFish } from "@tiny-fish/sdk";
>
> const client = new TinyFish();  // Reads TINYFISH_API_KEY from environment
>
> const stream = await client.agent.stream({
>   url: "https://scrapeme.live/shop",
>   goal: "Extract the first 2 product names and prices. Return as JSON.",
> });
>
> for await (const event of stream) {
>   console.log(event);
> }
> ```
>
> ```bash cURL theme={null}
> curl -N -X POST https://agent.tinyfish.ai/v1/automation/run-sse \
>   -H "X-API-Key: $TINYFISH_API_KEY" \
>   -H "Content-Type: application/json" \
>   -d '{
>     "url": "https://scrapeme.live/shop",
>     "goal": "Extract the first 2 product names and prices. Return as JSON."
>   }'
> ```
>
> **3. Read the result**
>
> The final `COMPLETE` event carries your result:
>
> ```json theme={null}
> {"type":"COMPLETE","run_id":"abc123","status":"COMPLETED","result":{"products":[{"name":"Bulbasaur","price":"£63.00"},{"name":"Ivysaur","price":"£87.00"}]}}
> ```

## Next Steps

> [card] [How-to Guides](https://docs.tinyfish.ai/agent/how-to)
>
> Structured output, multiple URLs, Vault logins, and Agent Mode

> [card] [TinyAgent Reference](https://docs.tinyfish.ai/agent/api)
>
> All endpoints across Agent, Runs, Profiles, and Vault

> [card] [Runs](https://docs.tinyfish.ai/agent/explanation/runs.md)
>
> Understand status, polling, and completion

> [card] [Goal prompting guide](https://docs.tinyfish.ai/prompting-guide.md)
>
> Write more reliable automation instructions


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.