diff --git a/src/config/navigation.yml b/src/config/navigation.yml index 1a1738214..c0f7563f9 100644 --- a/src/config/navigation.yml +++ b/src/config/navigation.yml @@ -227,6 +227,7 @@ sidebar: - docs/community/tools/utcp - label: Tools items: + - docs/community/tools/strands-apify - docs/community/tools/strands-deepgram - docs/community/tools/strands-hubspot - docs/community/tools/strands-teams diff --git a/src/content/docs/community/tools/strands-apify.mdx b/src/content/docs/community/tools/strands-apify.mdx new file mode 100644 index 000000000..383b33523 --- /dev/null +++ b/src/content/docs/community/tools/strands-apify.mdx @@ -0,0 +1,86 @@ +--- +project: + pypi: https://pypi.org/project/strands-apify/ + github: https://github.com/apify/strands-apify + maintainer: apify +service: + name: Apify + link: https://apify.com/ +title: strands-apify +community: true +description: "Web scraping, social media (Instagram, LinkedIn, Twitter/X, TikTok, Facebook), search (Google, Maps, YouTube), and e-commerce via Apify Actors." +integrationType: tool +languages: Python +sidebar: + label: "apify" +--- + + +[strands-apify](https://github.com/apify/strands-apify) gives your Strands agent web scraping, search, crawling, e-commerce, and social media capabilities through the [Apify platform](https://apify.com/) and its library of thousands of pre-built Actors. + +## Installation + + +```bash +pip install strands-apify +``` + + + +## Usage + + +```python +from strands import Agent +from strands_apify import APIFY_CORE_TOOLS, APIFY_SEARCH_TOOLS, APIFY_SOCIAL_TOOLS + +# Core: run any Actor, run saved tasks, fetch datasets, scrape a URL to markdown +agent = Agent(tools=APIFY_CORE_TOOLS) +agent("Scrape https://docs.apify.com and summarize the page") + +# Search & crawling: Google, Maps, YouTube, multi-page crawling, e-commerce +agent = Agent(tools=APIFY_SEARCH_TOOLS) +agent("Find the top-rated Italian restaurants in Prague with reviews") + +# Social media: Instagram, LinkedIn, Twitter/X, TikTok, Facebook +agent = Agent(tools=APIFY_SOCIAL_TOOLS) +agent("Scrape the top 10 posts for the hashtag #apify on Instagram") +``` + + +Pick individual tools or mix tool sets for a smaller, more focused agent - LLMs select tools more accurately when fewer are in context: + +```python +from strands import Agent +from strands_apify import apify_scrape_url, apify_google_search_scraper, apify_instagram_scraper + +agent = Agent(tools=[apify_scrape_url, apify_google_search_scraper, apify_instagram_scraper]) +agent("Search Google for 'example topic', scrape the top result, and find related Instagram posts") +``` + + +## Key Features + +- **Core scraping & automation**: run any Apify Actor, execute saved tasks, fetch dataset items, and scrape single URLs to markdown +- **Search**: Google Search, Google Maps, and YouTube with structured results +- **Crawling**: multi-page website crawling with configurable depth and page limits +- **E-commerce**: product data from Amazon, eBay, Walmart, and other listing pages +- **Social media**: Instagram, LinkedIn (posts, search, profile detail), Twitter/X, TikTok, and Facebook +- **Three focused tool sets**: `APIFY_CORE_TOOLS` (6), `APIFY_SEARCH_TOOLS` (5), `APIFY_SOCIAL_TOOLS` (7), or `APIFY_ALL_TOOLS` (18, for prototyping) + +## Configuration + + +```bash +APIFY_TOKEN=your_apify_token_here # Required +``` + + +Get your Apify token at: [Apify Console > Settings > API & Integrations](https://console.apify.com/account/integrations) + +## Resources + +- [PyPI Package](https://pypi.org/project/strands-apify/) +- [GitHub Repository](https://github.com/apify/strands-apify) +- [Apify Store](https://apify.com/store) +- [Apify API Reference](https://docs.apify.com/api/v2) diff --git a/src/content/docs/user-guide/concepts/tools/community-tools-package.mdx b/src/content/docs/user-guide/concepts/tools/community-tools-package.mdx index 3ff6de81e..5abf9f792 100644 --- a/src/content/docs/user-guide/concepts/tools/community-tools-package.mdx +++ b/src/content/docs/user-guide/concepts/tools/community-tools-package.mdx @@ -53,6 +53,11 @@ pip install 'strands-agents-tools[rss]' pip install 'strands-agents-tools[use_computer]' ``` +- [apify](/docs/community/tools/strands-apify/) +```python +pip install 'strands-agents-tools[apify]' +``` + ## Available Tools #### RAG & Memory @@ -114,6 +119,16 @@ pip install 'strands-agents-tools[use_computer]' - [`batch`](https://github.com/strands-agents/tools/blob/main/src/strands_tools/batch.py): Call multiple tools from a single model request - [`a2a_client`](https://github.com/strands-agents/tools/blob/main/src/strands_tools/a2a_client.py): Enable agent-to-agent communication +#### Apify +- [`apify_run_actor`](https://github.com/strands-agents/tools/blob/main/src/strands_tools/apify/apify_run_actor.py): Run any Apify Actor with custom input +- [`apify_scrape_url`](https://github.com/strands-agents/tools/blob/main/src/strands_tools/apify/apify_scrape_url.py): Scrape a single URL and return markdown +- [`apify_google_search_scraper`](https://github.com/strands-agents/tools/blob/main/src/strands_tools/apify/apify_google_search_scraper.py): Search Google and return structured results +- [`apify_website_content_crawler`](https://github.com/strands-agents/tools/blob/main/src/strands_tools/apify/apify_website_content_crawler.py): Crawl a website and extract content from multiple pages +- [`apify_instagram_scraper`](https://github.com/strands-agents/tools/blob/main/src/strands_tools/apify/apify_instagram_scraper.py): Scrape Instagram profiles, posts, reels, or hashtags +- [`apify_twitter_scraper`](https://github.com/strands-agents/tools/blob/main/src/strands_tools/apify/apify_twitter_scraper.py): Scrape tweets by search query or specific URLs +- ...and 12 more tools for datasets, tasks, Google Maps, YouTube, e-commerce, LinkedIn, TikTok, and Facebook + + ## Tool Consent and Bypassing By default, certain tools that perform potentially sensitive operations (like file modifications, shell commands, or code execution) will prompt for user confirmation before executing. This safety feature ensures users maintain control over actions that could modify their system.