Appearance
Usage
All examples require TINYFISH_API_KEY set in your environment.
Agent API - Python
Stream a natural-language goal against a live website. The agent navigates, clicks, and extracts data autonomously.
python
from tinyfish import TinyFish, CompleteEvent
client = TinyFish()
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:
if isinstance(event, CompleteEvent):
print(event.result_json)Agent API - TypeScript
typescript
import { TinyFish } from "@tiny-fish/sdk";
const client = new TinyFish();
const stream = await client.agent.stream({
url: "https://scrapeme.live/shop",
goal: "Extract the first 2 product names and prices",
});
for await (const event of stream) {
if (event.type === "COMPLETE") console.log(event.result);
}CLI - Run an agent task
bash
tinyfish agent run "Extract the first 2 product names and prices" \
--url https://scrapeme.live/shop --prettyAPI Surfaces at a Glance
| API | Typical use | Credits consumed |
|---|---|---|
| Search | Fresh structured web results | 0 (free tier) |
| Fetch | Render any URL to markdown/JSON/HTML | 0 (free tier) |
| Agent | Multi-step automation: fill forms, log in, extract | 1 credit per step |
| Browser | Raw stealth Chromium CDP session | 1 credit per 4 min |
Browser Context Profiles
Browser context profiles persist logged-in state across agent runs. Create a profile once, reuse it for authenticated workflows without re-logging in on each run.
Cookbook
Real-world, runnable examples live in the open-source cookbook: https://github.com/tinyfish-io/tinyfish-cookbook