anakin-sdk (Rust)
Official Rust SDK for Anakin — web scraping, crawling, search, and Wire actions.
Status: alpha (v0.1.x). Public API may change between minor versions until v1.0.
Install
[]
= "0.1"
= { = "1", = ["full"] }
The crate name on crates.io is anakin-sdk; the import name is anakin.
Requires Rust 1.70+.
Quickstart
use Client;
async
The SDK polls long-running jobs internally — await resolves with the final result. No job IDs to manage, no polling loops to write.
Method overview
| Method | Endpoint | Sync? |
|---|---|---|
client.scrape(url) / scrape_with(url, opts) |
POST /url-scraper → poll |
async |
client.map(url) / map_with(url, opts) |
POST /map → poll |
async |
client.crawl(url) / crawl_with(url, opts) |
POST /crawl → poll |
async |
client.search(query) / search_with(query, opts) |
POST /search |
sync |
client.agentic_search(prompt) / agentic_search_with(...) |
POST /agentic-search → poll |
async |
client.wire(action_id, params) |
POST /holocron/task → poll |
async |
client.sessions().list/create/save/update/delete |
/browser-sessions/* |
various |
anakin::supported_countries() |
offline (bundled) | sync |
Configuration
use Duration;
let client = builder
.api_key // or ANAKIN_API_KEY env var
.base_url
.timeout
.max_retries // on 429 / 5xx / transient
.poll_interval // initial polling delay
.poll_max_interval // capped backoff
.poll_timeout // total poll budget
.build?;
Errors
All errors come back as variants of anakin::Error:
use Error;
match client.scrape.await
The error enum:
| Variant | When |
|---|---|
Error::Authentication |
401 — invalid or missing API key |
Error::InsufficientCredits |
402 — out of credits (with balance, required) |
Error::InvalidRequest |
400 — validation failure |
Error::RateLimit |
429 — after retry budget exhausted (with retry_after) |
Error::JobFailed |
Polled job came back with status="failed" (with reason) |
Error::JobTimeout |
Polling budget exhausted before terminal status |
Error::Server |
5xx — after retries exhausted |
Error::Network |
DNS / connect / read-timeout |
Error::Other |
Decoding failures, missing fields |
Build from source
Related packages
@anakin-io/sdk— Node.js / TypeScript SDKanakin-sdk— Python SDKgithub.com/Anakin-Inc/anakin-go— Go SDKio.anakin:anakin-sdk— Java SDKanakin-sdk(rubygems) — Ruby SDKAnakin(NuGet) — .NET SDK@anakin-io/mcp— Model Context Protocol server for AI agents