curl -X POST {{baseUrl}}/api/tools?org_id=your-org-id \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Apify",
"description": "Web crawling and scraping tool",
"category_id": "6a5b4c3d-2e1f-0g9h-8i7j-6k5l4m3n2o1p",
"is_active": true,
"version": "2",
"logo_url": "",
"is_public": true,
"configuration": [
{
"name": "api_key",
"type": "str",
"description": "The API key for the Apify service",
"required": true,
"default": null
},
{
"name": "website_content_crawler",
"type": "bool",
"description": "",
"required": false,
"default": "True"
}
],
"inputs": [
{
"name": "urls",
"type": "str",
"description": "The URLs to crawl.",
"required": true,
"default": null
},
{
"name": "timeout",
"type": "int",
"description": "The timeout for the crawling.",
"required": false,
"default": "60"
}
],
"outputs": {
"type": "str",
"description": "A string with the crawled content"
},
"settings": {
"function_info": {
"name": "Apify Tool",
"is_async": true,
"description": "Crawls a website using Apify's website-content-crawler actor",
"code": "import aiohttp\\n\\nasync def run(self, urls: str, timeout: int | None = \\\"60\\\"):\\n\\n \\\"\\\"\\\"\\n Run the tool with the provided parameters.\\n @param urls The URLs to crawl. (required)\\n @param timeout The timeout for the crawling. (optional) (default: \\\"60\\\")\\n \\n Returns:\\n dict: The result of the tool execution\\n \\\"\\\"\\\"\\n \\n if self.api_key is None:\\n return \\\"No API key provided\\\"\\n\\n client = ApifyClient(self.api_key)\\n\\n log_debug(f\\\"Crawling URLs: {urls}\\\")\\n\\n formatted_urls = [{\\\"url\\\": url} for url in urls]\\n\\n run_input = {\\\"startUrls\\\": formatted_urls}\\n\\n run = client.actor(\\\"apify/website-content-crawler\\\").call(run_input=run_input, timeout_secs=timeout)\\n\\n results: str = \\\"\\\"\\n\\n for item in client.dataset(run[\\\"defaultDatasetId\\\"]).iterate_items():\\n results += \\\"Results for URL: \\\" + item.get(\\\"url\\\") + \\\"\\\\n\\\"\\n results += item.get(\\\"text\\\") + \\\"\\\\n\\\"\\n\\n return results\\n"
},
"requirements": [
"apify_client"
],
"deployment": {
"framework": "agno",
"toolkit_class": true,
"standalone_function": false
}
}
}'