Prerequisites
- Python 3.9 or later
- A running Figranium instance (
http://localhost:11345by default) - An API key generated from the Figranium web UI
1
Install the SDK
figranium (the import name) plus its only runtime dependency, httpx. See Installation for optional extras.2
Create a client
Store your API key in an environment variable so it never lands in source control.See Client configuration for every constructor option and Authentication for API key setup.
quickstart.py
3
4
Run the task
Use
run_task (a shortcut for client.tasks.run) and pass runtime variable overrides in input.quickstart.py
5
Handle errors
Every HTTP, transport, and timeout failure raises See Errors for the full list of codes.
FigraniumError. Inspect code and status to branch on the failure kind.quickstart.py
Complete example
quickstart.py
Direct execution without saving
For one-off runs, skiptasks.save and call client.scrape, client.agent, or client.headful directly. These use the same Task shape, but the server does not persist them.
direct_scrape.py
Next steps
Action helpers
Every helper you can use to build a task, from navigation to CAPTCHA solving.
Streaming
Iterate over live executions with
client.executions.stream().Handle errors
FigraniumError fields, codes, and cancellation semantics.Tasks resource
Save, version, list, and run tasks programmatically.