Agno
Give Agno agents scrape, crawl, map, and web search with AnakinTools, the Anakin toolkit built into the Agno SDK.
AnakinTools is a toolkit that ships inside the Agno SDK. Add it to an agent and the model can scrape a page, crawl a site, map a site's URLs, and search the web, each with one tool call.
| Package | agno (the toolkit is built in, no Anakin package needed) |
| Import | from agno.tools.anakin import AnakinTools |
| Source | libs/agno/agno/tools/anakin.py |
| Cookbook | cookbook/91_tools/anakin_tools.py |
| Added in | Agno v3.1.3 (changelog post) |
| Type | Toolkit |
| Tools | 4 |
How it works
The toolkit calls the Anakin REST API directly with httpx, which Agno already depends on, so there is no vendor SDK to install.
- Scrape, crawl, and map are async jobs on Anakin. The toolkit submits the job, polls it every
poll_intervalseconds (2 by default), and hands the finished result back to the model. The model makes one tool call and gets page content or links back. - Search is a single synchronous request.
- Failures come back as text. A job that fails, or is still running after
max_wait_timeseconds (120 by default), returns an error string the model can read and react to, instead of raising.
User → "Summarize this page" → Agno agent → scrape_url → POST /v1/url-scraper → poll GET /v1/url-scraper/{id} → markdown → model → answerSetup
1. Get your API key
- Sign up at anakin.io/signup
- Go to your Dashboard
- Copy your API key (starts with
ask_)
2. Install Agno
pip install -U agnoAlso install the SDK for the model provider your agent uses (for example openai or anthropic).
3. Set the key
export ANAKIN_API_KEY="ask_your-key-here"You can also pass it directly: AnakinTools(api_key="ask_...").
4. Run your first agent
from agno.agent import Agent
from agno.tools.anakin import AnakinTools
agent = Agent(tools=[AnakinTools(all=True)], markdown=True)
agent.print_response("Scrape https://docs.agno.com/introduction/ and summarize it")
agent.print_response("Search the web for the latest on 'AI agent frameworks'")
agent.print_response("List the URLs reachable from https://docs.agno.com")The examples on this page leave out model= to stay short. Set it to choose your LLM; see Agno's model docs.
Choosing tools
Only scrape_url is on by default. Turn on the others with their flag, or pass all=True for all four.
| Method | Flag | On by default | Anakin endpoint |
|---|---|---|---|
scrape_url | enable_scrape | Yes | POST /v1/url-scraper |
crawl_website | enable_crawl | No | POST /v1/crawl |
map_website | enable_map | No | POST /v1/map |
search_web | enable_search | No | POST /v1/search |
Give the agent only the tools its job needs. A shorter tool list means fewer wrong tool choices, and a crawl the model didn't need still spends credits.
# Search and read pages, but never crawl a whole site
AnakinTools(enable_search=True) # scrape_url stays on by defaultToolkit options
| Option | Type | Default | Description |
|---|---|---|---|
api_key | str | ANAKIN_API_KEY env var | Your Anakin API key |
enable_scrape | bool | True | Enable scrape_url |
enable_crawl | bool | False | Enable crawl_website |
enable_map | bool | False | Enable map_website |
enable_search | bool | False | Enable search_web |
all | bool | False | Enable all four tools. Overrides the individual flags |
country | str | "us" | Default proxy country for scrape and crawl. Any code from supported countries |
timeout | int | 60 | Timeout in seconds for each HTTP request |
poll_interval | float | 2 | Seconds between job status checks |
max_wait_time | float | 120 | Most seconds to wait for a job before returning a timeout error |
api_base_url | str | https://api.anakin.io/v1 | Anakin API base URL |
Tools
The model fills in these parameters from the conversation and your agent's instructions. Each tool returns a JSON string with the finished Anakin response, or an error string.
scrape_url
Scrape one URL and return its markdown, plus structured JSON if asked.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
url | str | Yes | The URL to scrape | |
generate_json | bool | No | False | Also extract structured JSON from the page with AI |
use_browser | bool | No | False | Render in a headless browser, for SPAs and JavaScript-heavy pages |
country | str | No | toolkit country | Two-letter proxy country code for this call |
crawl_website
Crawl from a starting URL and return markdown for every page reached.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
url | str | Yes | The starting URL | |
max_pages | int | No | 10 | Most pages to fetch |
depth | int | No | 1 | Link hops to follow from the starting URL |
include_patterns | list[str] | No | Only fetch URLs matching one of these glob patterns | |
exclude_patterns | list[str] | No | Skip URLs matching any of these glob patterns | |
use_browser | bool | No | False | Render each page in a headless browser |
country | str | No | toolkit country | Two-letter proxy country code for this call |
map_website
Discover the URLs reachable from a starting URL, without fetching their content.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
url | str | Yes | The starting URL, usually a homepage or section root | |
limit | int | No | 100 | Most URLs to return overall |
depth | int | No | 2 | Link hops to follow |
limit_per_level | int | No | 100 | Most URLs to collect per depth level |
include_external_links | bool | No | False | Also collect (but don't follow) links to other sites |
include_subdomains | bool | No | False | Include URLs on subdomains of the starting host |
search | str | No | Only return URLs whose path or title matches this keyword | |
use_browser | bool | No | False | Render in a headless browser |
search_web
Search the web and return result URLs, titles, and snippets. This is synchronous, with no job to poll.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
query | str | Yes | The search query, in natural language | |
limit | int | No | 5 | Most results to return |
Use cases
Research agent: search, then read the sources
Search finds candidates, and scraping reads them in full, so the answer rests on the pages themselves rather than on search snippets.
from agno.agent import Agent
from agno.tools.anakin import AnakinTools
researcher = Agent(
tools=[AnakinTools(enable_search=True)],
instructions=[
"Use search_web to find primary sources for the question.",
"Use scrape_url to read the 2-3 most relevant results in full.",
"Answer only from what you scraped, and cite the URL for every claim.",
],
markdown=True,
)
researcher.print_response("What changed in the EU AI Act timeline this year?")Docs assistant: map a site, then crawl the right section
map_website is cheap discovery. Use it to find where the relevant pages live, then crawl only that section with include_patterns.
docs_agent = Agent(
tools=[AnakinTools(enable_map=True, enable_crawl=True, max_wait_time=300)],
instructions=[
"First use map_website to see how the site is organized.",
"Then use crawl_website with include_patterns to fetch only the section you need.",
"Keep max_pages at 25 or less.",
],
markdown=True,
)
docs_agent.print_response(
"How does authentication work in the docs at https://docs.example.com? Give me the steps."
)Crawls take longer than single scrapes, so this example raises max_wait_time to 300 seconds.
Structured extraction from product pages
generate_json=True returns structured data next to the markdown, which is easier for the model to compare than raw page text.
shopper = Agent(
tools=[AnakinTools()],
instructions=[
"Scrape each product URL with generate_json=true.",
"Compare price, rating, and key specs in one table.",
],
markdown=True,
)
shopper.print_response(
"Compare https://example.com/product-a and https://example.com/product-b"
)Geo-targeted pricing checks
Prices, availability, and content often change by country. Set a default with country, and the model can still override it per call.
geo_agent = Agent(
tools=[AnakinTools(country="gb")],
instructions=[
"Scrape pricing pages through the UK by default.",
"When the user names another country, pass its two-letter code as country.",
],
markdown=True,
)
geo_agent.print_response("What does https://example.com/pricing cost in the UK and in India?")JavaScript-heavy sites
If a page comes back empty or half-rendered, it probably builds its content with JavaScript. Tell the agent when to use the browser:
Agent(
tools=[AnakinTools()],
instructions=["If a scrape returns little or no content, retry it with use_browser=true."],
)Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
Error: ANAKIN_API_KEY not set | No key in the env or constructor | export ANAKIN_API_KEY=... or pass api_key= |
Error scraping ...: 401 ... | Invalid API key | Copy a fresh key from the Dashboard |
Error ...: 402 ... | Out of credits or plan limit | See Pricing |
Error ...: 429 ... | Rate limit | Slow down, or see Rate limits |
Job ... was still 'processing' after 120s | The job outlived max_wait_time | Raise max_wait_time, or lower max_pages on crawls |
| Agent never calls a tool | Tool not enabled, or instructions don't mention web tasks | Check the enable_* flags and say in instructions when to use each tool |
| Empty or partial page content | The page renders with JavaScript | Have the agent retry with use_browser=True |
Learn more
- Agno changelog: AnakinTools
- Agno documentation
- Anakin API reference
- How Anakin jobs and polling work
Stay updated
- Discord: discord.gg/T57dHrdT8u
- Email: support@anakin.io