ApifyTools enable an Agent to access the Apify API and run actors.

Prerequisites

The following example requires the apify-client library and an API token which can be obtained from Apify.

pip install -U apify-client
export MY_APIFY_TOKEN=***

Example

The following agent will use Apify to crawl the webpage: https://docs.phidata.com/introduction and summarize it.

cookbook/tools/apify_tools.py
from phi.agent import Agent
from phi.tools.apify import ApifyTools

agent = Agent(tools=[ApifyTools()], show_tool_calls=True)
agent.print_response("Tell me about https://docs.phidata.com/introduction", markdown=True)

Toolkit Params

ParameterTypeDefaultDescription
api_keystr-API key for authentication purposes.
website_content_crawlerboolTrueEnables the functionality to crawl a website using website-content-crawler actor.
web_scraperboolFalseEnables the functionality to crawl a website using web_scraper actor.

Toolkit Functions

FunctionDescription
website_content_crawlerCrawls a website using Apify’s website-content-crawler actor.
web_scrapperScrapes a website using Apify’s web-scraper actor.