Expected result
Get your API key
- Go to the API Keys page
- Click “Create API Key”
- Save the key to your shell environment so the SDKs and CLI can read it automatically
Install the SDK
Install the package for your language. The SDKs and CLI read
TINYFISH_API_KEY from your environment, so there’s nothing else to configure.Write your automation
Create a file with the minimal code to navigate to the store and extract
product data using natural language. (cURL users can skip straight to the
next step.)
Verify the output
What you see depends on how you ran the automation.Python, TypeScript, and cURL stream raw Server-Sent Events as the agent works. The final The CLI consumes the same events but the Either way, the
COMPLETE event carries your result:--pretty flag renders them as a readable summary instead of raw JSON:result is the same structured payload — pick whichever format fits your workflow.Troubleshooting
Missing dependency or command not found
Missing dependency or command not found
The package isn’t installed for the language you’re running.
- Python —
ModuleNotFoundError: No module named 'tinyfish'→pip install tinyfish - TypeScript —
Cannot find module '@tiny-fish/sdk'→npm i @tiny-fish/sdk - CLI —
command not found: tinyfish→npm install -g @tiny-fish/cli
pip install fails on macOS
pip install fails on macOS
Homebrew Python (3.11+) blocks system-wide You only need to run the first two lines once per project. After that, just
pip install by default (PEP 668), so you’ll see error: externally-managed-environment. Create a virtual environment first, then install:source .venv/bin/activate to re-enter the environment.tsx fails with ERR_PACKAGE_PATH_NOT_EXPORTED
tsx fails with ERR_PACKAGE_PATH_NOT_EXPORTED
@tiny-fish/sdk ships as ESM only, but tsx defaults to CommonJS, so you’ll see Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined. Tell Node to treat your project as ESM by adding "type": "module" to package.json:npx tsx first-automation.ts.Invalid or missing API key
Invalid or missing API key
Requests fail with a
401 or an authentication error.- Confirm the key is set:
echo $TINYFISH_API_KEYshould print a value starting withsk-tinyfish-. If it’s empty, re-run theexportcommand from the “Get your API key” step above. - If the key is wrong or lost, generate a new one on the API Keys page — keys are shown only once on creation, so you can’t recover an old one.
Insufficient credits
Insufficient credits
The run is rejected because your workspace is out of credits.
- Top up credits, or switch to a workspace that has them, then retry.
- See Authentication for the full error shape.
Next Steps
Where you go next depends on what you’re trying to build.| Your goal | Start here |
|---|---|
| Building an app on the API | Agent API Reference |
| Need stable, predictable output | Structured Output |
| Real-world scraping examples | Examples |
| Hard sites or bot protection | Anti-Bot Guide · Browser Profiles |
Agent API Reference
Streaming, async runs, and endpoint selection
Structured Output
Get consistent JSON shaped to your schema
Examples
Copy-paste ready code for real use cases
Anti-Bot Guide
Handle protected and high-friction sites