Skip to main content
1

Create a TinyFish account

Sign up for a new TinyFish account here.
2

Get your API key

  1. Go to the API Keys page
  2. Click “Create API Key”
  3. Copy and store your key securely in your .env file
API keys are shown only once. Store them securely and never commit them to version control.
.env
TINYFISH_API_KEY=sk-tinyfish-*****
3

Write code for your first workflow

We’ll write the minimal code to navigate to a website and extract product data using natural language.
# first_automation.py
from tinyfish import TinyFish

client = TinyFish()  # Reads TINYFISH_API_KEY from environment

# Stream the automation and print each event as it arrives
with client.agent.stream(
    url="https://scrapeme.live/shop",  # Target website to automate
    goal="Extract the first 2 product names and prices",  # Natural language instruction
) as stream:
    for event in stream:
        print(event)
4

Run your first workflow

Run the code with the following command:
python first_automation.py
5

Verify output

You should see SSE events streaming in your terminal:
{'type': 'STARTED', 'run_id': 'abc123'}
{'type': 'STREAMING_URL', 'run_id': 'abc123', 'streaming_url': 'https://tf-abc123.fra0-tinyfish.unikraft.app/stream/0'}
{'type': 'PROGRESS', 'run_id': 'abc123', 'purpose': 'Visit the page to extract product information'}
{'type': 'PROGRESS', 'run_id': 'abc123', 'purpose': 'Check for product information on the page'}
{'type': 'COMPLETE', 'run_id': 'abc123', 'status': 'COMPLETED', 'result': {
  "products": [
    { "name": "Bulbasaur", "price": "$63.00" },
    { "name": "Ivysaur", "price": "$87.00" },
  ]
}}
With --pretty, the CLI output looks like:
▶ Run started
• Visit the page to extract product information
• Check for product information on the page
✓ Completed

{"products": [{"name": "Bulbasaur", "price": "$63.00"}, {"name": "Ivysaur", "price": "$87.00"}]}

View run: https://agent.tinyfish.ai/runs/abc123

Next Steps

API Reference

Complete endpoint documentation

Examples

Copy-paste ready code