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.

Packageagno (the toolkit is built in, no Anakin package needed)
Importfrom agno.tools.anakin import AnakinTools
Sourcelibs/agno/agno/tools/anakin.py
Cookbookcookbook/91_tools/anakin_tools.py
Added inAgno v3.1.3 (changelog post)
TypeToolkit
Tools4

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_interval seconds (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_time seconds (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 → answer

Setup

1. Get your API key

  1. Sign up at anakin.io/signup
  2. Go to your Dashboard
  3. Copy your API key (starts with ask_)

2. Install Agno

pip install -U agno

Also 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.

MethodFlagOn by defaultAnakin endpoint
scrape_urlenable_scrapeYesPOST /v1/url-scraper
crawl_websiteenable_crawlNoPOST /v1/crawl
map_websiteenable_mapNoPOST /v1/map
search_webenable_searchNoPOST /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 default

Toolkit options

OptionTypeDefaultDescription
api_keystrANAKIN_API_KEY env varYour Anakin API key
enable_scrapeboolTrueEnable scrape_url
enable_crawlboolFalseEnable crawl_website
enable_mapboolFalseEnable map_website
enable_searchboolFalseEnable search_web
allboolFalseEnable all four tools. Overrides the individual flags
countrystr"us"Default proxy country for scrape and crawl. Any code from supported countries
timeoutint60Timeout in seconds for each HTTP request
poll_intervalfloat2Seconds between job status checks
max_wait_timefloat120Most seconds to wait for a job before returning a timeout error
api_base_urlstrhttps://api.anakin.io/v1Anakin 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.

ParameterTypeRequiredDefaultDescription
urlstrYesThe URL to scrape
generate_jsonboolNoFalseAlso extract structured JSON from the page with AI
use_browserboolNoFalseRender in a headless browser, for SPAs and JavaScript-heavy pages
countrystrNotoolkit countryTwo-letter proxy country code for this call

crawl_website

Crawl from a starting URL and return markdown for every page reached.

ParameterTypeRequiredDefaultDescription
urlstrYesThe starting URL
max_pagesintNo10Most pages to fetch
depthintNo1Link hops to follow from the starting URL
include_patternslist[str]NoOnly fetch URLs matching one of these glob patterns
exclude_patternslist[str]NoSkip URLs matching any of these glob patterns
use_browserboolNoFalseRender each page in a headless browser
countrystrNotoolkit countryTwo-letter proxy country code for this call

map_website

Discover the URLs reachable from a starting URL, without fetching their content.

ParameterTypeRequiredDefaultDescription
urlstrYesThe starting URL, usually a homepage or section root
limitintNo100Most URLs to return overall
depthintNo2Link hops to follow
limit_per_levelintNo100Most URLs to collect per depth level
include_external_linksboolNoFalseAlso collect (but don't follow) links to other sites
include_subdomainsboolNoFalseInclude URLs on subdomains of the starting host
searchstrNoOnly return URLs whose path or title matches this keyword
use_browserboolNoFalseRender in a headless browser

search_web

Search the web and return result URLs, titles, and snippets. This is synchronous, with no job to poll.

ParameterTypeRequiredDefaultDescription
querystrYesThe search query, in natural language
limitintNo5Most 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

SymptomCauseFix
Error: ANAKIN_API_KEY not setNo key in the env or constructorexport ANAKIN_API_KEY=... or pass api_key=
Error scraping ...: 401 ...Invalid API keyCopy a fresh key from the Dashboard
Error ...: 402 ...Out of credits or plan limitSee Pricing
Error ...: 429 ...Rate limitSlow down, or see Rate limits
Job ... was still 'processing' after 120sThe job outlived max_wait_timeRaise max_wait_time, or lower max_pages on crawls
Agent never calls a toolTool not enabled, or instructions don't mention web tasksCheck the enable_* flags and say in instructions when to use each tool
Empty or partial page contentThe page renders with JavaScriptHave the agent retry with use_browser=True

Learn more


Stay updated