From e482050fe3493552a59dc3fd9881b414218331d6 Mon Sep 17 00:00:00 2001 From: David Omrai Date: Tue, 31 Mar 2026 15:54:00 +0200 Subject: [PATCH 1/5] docs: write strands-agents apify doc --- .../integrations/ai/strands-agents.md | 257 ++++++++++++++++++ 1 file changed, 257 insertions(+) create mode 100644 sources/platform/integrations/ai/strands-agents.md diff --git a/sources/platform/integrations/ai/strands-agents.md b/sources/platform/integrations/ai/strands-agents.md new file mode 100644 index 0000000000..a49725af94 --- /dev/null +++ b/sources/platform/integrations/ai/strands-agents.md @@ -0,0 +1,257 @@ +--- +title: Strands Agents SDK integration +sidebar_label: Strands Agents SDK +description: >- + Learn how to integrate Apify with the Strands Agents SDK to give your + AI agents web scraping, search, and social media capabilities. +sidebar_position: 20 +slug: /integrations/strands-agents +--- + +The [Strands Agents SDK](https://github.com/strands-agents/sdk-python) is an open-source Python SDK by AWS for building AI agents. It provides a simple model-tools-prompt pattern where the SDK handles the agentic loop: sending prompts to the model, executing tool calls, and feeding results back until the task is complete. + +The [Apify integration for Strands](https://pypi.org/project/strands-agents-tools/) provides 18 ready-made tools across three presets that give your agents web scraping, search, crawling, and social media scraping capabilities through the Apify platform. + +## Prerequisites + +- **Python 3.10+** +- **Apify API token** - Get yours from the **Integrations** section in [Apify Console](https://console.apify.com/account/integrations) +- **A model provider** - Strands supports multiple providers (Amazon Bedrock, OpenAI, Anthropic, Ollama, and more). You need at least one configured. +- **Required packages**: + + ```bash + pip install strands-agents strands-agents-tools[apify] + ``` + +## Configure your model provider + +Strands supports multiple model providers with a single-line swap. Install the provider extra and create a model instance. + +### OpenAI + +```bash +pip install 'strands-agents[openai]' +``` + +```python +import os +from strands.models.openai import OpenAIModel + +model = OpenAIModel( + client_args={"api_key": os.getenv("OPENAI_API_KEY")}, + model_id="gpt-4o", +) +``` + +### Anthropic + +```bash +pip install 'strands-agents[anthropic]' +``` + +```python +import os +from strands.models.anthropic import AnthropicModel + +model = AnthropicModel( + client_args={"api_key": os.getenv("ANTHROPIC_API_KEY")}, + model_id="claude-sonnet-4-20250514", + max_tokens=1024, +) +``` + +### Ollama (local) + +```bash +pip install 'strands-agents[ollama]' +ollama pull qwen3.5 +``` + +```python +from strands.models.ollama import OllamaModel + +model = OllamaModel(host="http://localhost:11434", model_id="qwen3.5") +``` + +:::tip Other providers + +Strands also supports Amazon Bedrock (the default provider), Google Gemini, LiteLLM, and LMStudio. See the [Strands model providers documentation](https://strandsagents.com/latest/user-guide/concepts/model-providers/overview/) for the full list. + +::: + +## Use Apify tools with Strands Agents + +### Set up the environment + +Export your Apify API token: + +```bash +export APIFY_API_TOKEN=your_api_token_here +``` + +### Import tool presets + +The integration provides three tool presets: + +| Preset | Tools | Capabilities | +|--------|-------|--------------| +| `APIFY_CORE_TOOLS` | 6 | Run Actors, run tasks, fetch datasets, scrape URLs | +| `APIFY_SEARCH_TOOLS` | 5 | Google Search, Google Maps, YouTube, website crawling, e-commerce | +| `APIFY_SOCIAL_TOOLS` | 7 | Instagram, LinkedIn, Twitter/X, TikTok, Facebook | + +Import a preset and pass it to an agent: + +```python +from strands import Agent +from strands_tools.apify import APIFY_CORE_TOOLS + +agent = Agent(model=model, tools=APIFY_CORE_TOOLS) +``` + +You can also import individual tools for a more focused agent: + +```python +from strands_tools.apify import apify_scrape_url, apify_google_search_scraper + +agent = Agent(model=model, tools=[apify_scrape_url, apify_google_search_scraper]) +``` + +:::tip Focused tool sets + +Keep the tool set small and relevant to the task. Registering too many tools at once can overwhelm the model, leading to degraded reasoning or incorrect tool selection. + +::: + +### Build a web research agent + +This example creates an agent that searches Google and then scrapes the top result to produce a summary: + +```python +import os +from strands import Agent +from strands.models.openai import OpenAIModel +from strands_tools.apify import apify_google_search_scraper, apify_scrape_url + +model = OpenAIModel( + client_args={"api_key": os.getenv("OPENAI_API_KEY")}, + model_id="gpt-4o", +) + +agent = Agent(model=model, tools=[apify_google_search_scraper, apify_scrape_url]) + +agent( + "Search Google for 'Strands Agents SDK AWS' and return the top 3 results. " + "Then scrape the first result and summarize the page content." +) +``` + +The agent automatically chains the two tools: it runs a Google search first, then scrapes the top result URL and produces a summary. + +### Build a social media monitoring agent + +This example uses the social media preset to scrape recent posts from a Twitter/X account: + +```python +import os +from strands import Agent +from strands.models.openai import OpenAIModel +from strands_tools.apify import apify_twitter_scraper, apify_instagram_scraper + +model = OpenAIModel( + client_args={"api_key": os.getenv("OPENAI_API_KEY")}, + model_id="gpt-4o", +) + +agent = Agent(model=model, tools=[apify_twitter_scraper, apify_instagram_scraper]) + +agent("Find the latest 10 tweets mentioning #WebScraping and summarize the main topics.") +``` + +### Combine tool presets + +Mix presets or pick individual tools from different groups to match your use case: + +```python +from strands_tools.apify import APIFY_CORE_TOOLS, apify_instagram_scraper + +agent = Agent( + model=model, + tools=[*APIFY_CORE_TOOLS, apify_instagram_scraper], +) +``` + +## Available tools + +### Core tools (`APIFY_CORE_TOOLS`) + +- `apify_run_actor` - Run any [Apify Actor](https://apify.com/store) by ID with custom input +- `apify_get_dataset_items` - Fetch items from an Apify dataset with pagination +- `apify_run_actor_and_get_dataset` - Run an Apify Actor and fetch its dataset results in one call +- `apify_run_task` - Run a saved [Actor task](/platform/actors/running/tasks) with optional input overrides +- `apify_run_task_and_get_dataset` - Run a task and fetch its dataset results in one call +- `apify_scrape_url` - Scrape a single URL using [Website Content Crawler](https://apify.com/apify/website-content-crawler) and return markdown + +### Search and crawling tools (`APIFY_SEARCH_TOOLS`) + +- `apify_google_search_scraper` - Search Google and return structured results using [Google Search Scraper](https://apify.com/apify/google-search-scraper) +- `apify_google_places_scraper` - Search Google Maps for businesses and places using [Google Maps Scraper](https://apify.com/compass/crawler-google-places) +- `apify_youtube_scraper` - Scrape YouTube videos, channels, or search results using [YouTube Scraper](https://apify.com/streamers/youtube-scraper) +- `apify_website_content_crawler` - Crawl a website and extract content from multiple pages using [Website Content Crawler](https://apify.com/apify/website-content-crawler) +- `apify_ecommerce_scraper` - Scrape product data from e-commerce sites using [E-commerce Scraping Tool](https://apify.com/apify/e-commerce-scraping-tool) + +### Social media tools (`APIFY_SOCIAL_TOOLS`) + +- `apify_instagram_scraper` - Scrape Instagram profiles, posts, reels, or hashtags using [Instagram Scraper](https://apify.com/apify/instagram-scraper) +- `apify_linkedin_profile_posts` - Scrape recent posts from a LinkedIn profile using [LinkedIn Profile Posts](https://apify.com/apimaestro/linkedin-profile-posts) +- `apify_linkedin_profile_search` - Search for LinkedIn profiles by keywords using [LinkedIn Profile Search](https://apify.com/harvestapi/linkedin-profile-search) +- `apify_linkedin_profile_detail` - Get detailed LinkedIn profile information using [LinkedIn Profile Detail](https://apify.com/apimaestro/linkedin-profile-detail) +- `apify_twitter_scraper` - Scrape tweets by search query or specific URLs using [Twitter Scraper Lite](https://apify.com/apidojo/twitter-scraper-lite) +- `apify_tiktok_scraper` - Scrape TikTok videos, profiles, or hashtags using [TikTok Scraper](https://apify.com/clockworks/tiktok-scraper) +- `apify_facebook_posts_scraper` - Scrape posts from a Facebook page or profile using [Facebook Posts Scraper](https://apify.com/apify/facebook-posts-scraper) + +For full parameter details on each tool, see the [Strands Apify tools documentation](https://strandsagents.com/latest/user-guide/concepts/tools/built-in-tools/apify/). + +## Troubleshooting + +| Problem | Cause | Fix | +|---------|-------|-----| +| `APIFY_API_TOKEN environment variable is not set` | Token not configured | Run `export APIFY_API_TOKEN=your_token` before executing your script | +| `apify-client package is required` | Missing dependency | Run `pip install strands-agents-tools[apify]` | +| Actor run finishes with status `FAILED` | Invalid input or Actor error | Check the Actor input parameters and run logs in [Apify Console](https://console.apify.com) | +| Actor run finishes with status `TIMED-OUT` | Timeout too short for the workload | Increase the `timeout_secs` parameter (use 600+ for large crawls) | +| Agent selects the wrong tool | Too many tools registered | Reduce the number of tools, make the prompt more specific, or use a more capable model | +| Empty results from social media tools | Private or geo-restricted profile | Verify the profile is public. Test with a known public account first. | + +## Full example + +```python +import os + +from strands import Agent +from strands.models.openai import OpenAIModel +from strands_tools.apify import apify_google_search_scraper, apify_scrape_url + +# Configure the model +model = OpenAIModel( + client_args={"api_key": os.getenv("OPENAI_API_KEY")}, + model_id="gpt-4o", +) + +# Create an agent with search and scraping tools +agent = Agent(model=model, tools=[apify_google_search_scraper, apify_scrape_url]) + +# Run a multi-step research task +agent( + "Search Google for 'Strands Agents SDK AWS' and return the top 3 results. " + "Then scrape the first result and summarize the page content in 3 bullet points." +) +``` + +## Resources + +- [Strands Agents SDK documentation](https://strandsagents.com/) +- [Strands Agents SDK GitHub repository](https://github.com/strands-agents/sdk-python) +- [Strands Agents Tools on PyPI](https://pypi.org/project/strands-agents-tools/) +- [Strands Agents Tools GitHub repository](https://github.com/strands-agents/tools) +- [Apify Store](https://apify.com/store) - Browse 4,000+ ready-made Actors +- [Apify API reference](https://docs.apify.com/api/v2) From d601de42bd28657ceb51faaa2f333f5cac8fa4dd Mon Sep 17 00:00:00 2001 From: David Omrai Date: Thu, 14 May 2026 18:25:58 +0200 Subject: [PATCH 2/5] docs: update strands agents integration doc --- .../integrations/ai/strands-agents.md | 267 +++++++++--------- 1 file changed, 139 insertions(+), 128 deletions(-) diff --git a/sources/platform/integrations/ai/strands-agents.md b/sources/platform/integrations/ai/strands-agents.md index a49725af94..0b990c9546 100644 --- a/sources/platform/integrations/ai/strands-agents.md +++ b/sources/platform/integrations/ai/strands-agents.md @@ -1,6 +1,6 @@ --- -title: Strands Agents SDK integration -sidebar_label: Strands Agents SDK +title: Strands Agents integration +sidebar_label: Strands Agents description: >- Learn how to integrate Apify with the Strands Agents SDK to give your AI agents web scraping, search, and social media capabilities. @@ -8,29 +8,55 @@ sidebar_position: 20 slug: /integrations/strands-agents --- -The [Strands Agents SDK](https://github.com/strands-agents/sdk-python) is an open-source Python SDK by AWS for building AI agents. It provides a simple model-tools-prompt pattern where the SDK handles the agentic loop: sending prompts to the model, executing tool calls, and feeding results back until the task is complete. +## What is Strands Agents? -The [Apify integration for Strands](https://pypi.org/project/strands-agents-tools/) provides 18 ready-made tools across three presets that give your agents web scraping, search, crawling, and social media scraping capabilities through the Apify platform. +[Strands Agents](https://github.com/strands-agents/sdk-python) is an open-source Python SDK by AWS for building AI agents. It uses a simple model-tools-prompt pattern where the SDK runs the agentic loop for you. The SDK sends the prompt to your model, executes any tool calls the model requests, and feeds the results back until the task is complete. -## Prerequisites +:::note Explore Strands Agents -- **Python 3.10+** -- **Apify API token** - Get yours from the **Integrations** section in [Apify Console](https://console.apify.com/account/integrations) -- **A model provider** - Strands supports multiple providers (Amazon Bedrock, OpenAI, Anthropic, Ollama, and more). You need at least one configured. -- **Required packages**: +For more details, check out the [Strands Agents documentation](https://strandsagents.com/). - ```bash - pip install strands-agents strands-agents-tools[apify] - ``` +::: + +## How to use Apify with Strands Agents + +The [strands-apify](https://pypi.org/project/strands-apify/) package plugs Apify into the Strands agentic loop. It ships 18 ready-made tools grouped into three focused tool sets. Your agent can scrape, crawl, search, and pull social media data through the [Apify platform](https://apify.com/) without writing any HTTP or scraping code. + +### Prerequisites + +- _Python 3.10 or newer_. +- _Apify API token_: Get one from the [Integrations](https://console.apify.com/account/integrations) page in Apify Console. +- _Model provider_: Strands works with Amazon Bedrock, OpenAI, Anthropic, Google Gemini, Ollama (local), LiteLLM, and LMStudio. Pick one before you continue. + +### Installation + +Install the Strands SDK and the Apify tools: + +```bash +pip install strands-agents strands-apify +``` + +Export your Apify token so the tools can authenticate: + +```bash +export APIFY_TOKEN=your_apify_token_here +``` + +:::tip Keep your token out of source code + +Use a `.env` file or your secrets manager in production. Never commit `APIFY_TOKEN` to a repository. + +::: -## Configure your model provider +### Configure your model provider -Strands supports multiple model providers with a single-line swap. Install the provider extra and create a model instance. +Strands swaps model providers with a one-line change. Install the matching extra, set the provider's API key, and create a `model` instance to pass to your agent. -### OpenAI +#### OpenAI ```bash pip install 'strands-agents[openai]' +export OPENAI_API_KEY=your_openai_key ``` ```python @@ -43,10 +69,11 @@ model = OpenAIModel( ) ``` -### Anthropic +#### Anthropic ```bash pip install 'strands-agents[anthropic]' +export ANTHROPIC_API_KEY=your_anthropic_key ``` ```python @@ -55,12 +82,14 @@ from strands.models.anthropic import AnthropicModel model = AnthropicModel( client_args={"api_key": os.getenv("ANTHROPIC_API_KEY")}, - model_id="claude-sonnet-4-20250514", + model_id="claude-sonnet-4-5", max_tokens=1024, ) ``` -### Ollama (local) +#### Ollama (local) + +Run models on your own machine, with no API key required: ```bash pip install 'strands-agents[ollama]' @@ -75,62 +104,81 @@ model = OllamaModel(host="http://localhost:11434", model_id="qwen3.5") :::tip Other providers -Strands also supports Amazon Bedrock (the default provider), Google Gemini, LiteLLM, and LMStudio. See the [Strands model providers documentation](https://strandsagents.com/latest/user-guide/concepts/model-providers/overview/) for the full list. +Strands also supports Amazon Bedrock (the default), Google Gemini, LiteLLM, and LMStudio. See the [Strands model providers documentation](https://strandsagents.com/latest/user-guide/concepts/model-providers/overview/) for the full list. ::: -## Use Apify tools with Strands Agents +### Build your first agent -### Set up the environment +With the model configured, you can build an agent in three lines. This one scrapes a single URL and summarizes it: -Export your Apify API token: +```python +from strands import Agent +from strands_apify import apify_scrape_url -```bash -export APIFY_API_TOKEN=your_api_token_here +agent = Agent(model=model, tools=[apify_scrape_url]) + +agent("Scrape https://docs.apify.com and summarize the page in three bullet points.") ``` -### Import tool presets +The agent calls `apify_scrape_url` under the hood, returns markdown to the model, and the model produces the summary. -The integration provides three tool presets: +### Choose the right tool set -| Preset | Tools | Capabilities | -|--------|-------|--------------| -| `APIFY_CORE_TOOLS` | 6 | Run Actors, run tasks, fetch datasets, scrape URLs | -| `APIFY_SEARCH_TOOLS` | 5 | Google Search, Google Maps, YouTube, website crawling, e-commerce | -| `APIFY_SOCIAL_TOOLS` | 7 | Instagram, LinkedIn, Twitter/X, TikTok, Facebook | +`strands-apify` provides 18 tools split across three tool sets: -Import a preset and pass it to an agent: +| Tool set | Tools | Use case | +| -------------------- | ----- | --------------------------------------------------------------------------------------- | +| `APIFY_CORE_TOOLS` | 6 | Run any Actor or saved task, fetch dataset items, scrape single URLs to markdown | +| `APIFY_SEARCH_TOOLS` | 5 | Google Search, Google Maps, YouTube, multi-page website crawling, e-commerce | +| `APIFY_SOCIAL_TOOLS` | 7 | Instagram, LinkedIn, Twitter/X, TikTok, Facebook | -```python -from strands import Agent -from strands_tools.apify import APIFY_CORE_TOOLS +LLMs select tools based on names and descriptions, so the more tools an agent has in context, the larger the decision space it must reason over. That can lead to wrong tool selection, slower responses, and higher token usage. Register only the tools your agent actually needs. -agent = Agent(model=model, tools=APIFY_CORE_TOOLS) -``` +You have three ways to import tools: -You can also import individual tools for a more focused agent: +1. Import a whole tool set when your agent needs the full category: -```python -from strands_tools.apify import apify_scrape_url, apify_google_search_scraper + ```python + from strands import Agent + from strands_apify import APIFY_CORE_TOOLS -agent = Agent(model=model, tools=[apify_scrape_url, apify_google_search_scraper]) -``` + agent = Agent(model=model, tools=APIFY_CORE_TOOLS) + ``` + +1. Import individual tools for the tightest control: + + ```python + from strands_apify import apify_scrape_url, apify_google_search_scraper + + agent = Agent(model=model, tools=[apify_scrape_url, apify_google_search_scraper]) + ``` + +1. Mix tool sets with individual tools when you need most of one category plus a tool from another: + + ```python + from strands_apify import APIFY_CORE_TOOLS, apify_twitter_scraper + + agent = Agent(model=model, tools=[*APIFY_CORE_TOOLS, apify_twitter_scraper]) + ``` -:::tip Focused tool sets +:::caution Avoid `APIFY_ALL_TOOLS` in production -Keep the tool set small and relevant to the task. Registering too many tools at once can overwhelm the model, leading to degraded reasoning or incorrect tool selection. +`APIFY_ALL_TOOLS` bundles every tool from all three tool sets. It's handy for prototyping, but registering 18 tools at once measurably degrades model accuracy. Trim down to a focused set before you ship. ::: -### Build a web research agent +## Examples -This example creates an agent that searches Google and then scrapes the top result to produce a summary: +### Web research agent + +This agent searches Google, then scrapes the top result and summarizes it. The model chains the two tool calls automatically: ```python import os from strands import Agent from strands.models.openai import OpenAIModel -from strands_tools.apify import apify_google_search_scraper, apify_scrape_url +from strands_apify import apify_google_search_scraper, apify_scrape_url model = OpenAIModel( client_args={"api_key": os.getenv("OPENAI_API_KEY")}, @@ -141,117 +189,80 @@ agent = Agent(model=model, tools=[apify_google_search_scraper, apify_scrape_url] agent( "Search Google for 'Strands Agents SDK AWS' and return the top 3 results. " - "Then scrape the first result and summarize the page content." + "Then scrape the first result and summarize the page content in 3 bullet points." ) ``` -The agent automatically chains the two tools: it runs a Google search first, then scrapes the top result URL and produces a summary. - -### Build a social media monitoring agent +### Social media monitoring agent -This example uses the social media preset to scrape recent posts from a Twitter/X account: +This agent pulls recent tweets and Instagram posts on a topic: ```python -import os from strands import Agent -from strands.models.openai import OpenAIModel -from strands_tools.apify import apify_twitter_scraper, apify_instagram_scraper - -model = OpenAIModel( - client_args={"api_key": os.getenv("OPENAI_API_KEY")}, - model_id="gpt-4o", -) +from strands_apify import apify_twitter_scraper, apify_instagram_scraper agent = Agent(model=model, tools=[apify_twitter_scraper, apify_instagram_scraper]) agent("Find the latest 10 tweets mentioning #WebScraping and summarize the main topics.") ``` -### Combine tool presets +### Run any Actor from Apify Store -Mix presets or pick individual tools from different groups to match your use case: +The pre-built tools cover the most common use cases, but [Apify Store](https://apify.com/store) has 4,000+ Actors. Use `apify_run_actor_and_get_dataset` to give your agent access to any of them. Pass the Actor ID and its input schema: ```python -from strands_tools.apify import APIFY_CORE_TOOLS, apify_instagram_scraper +from strands import Agent +from strands_apify import apify_run_actor_and_get_dataset + +agent = Agent(model=model, tools=[apify_run_actor_and_get_dataset]) -agent = Agent( - model=model, - tools=[*APIFY_CORE_TOOLS, apify_instagram_scraper], +agent( + "Run the Apify Actor 'apify/rag-web-browser' with input " + "{\"query\": \"latest AI safety research\", \"maxResults\": 5} " + "and summarize the results." ) ``` -## Available tools - -### Core tools (`APIFY_CORE_TOOLS`) +For long-running Actors (large crawls, datasets with thousands of items), increase the `timeout_secs` parameter. The default is 300 seconds. -- `apify_run_actor` - Run any [Apify Actor](https://apify.com/store) by ID with custom input -- `apify_get_dataset_items` - Fetch items from an Apify dataset with pagination -- `apify_run_actor_and_get_dataset` - Run an Apify Actor and fetch its dataset results in one call -- `apify_run_task` - Run a saved [Actor task](/platform/actors/running/tasks) with optional input overrides -- `apify_run_task_and_get_dataset` - Run a task and fetch its dataset results in one call -- `apify_scrape_url` - Scrape a single URL using [Website Content Crawler](https://apify.com/apify/website-content-crawler) and return markdown - -### Search and crawling tools (`APIFY_SEARCH_TOOLS`) +## Available tools -- `apify_google_search_scraper` - Search Google and return structured results using [Google Search Scraper](https://apify.com/apify/google-search-scraper) -- `apify_google_places_scraper` - Search Google Maps for businesses and places using [Google Maps Scraper](https://apify.com/compass/crawler-google-places) -- `apify_youtube_scraper` - Scrape YouTube videos, channels, or search results using [YouTube Scraper](https://apify.com/streamers/youtube-scraper) -- `apify_website_content_crawler` - Crawl a website and extract content from multiple pages using [Website Content Crawler](https://apify.com/apify/website-content-crawler) -- `apify_ecommerce_scraper` - Scrape product data from e-commerce sites using [E-commerce Scraping Tool](https://apify.com/apify/e-commerce-scraping-tool) +Each tool below links to its underlying Actor on Apify Store. For parameter details, see the [strands-apify GitHub repository](https://github.com/apify/strands-apify). -### Social media tools (`APIFY_SOCIAL_TOOLS`) +| `APIFY_CORE_TOOLS` | `APIFY_SEARCH_TOOLS` | `APIFY_SOCIAL_TOOLS` | +| ------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `apify_run_actor` | [`apify_google_search_scraper`](https://apify.com/apify/google-search-scraper) | [`apify_instagram_scraper`](https://apify.com/apify/instagram-scraper) | +| `apify_get_dataset_items` | [`apify_google_places_scraper`](https://apify.com/compass/crawler-google-places) | [`apify_linkedin_profile_posts`](https://apify.com/apimaestro/linkedin-profile-posts) | +| `apify_run_actor_and_get_dataset` | [`apify_youtube_scraper`](https://apify.com/streamers/youtube-scraper) | [`apify_linkedin_profile_search`](https://apify.com/harvestapi/linkedin-profile-search) | +| `apify_run_task` | [`apify_website_content_crawler`](https://apify.com/apify/website-content-crawler) | [`apify_linkedin_profile_detail`](https://apify.com/apimaestro/linkedin-profile-detail) | +| `apify_run_task_and_get_dataset` | [`apify_ecommerce_scraper`](https://apify.com/apify/e-commerce-scraping-tool) | [`apify_twitter_scraper`](https://apify.com/apidojo/twitter-scraper-lite) | +| [`apify_scrape_url`](https://apify.com/apify/website-content-crawler) | | [`apify_tiktok_scraper`](https://apify.com/clockworks/tiktok-scraper) | +| | | [`apify_facebook_posts_scraper`](https://apify.com/apify/facebook-posts-scraper) | -- `apify_instagram_scraper` - Scrape Instagram profiles, posts, reels, or hashtags using [Instagram Scraper](https://apify.com/apify/instagram-scraper) -- `apify_linkedin_profile_posts` - Scrape recent posts from a LinkedIn profile using [LinkedIn Profile Posts](https://apify.com/apimaestro/linkedin-profile-posts) -- `apify_linkedin_profile_search` - Search for LinkedIn profiles by keywords using [LinkedIn Profile Search](https://apify.com/harvestapi/linkedin-profile-search) -- `apify_linkedin_profile_detail` - Get detailed LinkedIn profile information using [LinkedIn Profile Detail](https://apify.com/apimaestro/linkedin-profile-detail) -- `apify_twitter_scraper` - Scrape tweets by search query or specific URLs using [Twitter Scraper Lite](https://apify.com/apidojo/twitter-scraper-lite) -- `apify_tiktok_scraper` - Scrape TikTok videos, profiles, or hashtags using [TikTok Scraper](https://apify.com/clockworks/tiktok-scraper) -- `apify_facebook_posts_scraper` - Scrape posts from a Facebook page or profile using [Facebook Posts Scraper](https://apify.com/apify/facebook-posts-scraper) +## Tips for production -For full parameter details on each tool, see the [Strands Apify tools documentation](https://strandsagents.com/latest/user-guide/concepts/tools/built-in-tools/apify/). +- Tune `timeout_secs` on Actor runs. The default of 300 seconds is fine for small jobs. Raise it to 600+ when crawling large sites or scraping high-volume datasets. +- Paginate datasets with `apify_get_dataset_items` using `limit` and `offset` instead of fetching everything in one call when results can run into the thousands. +- Pin Actor versions when stability matters. Use `actor_id` in the form `username/actor-name:1.2.3` to lock to a specific build. +- Watch Actor costs in [Apify Console](https://console.apify.com/). Agentic loops can call Actors multiple times per user request. Set a billing limit if you're concerned. +- Keep tool sets small. If your agent only needs to search Google and scrape one URL, register exactly those two tools, not `APIFY_SEARCH_TOOLS` or `APIFY_ALL_TOOLS`. ## Troubleshooting -| Problem | Cause | Fix | -|---------|-------|-----| -| `APIFY_API_TOKEN environment variable is not set` | Token not configured | Run `export APIFY_API_TOKEN=your_token` before executing your script | -| `apify-client package is required` | Missing dependency | Run `pip install strands-agents-tools[apify]` | -| Actor run finishes with status `FAILED` | Invalid input or Actor error | Check the Actor input parameters and run logs in [Apify Console](https://console.apify.com) | -| Actor run finishes with status `TIMED-OUT` | Timeout too short for the workload | Increase the `timeout_secs` parameter (use 600+ for large crawls) | -| Agent selects the wrong tool | Too many tools registered | Reduce the number of tools, make the prompt more specific, or use a more capable model | -| Empty results from social media tools | Private or geo-restricted profile | Verify the profile is public. Test with a known public account first. | - -## Full example - -```python -import os - -from strands import Agent -from strands.models.openai import OpenAIModel -from strands_tools.apify import apify_google_search_scraper, apify_scrape_url - -# Configure the model -model = OpenAIModel( - client_args={"api_key": os.getenv("OPENAI_API_KEY")}, - model_id="gpt-4o", -) - -# Create an agent with search and scraping tools -agent = Agent(model=model, tools=[apify_google_search_scraper, apify_scrape_url]) - -# Run a multi-step research task -agent( - "Search Google for 'Strands Agents SDK AWS' and return the top 3 results. " - "Then scrape the first result and summarize the page content in 3 bullet points." -) -``` +| Problem | Cause | Fix | +| ----------------------------------------------- | ------------------------------------ | -------------------------------------------------------------------------------------------------- | +| `APIFY_TOKEN environment variable is not set` | Token not configured | Run `export APIFY_TOKEN=your_token` before executing your script. | +| `apify-client package is required` | Missing dependency | Run `pip install strands-apify`. | +| Actor run finishes with status `FAILED` | Invalid input or Actor error | Check the Actor input parameters and run logs in [Apify Console](https://console.apify.com). | +| Actor run finishes with status `TIMED-OUT` | Timeout too short for the workload | Increase the `timeout_secs` parameter (use 600+ for large crawls). | +| Agent selects the wrong tool | Too many tools registered | Reduce the number of tools, make the prompt more specific, or use a more capable model. | +| Empty results from social media tools | Private or geo-restricted profile | Verify the profile is public. Test with a known public account first. | ## Resources - [Strands Agents SDK documentation](https://strandsagents.com/) -- [Strands Agents SDK GitHub repository](https://github.com/strands-agents/sdk-python) -- [Strands Agents Tools on PyPI](https://pypi.org/project/strands-agents-tools/) -- [Strands Agents Tools GitHub repository](https://github.com/strands-agents/tools) -- [Apify Store](https://apify.com/store) - Browse 4,000+ ready-made Actors +- [Strands Agents GitHub repository](https://github.com/strands-agents/sdk-python) +- [strands-apify on PyPI](https://pypi.org/project/strands-apify/) +- [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) From ca58917e57119611726967f9b1a19679d8e371e6 Mon Sep 17 00:00:00 2001 From: David Omrai Date: Tue, 19 May 2026 17:16:58 +0200 Subject: [PATCH 3/5] docs: add Strands Agents SDK integration documentation and logo --- .../integrations/ai/strands-agents.md | 531 +++++++++++++++--- sources/platform/integrations/index.mdx | 6 + static/img/platform/integrations/strands.svg | 4 + 3 files changed, 462 insertions(+), 79 deletions(-) create mode 100644 static/img/platform/integrations/strands.svg diff --git a/sources/platform/integrations/ai/strands-agents.md b/sources/platform/integrations/ai/strands-agents.md index 0b990c9546..fa47bae277 100644 --- a/sources/platform/integrations/ai/strands-agents.md +++ b/sources/platform/integrations/ai/strands-agents.md @@ -1,6 +1,6 @@ --- -title: Strands Agents integration -sidebar_label: Strands Agents +title: Strands Agents SDK integration +sidebar_label: Strands Agents SDK description: >- Learn how to integrate Apify with the Strands Agents SDK to give your AI agents web scraping, search, and social media capabilities. @@ -8,27 +8,17 @@ sidebar_position: 20 slug: /integrations/strands-agents --- -## What is Strands Agents? +The [Strands Agents SDK](https://github.com/strands-agents/sdk-python) is an open-source Python SDK by AWS for building AI agents. It follows a model-tools-prompt pattern: the SDK sends the prompt to the model, executes any tool calls the model requests, and feeds the results back until the task is complete. -[Strands Agents](https://github.com/strands-agents/sdk-python) is an open-source Python SDK by AWS for building AI agents. It uses a simple model-tools-prompt pattern where the SDK runs the agentic loop for you. The SDK sends the prompt to your model, executes any tool calls the model requests, and feeds the results back until the task is complete. +The [strands-apify](https://pypi.org/project/strands-apify/) package provides 18 tools grouped into three tool sets, giving your agent scraping, crawling, search, and social media capabilities through the [Apify platform](https://apify.com/). -:::note Explore Strands Agents +## Prerequisites -For more details, check out the [Strands Agents documentation](https://strandsagents.com/). +- Python 3.10 or newer +- [An Apify account](https://console.apify.com) and API token from the [Integrations](https://console.apify.com/account/integrations) page in Apify Console +- At least one model provider configured. Strands supports Amazon Bedrock, OpenAI, Anthropic, Google Gemini, Ollama, LiteLLM, and LMStudio. -::: - -## How to use Apify with Strands Agents - -The [strands-apify](https://pypi.org/project/strands-apify/) package plugs Apify into the Strands agentic loop. It ships 18 ready-made tools grouped into three focused tool sets. Your agent can scrape, crawl, search, and pull social media data through the [Apify platform](https://apify.com/) without writing any HTTP or scraping code. - -### Prerequisites - -- _Python 3.10 or newer_. -- _Apify API token_: Get one from the [Integrations](https://console.apify.com/account/integrations) page in Apify Console. -- _Model provider_: Strands works with Amazon Bedrock, OpenAI, Anthropic, Google Gemini, Ollama (local), LiteLLM, and LMStudio. Pick one before you continue. - -### Installation +## Installation Install the Strands SDK and the Apify tools: @@ -36,7 +26,7 @@ Install the Strands SDK and the Apify tools: pip install strands-agents strands-apify ``` -Export your Apify token so the tools can authenticate: +Export your Apify token: ```bash export APIFY_TOKEN=your_apify_token_here @@ -48,11 +38,32 @@ Use a `.env` file or your secrets manager in production. Never commit `APIFY_TOK ::: -### Configure your model provider +## Environment variables + +The package reads the following environment variables: + +| Variable | Description | Required | +|---|---|---| +| `APIFY_TOKEN` | Apify API token used to authorize Actor runs and dataset reads. | Yes | +| `STRANDS_APIFY_QUIET` | Set to `1` to suppress the diagnostic panel printed on each tool call. Auto-suppressed in non-interactive environments. | No | + +## Configure your model provider + +Install the matching extra, set the provider's API key, and create a `model` instance to pass to your agent. -Strands swaps model providers with a one-line change. Install the matching extra, set the provider's API key, and create a `model` instance to pass to your agent. +### Amazon Bedrock -#### OpenAI +Bedrock is the default provider and ships with the base `strands-agents` install. Configure your AWS credentials with `aws configure` or environment variables before running your agent. See the [Bedrock provider docs](https://strandsagents.com/docs/user-guide/concepts/model-providers/amazon-bedrock/) for the full configuration reference. + +```python +from strands.models import BedrockModel + +model = BedrockModel(model_id="global.anthropic.claude-sonnet-4-6", region_name="us-west-2") +``` + +### OpenAI + +See the [OpenAI provider docs](https://strandsagents.com/docs/user-guide/concepts/model-providers/openai/) for the full configuration reference. ```bash pip install 'strands-agents[openai]' @@ -65,11 +76,13 @@ from strands.models.openai import OpenAIModel model = OpenAIModel( client_args={"api_key": os.getenv("OPENAI_API_KEY")}, - model_id="gpt-4o", + model_id="gpt-4.1", ) ``` -#### Anthropic +### Anthropic + +See the [Anthropic provider docs](https://strandsagents.com/docs/user-guide/concepts/model-providers/anthropic/) for the full configuration reference. ```bash pip install 'strands-agents[anthropic]' @@ -82,14 +95,14 @@ from strands.models.anthropic import AnthropicModel model = AnthropicModel( client_args={"api_key": os.getenv("ANTHROPIC_API_KEY")}, - model_id="claude-sonnet-4-5", + model_id="claude-sonnet-4-6", max_tokens=1024, ) ``` -#### Ollama (local) +### Ollama (local) -Run models on your own machine, with no API key required: +No API key required. See the [Ollama provider docs](https://strandsagents.com/docs/user-guide/concepts/model-providers/ollama/) for the full configuration reference. ```bash pip install 'strands-agents[ollama]' @@ -104,13 +117,13 @@ model = OllamaModel(host="http://localhost:11434", model_id="qwen3.5") :::tip Other providers -Strands also supports Amazon Bedrock (the default), Google Gemini, LiteLLM, and LMStudio. See the [Strands model providers documentation](https://strandsagents.com/latest/user-guide/concepts/model-providers/overview/) for the full list. +Strands also supports Google Gemini, LiteLLM, and LMStudio. See the [Strands model providers documentation](https://strandsagents.com/docs/user-guide/concepts/model-providers/) for the full list. ::: -### Build your first agent +## Quick start -With the model configured, you can build an agent in three lines. This one scrapes a single URL and summarizes it: +This example scrapes a single URL and summarizes it: ```python from strands import Agent @@ -121,9 +134,9 @@ agent = Agent(model=model, tools=[apify_scrape_url]) agent("Scrape https://docs.apify.com and summarize the page in three bullet points.") ``` -The agent calls `apify_scrape_url` under the hood, returns markdown to the model, and the model produces the summary. +The agent calls `apify_scrape_url`, returns markdown to the model, and the model produces the summary. -### Choose the right tool set +## Choose the right tool set `strands-apify` provides 18 tools split across three tool sets: @@ -133,38 +146,38 @@ The agent calls `apify_scrape_url` under the hood, returns markdown to the model | `APIFY_SEARCH_TOOLS` | 5 | Google Search, Google Maps, YouTube, multi-page website crawling, e-commerce | | `APIFY_SOCIAL_TOOLS` | 7 | Instagram, LinkedIn, Twitter/X, TikTok, Facebook | -LLMs select tools based on names and descriptions, so the more tools an agent has in context, the larger the decision space it must reason over. That can lead to wrong tool selection, slower responses, and higher token usage. Register only the tools your agent actually needs. +LLMs select tools based on their names and descriptions. More tools means a larger decision space, which can lead to wrong tool selection, slower responses, and higher token usage. Register only the tools your agent needs. -You have three ways to import tools: +Three ways to import tools: 1. Import a whole tool set when your agent needs the full category: - ```python - from strands import Agent - from strands_apify import APIFY_CORE_TOOLS +```python +from strands import Agent +from strands_apify import APIFY_CORE_TOOLS - agent = Agent(model=model, tools=APIFY_CORE_TOOLS) - ``` +agent = Agent(model=model, tools=APIFY_CORE_TOOLS) +``` -1. Import individual tools for the tightest control: +1. Import individual tools for tighter control: - ```python - from strands_apify import apify_scrape_url, apify_google_search_scraper +```python +from strands_apify import apify_scrape_url, apify_google_search_scraper - agent = Agent(model=model, tools=[apify_scrape_url, apify_google_search_scraper]) - ``` +agent = Agent(model=model, tools=[apify_scrape_url, apify_google_search_scraper]) +``` -1. Mix tool sets with individual tools when you need most of one category plus a tool from another: +1. Mix tool sets with individual tools: - ```python - from strands_apify import APIFY_CORE_TOOLS, apify_twitter_scraper +```python +from strands_apify import APIFY_CORE_TOOLS, apify_twitter_scraper - agent = Agent(model=model, tools=[*APIFY_CORE_TOOLS, apify_twitter_scraper]) - ``` +agent = Agent(model=model, tools=[*APIFY_CORE_TOOLS, apify_twitter_scraper]) +``` :::caution Avoid `APIFY_ALL_TOOLS` in production -`APIFY_ALL_TOOLS` bundles every tool from all three tool sets. It's handy for prototyping, but registering 18 tools at once measurably degrades model accuracy. Trim down to a focused set before you ship. +`APIFY_ALL_TOOLS` bundles every tool from all three tool sets. Registering 18 tools at once degrades model accuracy. Use a focused tool set in production. ::: @@ -172,7 +185,7 @@ You have three ways to import tools: ### Web research agent -This agent searches Google, then scrapes the top result and summarizes it. The model chains the two tool calls automatically: +This agent searches Google, scrapes the top result, and summarizes it: ```python import os @@ -182,7 +195,7 @@ from strands_apify import apify_google_search_scraper, apify_scrape_url model = OpenAIModel( client_args={"api_key": os.getenv("OPENAI_API_KEY")}, - model_id="gpt-4o", + model_id="gpt-4.1", ) agent = Agent(model=model, tools=[apify_google_search_scraper, apify_scrape_url]) @@ -195,7 +208,7 @@ agent( ### Social media monitoring agent -This agent pulls recent tweets and Instagram posts on a topic: +This agent fetches recent tweets and Instagram posts on a topic: ```python from strands import Agent @@ -208,7 +221,13 @@ agent("Find the latest 10 tweets mentioning #WebScraping and summarize the main ### Run any Actor from Apify Store -The pre-built tools cover the most common use cases, but [Apify Store](https://apify.com/store) has 4,000+ Actors. Use `apify_run_actor_and_get_dataset` to give your agent access to any of them. Pass the Actor ID and its input schema: +The pre-built tools cover the most common use cases, but [Apify Store](https://apify.com/store) has 4,000+ Actors. Use `apify_run_actor_and_get_dataset` to give your agent access to any of them. + +Unlike pre-built tools (like `apify_google_search_scraper`) that expose typed parameters, `apify_run_actor_and_get_dataset` requires you to provide the Actor's input JSON directly. Your prompt must include the correct input shape. + +1. Find the Actor on [Apify Store](https://apify.com/store). +1. Check the **Input** tab for the expected JSON schema. +1. Include the Actor ID and the input JSON in your agent prompt. ```python from strands import Agent @@ -218,50 +237,404 @@ agent = Agent(model=model, tools=[apify_run_actor_and_get_dataset]) agent( "Run the Apify Actor 'apify/rag-web-browser' with input " - "{\"query\": \"latest AI safety research\", \"maxResults\": 5} " + '{"query": "latest AI safety research", "maxResults": 5} ' "and summarize the results." ) ``` -For long-running Actors (large crawls, datasets with thousands of items), increase the `timeout_secs` parameter. The default is 300 seconds. +For long-running Actors (large crawls, datasets with thousands of items), increase `timeout_secs` in your prompt - the default is 300 seconds: + +```python +agent( + "Run 'apify/website-content-crawler' with input " + '{"startUrls": [{"url": "https://docs.example.com"}], "maxCrawlPages": 100} ' + "with timeout_secs=600 and summarize the crawled pages." +) +``` + +:::note The LLM constructs the input + +The agent passes `run_input` as a plain dict. For complex Actor schemas, include the key fields explicitly in your prompt. + +::: + +## Tool reference + +Parameters, defaults, and example prompts for each tool. + +### Core tools + +Included in `APIFY_CORE_TOOLS`. + +#### `apify_scrape_url` -## Available tools +Scrape a single URL and return its content as markdown. No Actor input schema needed. -Each tool below links to its underlying Actor on Apify Store. For parameter details, see the [strands-apify GitHub repository](https://github.com/apify/strands-apify). +| Parameter | Type | Default | Description | +|---|---|---|---| +| `url` | `str` | *required* | The URL to scrape (must include `http://` or `https://`) | +| `timeout_secs` | `int` | `120` | Maximum wait time in seconds | +| `crawler_type` | `str` | `"cheerio"` | Engine: `"cheerio"` (fast, no JS), `"playwright:adaptive"` (renders JS when needed), `"playwright:firefox"` (full JS, best anti-bot bypass) | -| `APIFY_CORE_TOOLS` | `APIFY_SEARCH_TOOLS` | `APIFY_SOCIAL_TOOLS` | -| ------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -| `apify_run_actor` | [`apify_google_search_scraper`](https://apify.com/apify/google-search-scraper) | [`apify_instagram_scraper`](https://apify.com/apify/instagram-scraper) | -| `apify_get_dataset_items` | [`apify_google_places_scraper`](https://apify.com/compass/crawler-google-places) | [`apify_linkedin_profile_posts`](https://apify.com/apimaestro/linkedin-profile-posts) | -| `apify_run_actor_and_get_dataset` | [`apify_youtube_scraper`](https://apify.com/streamers/youtube-scraper) | [`apify_linkedin_profile_search`](https://apify.com/harvestapi/linkedin-profile-search) | -| `apify_run_task` | [`apify_website_content_crawler`](https://apify.com/apify/website-content-crawler) | [`apify_linkedin_profile_detail`](https://apify.com/apimaestro/linkedin-profile-detail) | -| `apify_run_task_and_get_dataset` | [`apify_ecommerce_scraper`](https://apify.com/apify/e-commerce-scraping-tool) | [`apify_twitter_scraper`](https://apify.com/apidojo/twitter-scraper-lite) | -| [`apify_scrape_url`](https://apify.com/apify/website-content-crawler) | | [`apify_tiktok_scraper`](https://apify.com/clockworks/tiktok-scraper) | -| | | [`apify_facebook_posts_scraper`](https://apify.com/apify/facebook-posts-scraper) | +Example prompt: + +```text +Scrape https://docs.apify.com/academy and summarize the page. +``` + +#### `apify_run_actor` + +Run any Actor from [Apify Store](https://apify.com/store) and return run metadata only (run ID, status, dataset ID). Use this when you need the run metadata but will fetch results separately with `apify_get_dataset_items`. + +| Parameter | Type | Default | Description | +|---|---|---|---| +| `actor_id` | `str` | *required* | Actor identifier in `"username/actor-name"` format | +| `run_input` | `dict` | `None` | JSON-serializable input matching the Actor's input schema | +| `timeout_secs` | `int` | `300` | Maximum wait time in seconds | +| `memory_mbytes` | `int` | `None` | Memory allocation in MB (uses Actor default if not set) | +| `build` | `str` | `None` | Build tag or number to pin a specific Actor version | + +To find the input schema, open the Actor's page on [Apify Store](https://apify.com/store) and check the **Input** tab. The `run_input` dict must match that schema. + +Example prompt: + +```text +Run the Actor 'apify/website-content-crawler' with input {"startUrls": [{"url": "https://example.com"}], "maxCrawlPages": 5} and return the run metadata. +``` + +#### `apify_run_actor_and_get_dataset` + +Run any Actor and fetch its dataset results in a single call. Provides access to all 4,000+ Actors in Apify Store, but requires you to provide the Actor's input JSON. + +| Parameter | Type | Default | Description | +|---|---|---|---| +| `actor_id` | `str` | *required* | Actor identifier in `"username/actor-name"` format | +| `run_input` | `dict` | `None` | JSON-serializable input matching the Actor's input schema | +| `timeout_secs` | `int` | `300` | Maximum wait time in seconds | +| `memory_mbytes` | `int` | `None` | Memory allocation in MB (uses Actor default if not set) | +| `build` | `str` | `None` | Build tag or number to pin a specific Actor version | +| `dataset_items_limit` | `int` | `100` | Maximum dataset items to return | +| `dataset_items_offset` | `int` | `0` | Items to skip (for pagination) | + +Example prompt: + +```text +Run the Actor 'apify/rag-web-browser' with input {"query": "latest AI safety research", "maxResults": 5} and summarize the results. +``` + +:::tip How to use this tool effectively + +1. Browse [Apify Store](https://apify.com/store) and find the Actor you need. +1. Open the Actor's page and check the **Input** tab for the JSON schema. +1. In your agent prompt, provide the Actor ID and the input as a JSON object. +1. There is no schema validation on the agent side. The input must match what the Actor expects. + +::: + +#### `apify_get_dataset_items` + +Fetch items from an existing Apify dataset. Use this after `apify_run_actor` to retrieve results, or to paginate through large datasets. + +| Parameter | Type | Default | Description | +|---|---|---|---| +| `dataset_id` | `str` | *required* | The dataset ID (returned by `apify_run_actor`) | +| `limit` | `int` | `100` | Maximum items to return | +| `offset` | `int` | `0` | Items to skip (for pagination) | + +Example prompt: + +```text +Fetch the first 50 items from dataset ID 'abc123' and summarize the key findings. +``` + +#### `apify_run_task` + +Run a saved [Actor task](/platform/actors/running/tasks) with optional input overrides. Tasks are pre-configured Actor runs saved in Apify Console. + +| Parameter | Type | Default | Description | +|---|---|---|---| +| `task_id` | `str` | *required* | Task identifier in `"username/task-name"` format or a task ID | +| `task_input` | `dict` | `None` | Optional input fields to override the task's saved defaults | +| `timeout_secs` | `int` | `300` | Maximum wait time in seconds | +| `memory_mbytes` | `int` | `None` | Memory allocation in MB (uses task default if not set) | + +Example prompt: + +```text +Run my saved task 'john/daily-news-scrape' and return the run status. +``` + +#### `apify_run_task_and_get_dataset` + +Run a saved task and fetch its dataset results in one call. + +| Parameter | Type | Default | Description | +|---|---|---|---| +| `task_id` | `str` | *required* | Task identifier in `"username/task-name"` format or a task ID | +| `task_input` | `dict` | `None` | Optional input fields to override the task's saved defaults | +| `timeout_secs` | `int` | `300` | Maximum wait time in seconds | +| `memory_mbytes` | `int` | `None` | Memory allocation in MB (uses task default if not set) | +| `dataset_items_limit` | `int` | `100` | Maximum dataset items to return | +| `dataset_items_offset` | `int` | `0` | Items to skip (for pagination) | + +Example prompt: + +```text +Run my task 'john/daily-news-scrape' and summarize the top 10 results. +``` + +--- + +### Search and crawling tools + +Included in `APIFY_SEARCH_TOOLS`. + +#### `apify_google_search_scraper` + +Search Google and return structured results (organic links, ads, People Also Ask). Uses [Google Search Scraper](https://apify.com/apify/google-search-scraper). + +| Parameter | Type | Default | Description | +|---|---|---|---| +| `search_query` | `str` | *required* | Google search query. Supports operators like `site:`, `"exact phrase"`, `OR` | +| `results_limit` | `int` | `10` | Maximum results to return (multiples of 10 trigger extra pages) | +| `country_code` | `str` | `None` | Two-letter country code for localized results (e.g. `"us"`, `"de"`) | +| `language_code` | `str` | `None` | Two-letter language code (e.g. `"en"`, `"es"`) | +| `timeout_secs` | `int` | `300` | Maximum wait time in seconds | + +Example prompt: + +```text +Search Google for 'best python web frameworks 2025' and return the top 5 results. +``` + +#### `apify_google_places_scraper` + +Search Google Maps for businesses and places, optionally with reviews. Uses [Google Maps Scraper](https://apify.com/compass/crawler-google-places). + +| Parameter | Type | Default | Description | +|---|---|---|---| +| `search_query` | `str` | *required* | Google Maps search query (e.g. `"restaurants in Prague"`) | +| `results_limit` | `int` | `20` | Maximum places to return | +| `language` | `str` | `None` | Language for results (e.g. `"en"`, `"de"`) | +| `include_reviews` | `bool` | `False` | Whether to include user reviews | +| `max_reviews` | `int` | `5` | Reviews per place (only used when `include_reviews=True`) | +| `timeout_secs` | `int` | `300` | Maximum wait time in seconds | + +Example prompt: + +```text +Find the top-rated Italian restaurants in Berlin with reviews. +``` + +#### `apify_youtube_scraper` + +Scrape YouTube videos, channels, or search results. Uses [YouTube Scraper](https://apify.com/streamers/youtube-scraper). Provide at least one of `search_query` or `urls`. + +| Parameter | Type | Default | Description | +|---|---|---|---| +| `search_query` | `str` | `None` | YouTube search query (e.g. `"python tutorial"`) | +| `urls` | `list[str]` | `None` | Specific YouTube video or channel URLs to scrape | +| `results_limit` | `int` | `20` | Maximum results to return | +| `timeout_secs` | `int` | `300` | Maximum wait time in seconds | + +Example prompt: + +```text +Search YouTube for 'AWS re:Invent 2025 keynote' and return the top 5 videos with their view counts. +``` + +#### `apify_website_content_crawler` + +Crawl a website and extract content from multiple pages as markdown. Uses [Website Content Crawler](https://apify.com/apify/website-content-crawler). This is the multi-page version - use `apify_scrape_url` for single pages. + +| Parameter | Type | Default | Description | +|---|---|---|---| +| `start_url` | `str` | *required* | Starting URL to crawl from | +| `max_pages` | `int` | `10` | Maximum number of pages to crawl | +| `max_depth` | `int` | `2` | Maximum link depth from the start URL | +| `timeout_secs` | `int` | `300` | Maximum wait time in seconds | + +Example prompt: + +```text +Crawl https://docs.example.com up to 20 pages and summarize the documentation structure. +``` + +#### `apify_ecommerce_scraper` + +Scrape product data from e-commerce sites (Amazon, eBay, Walmart, and others). Uses [E-commerce Scraping Tool](https://apify.com/apify/e-commerce-scraping-tool). The Actor auto-detects the platform. + +| Parameter | Type | Default | Description | +|---|---|---|---| +| `url` | `str` | *required* | Product or listing page URL | +| `url_type` | `str` | `"product"` | `"product"` for a single product page, `"listing"` for a category/search results page | +| `results_limit` | `int` | `20` | Maximum products to return (relevant for listings) | +| `timeout_secs` | `int` | `300` | Maximum wait time in seconds | + +Example prompt: + +```text +Scrape the product details from https://www.amazon.com/dp/B0EXAMPLE and return the title, price, and rating. +``` + +--- + +### Social media tools + +Included in `APIFY_SOCIAL_TOOLS`. + +#### `apify_instagram_scraper` + +Scrape Instagram profiles, posts, reels, or hashtags. Uses [Instagram Scraper](https://apify.com/apify/instagram-scraper). Provide at least one of `search_query` or `urls`. + +| Parameter | Type | Default | Description | +|---|---|---|---| +| `search_query` | `str` | `None` | Username, hashtag, or keyword. If it looks like an Instagram URL, it's treated as a direct URL. | +| `urls` | `list[str]` | `None` | Direct Instagram URLs to scrape (profiles, posts, reels) | +| `results_type` | `str` | `"posts"` | What to scrape: `"posts"`, `"comments"`, or `"details"` (profile metadata) | +| `results_limit` | `int` | `20` | Maximum items per URL or search hit | +| `search_type` | `str` | `"hashtag"` | Search mode: `"hashtag"`, `"user"`, or `"place"` | +| `search_limit` | `int` | `10` | How many search results to process (each yields up to `results_limit` items) | +| `timeout_secs` | `int` | `300` | Maximum wait time in seconds | + +Example prompt: + +```text +Scrape the latest 15 posts from the hashtag #webdevelopment on Instagram. +``` + +#### `apify_linkedin_profile_posts` + +Scrape recent posts from a LinkedIn profile. Uses [LinkedIn Profile Posts](https://apify.com/apimaestro/linkedin-profile-posts). + +| Parameter | Type | Default | Description | +|---|---|---|---| +| `profile_url` | `str` | *required* | LinkedIn profile URL (e.g. `"https://www.linkedin.com/in/username"`) or bare username | +| `results_limit` | `int` | `20` | Maximum posts to return (capped at 100) | +| `timeout_secs` | `int` | `300` | Maximum wait time in seconds | + +Example prompt: + +```text +Get the last 10 posts from https://www.linkedin.com/in/satyanadella and summarize the main topics. +``` + +#### `apify_linkedin_profile_search` + +Search for LinkedIn profiles by keywords with optional filters. Uses [LinkedIn Profile Search](https://apify.com/harvestapi/linkedin-profile-search). + +| Parameter | Type | Default | Description | +|---|---|---|---| +| `search_query` | `str` | *required* | Keywords like job titles, skills, or names (e.g. `"software engineer"`) | +| `results_limit` | `int` | `20` | Maximum profiles to return | +| `locations` | `list[str]` | `None` | Filter by locations (e.g. `["San Francisco", "New York"]`) | +| `current_job_titles` | `list[str]` | `None` | Filter by current job title (e.g. `["CTO", "VP Engineering"]`) | +| `profile_scraper_mode` | `str` | `"Short"` | `"Short"` for basic data, `"Full"` for complete profile details (slower) | +| `timeout_secs` | `int` | `300` | Maximum wait time in seconds | + +Example prompt: + +```text +Find 10 machine learning engineers in London and return their profile summaries. +``` + +#### `apify_linkedin_profile_detail` + +Get full details from a single LinkedIn profile (experience, education, skills). Uses [LinkedIn Profile Detail](https://apify.com/apimaestro/linkedin-profile-detail). No LinkedIn account or cookies required. + +| Parameter | Type | Default | Description | +|---|---|---|---| +| `profile_url` | `str` | *required* | LinkedIn profile URL or bare username | +| `include_email` | `bool` | `False` | Include email if publicly available | +| `timeout_secs` | `int` | `300` | Maximum wait time in seconds | + +Example prompt: + +```text +Get the full profile details for https://www.linkedin.com/in/example-user including their work experience and education. +``` + +#### `apify_twitter_scraper` + +Scrape tweets from Twitter/X by search, handles, or URLs. Uses [Twitter Scraper Lite](https://apify.com/apidojo/twitter-scraper-lite). Supports Twitter advanced search operators. Provide at least one of `search_query`, `urls`, or `twitter_handles`. + +| Parameter | Type | Default | Description | +|---|---|---|---| +| `search_query` | `str` | `None` | Search query with support for operators like `from:user`, `#hashtag`, `min_faves:N`, `since:YYYY-MM-DD` | +| `urls` | `list[str]` | `None` | Specific tweet, profile, or list URLs | +| `twitter_handles` | `list[str]` | `None` | Handles without `@` (e.g. `["NASA", "WHO"]`) | +| `results_limit` | `int` | `20` | Maximum tweets to return | +| `sort` | `str` | `"Latest"` | `"Latest"` (chronological) or `"Top"` (most popular) | +| `tweet_language` | `str` | `None` | ISO 639-1 language code (e.g. `"en"`, `"es"`) | +| `timeout_secs` | `int` | `300` | Maximum wait time in seconds | + +Example prompt: + +```text +Find the latest 20 tweets mentioning #AI from the past week, sorted by most popular. +``` + +#### `apify_tiktok_scraper` + +Scrape TikTok videos by search, hashtag, profile, or direct URL. Uses [TikTok Scraper](https://apify.com/clockworks/tiktok-scraper). Provide at least one of `search_query`, `hashtags`, `profiles`, or `urls`. + +| Parameter | Type | Default | Description | +|---|---|---|---| +| `search_query` | `str` | `None` | Keyword to search TikTok | +| `hashtags` | `list[str]` | `None` | Hashtags without `#` (e.g. `["fyp", "cooking"]`) | +| `profiles` | `list[str]` | `None` | TikTok usernames to scrape videos from | +| `urls` | `list[str]` | `None` | Specific TikTok post URLs | +| `results_limit` | `int` | `20` | Maximum videos per source | +| `timeout_secs` | `int` | `300` | Maximum wait time in seconds | + +Example prompt: + +```text +Scrape the top 10 TikTok videos for the hashtag 'programming' and return their view counts. +``` + +#### `apify_facebook_posts_scraper` + +Scrape posts from a Facebook page or profile. Uses [Facebook Posts Scraper](https://apify.com/apify/facebook-posts-scraper). + +| Parameter | Type | Default | Description | +|---|---|---|---| +| `page_url` | `str` | *required* | Facebook page or profile URL | +| `results_limit` | `int` | `20` | Maximum posts to return | +| `only_posts_newer_than` | `str` | `None` | Date filter: `"2024-01-01"`, `"1 week ago"`, `"3 months ago"` | +| `timeout_secs` | `int` | `300` | Maximum wait time in seconds | + +Example prompt: + +```text +Get the last 15 posts from https://www.facebook.com/apifytech newer than 1 month ago. +``` ## Tips for production -- Tune `timeout_secs` on Actor runs. The default of 300 seconds is fine for small jobs. Raise it to 600+ when crawling large sites or scraping high-volume datasets. -- Paginate datasets with `apify_get_dataset_items` using `limit` and `offset` instead of fetching everything in one call when results can run into the thousands. -- Pin Actor versions when stability matters. Use `actor_id` in the form `username/actor-name:1.2.3` to lock to a specific build. -- Watch Actor costs in [Apify Console](https://console.apify.com/). Agentic loops can call Actors multiple times per user request. Set a billing limit if you're concerned. -- Keep tool sets small. If your agent only needs to search Google and scrape one URL, register exactly those two tools, not `APIFY_SEARCH_TOOLS` or `APIFY_ALL_TOOLS`. +- Increase `timeout_secs` to 600+ when crawling large sites or scraping high-volume datasets. The default is 300 seconds. +- Paginate datasets with `apify_get_dataset_items` using `limit` and `offset` instead of fetching everything in one call. +- Pin Actor versions by passing the `build` parameter (e.g. `build="1.2.3"` or `build="beta"`) to `apify_run_actor` / `apify_run_actor_and_get_dataset`. +- Monitor Actor costs in [Apify Console](https://console.apify.com/). Agentic loops can call Actors multiple times per user request. Set a billing limit to control spending. +- Register only the tools your agent needs. For example, if you only search Google and scrape one URL, register exactly those two tools instead of `APIFY_SEARCH_TOOLS` or `APIFY_ALL_TOOLS`. +- The package auto-detects non-interactive environments (CI, Docker, web services, Lambda) and suppresses the rich diagnostic panel. To suppress in interactive shells, set `STRANDS_APIFY_QUIET=1`. ## Troubleshooting | Problem | Cause | Fix | | ----------------------------------------------- | ------------------------------------ | -------------------------------------------------------------------------------------------------- | -| `APIFY_TOKEN environment variable is not set` | Token not configured | Run `export APIFY_TOKEN=your_token` before executing your script. | -| `apify-client package is required` | Missing dependency | Run `pip install strands-apify`. | -| Actor run finishes with status `FAILED` | Invalid input or Actor error | Check the Actor input parameters and run logs in [Apify Console](https://console.apify.com). | -| Actor run finishes with status `TIMED-OUT` | Timeout too short for the workload | Increase the `timeout_secs` parameter (use 600+ for large crawls). | -| Agent selects the wrong tool | Too many tools registered | Reduce the number of tools, make the prompt more specific, or use a more capable model. | +| `APIFY_TOKEN environment variable is not set` | Token not configured | Run `export APIFY_TOKEN=your_apify_token` before executing your script | +| `apify-client package is required` | Missing dependency | Run `pip install strands-apify` | +| `Invalid URL` or `urls[N]: Invalid URL scheme '...'` | Tool input wasn't a well-formed http(s) URL | Confirm the URL has an `http://` or `https://` scheme and a valid host. When passing a list, the index in `urls[N]` points to the offending entry. | +| Actor run finishes with status `FAILED` | Invalid input or Actor error | The error text includes the Actor's `statusMessage` (e.g. `Message: invalid query`) - fix the input based on that, or check the full run logs in [Apify Console](https://console.apify.com). | +| Actor run finishes with status `TIMED-OUT` | Timeout too short for the workload | Increase the `timeout_secs` parameter (use 600+ for large crawls) | +| Agent selects the wrong tool | Too many tools registered or ambiguous prompt | Reduce the number of registered tools, add more context to the prompt, or use a more capable model | | Empty results from social media tools | Private or geo-restricted profile | Verify the profile is public. Test with a known public account first. | ## Resources - [Strands Agents SDK documentation](https://strandsagents.com/) -- [Strands Agents GitHub repository](https://github.com/strands-agents/sdk-python) +- [Strands Agents SDK GitHub repository](https://github.com/strands-agents/sdk-python) - [strands-apify on PyPI](https://pypi.org/project/strands-apify/) - [strands-apify GitHub repository](https://github.com/apify/strands-apify) - [Apify Store](https://apify.com/store) diff --git a/sources/platform/integrations/index.mdx b/sources/platform/integrations/index.mdx index 6a37a54800..22332d737a 100644 --- a/sources/platform/integrations/index.mdx +++ b/sources/platform/integrations/index.mdx @@ -279,6 +279,12 @@ These integrations allow you to use Apify Actors as tools and data sources. If y imageUrlDarkTheme="/img/platform/integrations/manus-white.svg" smallImage /> + ## Other Actors diff --git a/static/img/platform/integrations/strands.svg b/static/img/platform/integrations/strands.svg new file mode 100644 index 0000000000..466fb64465 --- /dev/null +++ b/static/img/platform/integrations/strands.svg @@ -0,0 +1,4 @@ + + + + From 799dcd9f695572121012291e39497747d4abb1f1 Mon Sep 17 00:00:00 2001 From: David Omrai Date: Tue, 19 May 2026 17:22:55 +0200 Subject: [PATCH 4/5] fix: lint fix --- .../integrations/ai/strands-agents.md | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/sources/platform/integrations/ai/strands-agents.md b/sources/platform/integrations/ai/strands-agents.md index fa47bae277..ed405922d5 100644 --- a/sources/platform/integrations/ai/strands-agents.md +++ b/sources/platform/integrations/ai/strands-agents.md @@ -43,7 +43,7 @@ Use a `.env` file or your secrets manager in production. Never commit `APIFY_TOK The package reads the following environment variables: | Variable | Description | Required | -|---|---|---| +| --- | --- | --- | | `APIFY_TOKEN` | Apify API token used to authorize Actor runs and dataset reads. | Yes | | `STRANDS_APIFY_QUIET` | Set to `1` to suppress the diagnostic panel printed on each tool call. Auto-suppressed in non-interactive environments. | No | @@ -271,7 +271,7 @@ Included in `APIFY_CORE_TOOLS`. Scrape a single URL and return its content as markdown. No Actor input schema needed. | Parameter | Type | Default | Description | -|---|---|---|---| +| --- | --- | --- | --- | | `url` | `str` | *required* | The URL to scrape (must include `http://` or `https://`) | | `timeout_secs` | `int` | `120` | Maximum wait time in seconds | | `crawler_type` | `str` | `"cheerio"` | Engine: `"cheerio"` (fast, no JS), `"playwright:adaptive"` (renders JS when needed), `"playwright:firefox"` (full JS, best anti-bot bypass) | @@ -287,7 +287,7 @@ Scrape https://docs.apify.com/academy and summarize the page. Run any Actor from [Apify Store](https://apify.com/store) and return run metadata only (run ID, status, dataset ID). Use this when you need the run metadata but will fetch results separately with `apify_get_dataset_items`. | Parameter | Type | Default | Description | -|---|---|---|---| +| --- | --- | --- | --- | | `actor_id` | `str` | *required* | Actor identifier in `"username/actor-name"` format | | `run_input` | `dict` | `None` | JSON-serializable input matching the Actor's input schema | | `timeout_secs` | `int` | `300` | Maximum wait time in seconds | @@ -307,7 +307,7 @@ Run the Actor 'apify/website-content-crawler' with input {"startUrls": [{"url": Run any Actor and fetch its dataset results in a single call. Provides access to all 4,000+ Actors in Apify Store, but requires you to provide the Actor's input JSON. | Parameter | Type | Default | Description | -|---|---|---|---| +| --- | --- | --- | --- | | `actor_id` | `str` | *required* | Actor identifier in `"username/actor-name"` format | | `run_input` | `dict` | `None` | JSON-serializable input matching the Actor's input schema | | `timeout_secs` | `int` | `300` | Maximum wait time in seconds | @@ -336,7 +336,7 @@ Run the Actor 'apify/rag-web-browser' with input {"query": "latest AI safety res Fetch items from an existing Apify dataset. Use this after `apify_run_actor` to retrieve results, or to paginate through large datasets. | Parameter | Type | Default | Description | -|---|---|---|---| +| --- | --- | --- | --- | | `dataset_id` | `str` | *required* | The dataset ID (returned by `apify_run_actor`) | | `limit` | `int` | `100` | Maximum items to return | | `offset` | `int` | `0` | Items to skip (for pagination) | @@ -352,7 +352,7 @@ Fetch the first 50 items from dataset ID 'abc123' and summarize the key findings Run a saved [Actor task](/platform/actors/running/tasks) with optional input overrides. Tasks are pre-configured Actor runs saved in Apify Console. | Parameter | Type | Default | Description | -|---|---|---|---| +| --- | --- | --- | --- | | `task_id` | `str` | *required* | Task identifier in `"username/task-name"` format or a task ID | | `task_input` | `dict` | `None` | Optional input fields to override the task's saved defaults | | `timeout_secs` | `int` | `300` | Maximum wait time in seconds | @@ -369,7 +369,7 @@ Run my saved task 'john/daily-news-scrape' and return the run status. Run a saved task and fetch its dataset results in one call. | Parameter | Type | Default | Description | -|---|---|---|---| +| --- | --- | --- | --- | | `task_id` | `str` | *required* | Task identifier in `"username/task-name"` format or a task ID | | `task_input` | `dict` | `None` | Optional input fields to override the task's saved defaults | | `timeout_secs` | `int` | `300` | Maximum wait time in seconds | @@ -394,7 +394,7 @@ Included in `APIFY_SEARCH_TOOLS`. Search Google and return structured results (organic links, ads, People Also Ask). Uses [Google Search Scraper](https://apify.com/apify/google-search-scraper). | Parameter | Type | Default | Description | -|---|---|---|---| +| --- | --- | --- | --- | | `search_query` | `str` | *required* | Google search query. Supports operators like `site:`, `"exact phrase"`, `OR` | | `results_limit` | `int` | `10` | Maximum results to return (multiples of 10 trigger extra pages) | | `country_code` | `str` | `None` | Two-letter country code for localized results (e.g. `"us"`, `"de"`) | @@ -412,7 +412,7 @@ Search Google for 'best python web frameworks 2025' and return the top 5 results Search Google Maps for businesses and places, optionally with reviews. Uses [Google Maps Scraper](https://apify.com/compass/crawler-google-places). | Parameter | Type | Default | Description | -|---|---|---|---| +| --- | --- | --- | --- | | `search_query` | `str` | *required* | Google Maps search query (e.g. `"restaurants in Prague"`) | | `results_limit` | `int` | `20` | Maximum places to return | | `language` | `str` | `None` | Language for results (e.g. `"en"`, `"de"`) | @@ -431,7 +431,7 @@ Find the top-rated Italian restaurants in Berlin with reviews. Scrape YouTube videos, channels, or search results. Uses [YouTube Scraper](https://apify.com/streamers/youtube-scraper). Provide at least one of `search_query` or `urls`. | Parameter | Type | Default | Description | -|---|---|---|---| +| --- | --- | --- | --- | | `search_query` | `str` | `None` | YouTube search query (e.g. `"python tutorial"`) | | `urls` | `list[str]` | `None` | Specific YouTube video or channel URLs to scrape | | `results_limit` | `int` | `20` | Maximum results to return | @@ -448,7 +448,7 @@ Search YouTube for 'AWS re:Invent 2025 keynote' and return the top 5 videos with Crawl a website and extract content from multiple pages as markdown. Uses [Website Content Crawler](https://apify.com/apify/website-content-crawler). This is the multi-page version - use `apify_scrape_url` for single pages. | Parameter | Type | Default | Description | -|---|---|---|---| +| --- | --- | --- | --- | | `start_url` | `str` | *required* | Starting URL to crawl from | | `max_pages` | `int` | `10` | Maximum number of pages to crawl | | `max_depth` | `int` | `2` | Maximum link depth from the start URL | @@ -465,7 +465,7 @@ Crawl https://docs.example.com up to 20 pages and summarize the documentation st Scrape product data from e-commerce sites (Amazon, eBay, Walmart, and others). Uses [E-commerce Scraping Tool](https://apify.com/apify/e-commerce-scraping-tool). The Actor auto-detects the platform. | Parameter | Type | Default | Description | -|---|---|---|---| +| --- | --- | --- | --- | | `url` | `str` | *required* | Product or listing page URL | | `url_type` | `str` | `"product"` | `"product"` for a single product page, `"listing"` for a category/search results page | | `results_limit` | `int` | `20` | Maximum products to return (relevant for listings) | @@ -488,7 +488,7 @@ Included in `APIFY_SOCIAL_TOOLS`. Scrape Instagram profiles, posts, reels, or hashtags. Uses [Instagram Scraper](https://apify.com/apify/instagram-scraper). Provide at least one of `search_query` or `urls`. | Parameter | Type | Default | Description | -|---|---|---|---| +| --- | --- | --- | --- | | `search_query` | `str` | `None` | Username, hashtag, or keyword. If it looks like an Instagram URL, it's treated as a direct URL. | | `urls` | `list[str]` | `None` | Direct Instagram URLs to scrape (profiles, posts, reels) | | `results_type` | `str` | `"posts"` | What to scrape: `"posts"`, `"comments"`, or `"details"` (profile metadata) | @@ -508,7 +508,7 @@ Scrape the latest 15 posts from the hashtag #webdevelopment on Instagram. Scrape recent posts from a LinkedIn profile. Uses [LinkedIn Profile Posts](https://apify.com/apimaestro/linkedin-profile-posts). | Parameter | Type | Default | Description | -|---|---|---|---| +| --- | --- | --- | --- | | `profile_url` | `str` | *required* | LinkedIn profile URL (e.g. `"https://www.linkedin.com/in/username"`) or bare username | | `results_limit` | `int` | `20` | Maximum posts to return (capped at 100) | | `timeout_secs` | `int` | `300` | Maximum wait time in seconds | @@ -524,7 +524,7 @@ Get the last 10 posts from https://www.linkedin.com/in/satyanadella and summariz Search for LinkedIn profiles by keywords with optional filters. Uses [LinkedIn Profile Search](https://apify.com/harvestapi/linkedin-profile-search). | Parameter | Type | Default | Description | -|---|---|---|---| +| --- | --- | --- | --- | | `search_query` | `str` | *required* | Keywords like job titles, skills, or names (e.g. `"software engineer"`) | | `results_limit` | `int` | `20` | Maximum profiles to return | | `locations` | `list[str]` | `None` | Filter by locations (e.g. `["San Francisco", "New York"]`) | @@ -543,7 +543,7 @@ Find 10 machine learning engineers in London and return their profile summaries. Get full details from a single LinkedIn profile (experience, education, skills). Uses [LinkedIn Profile Detail](https://apify.com/apimaestro/linkedin-profile-detail). No LinkedIn account or cookies required. | Parameter | Type | Default | Description | -|---|---|---|---| +| --- | --- | --- | --- | | `profile_url` | `str` | *required* | LinkedIn profile URL or bare username | | `include_email` | `bool` | `False` | Include email if publicly available | | `timeout_secs` | `int` | `300` | Maximum wait time in seconds | @@ -559,7 +559,7 @@ Get the full profile details for https://www.linkedin.com/in/example-user includ Scrape tweets from Twitter/X by search, handles, or URLs. Uses [Twitter Scraper Lite](https://apify.com/apidojo/twitter-scraper-lite). Supports Twitter advanced search operators. Provide at least one of `search_query`, `urls`, or `twitter_handles`. | Parameter | Type | Default | Description | -|---|---|---|---| +| --- | --- | --- | --- | | `search_query` | `str` | `None` | Search query with support for operators like `from:user`, `#hashtag`, `min_faves:N`, `since:YYYY-MM-DD` | | `urls` | `list[str]` | `None` | Specific tweet, profile, or list URLs | | `twitter_handles` | `list[str]` | `None` | Handles without `@` (e.g. `["NASA", "WHO"]`) | @@ -579,7 +579,7 @@ Find the latest 20 tweets mentioning #AI from the past week, sorted by most popu Scrape TikTok videos by search, hashtag, profile, or direct URL. Uses [TikTok Scraper](https://apify.com/clockworks/tiktok-scraper). Provide at least one of `search_query`, `hashtags`, `profiles`, or `urls`. | Parameter | Type | Default | Description | -|---|---|---|---| +| --- | --- | --- | --- | | `search_query` | `str` | `None` | Keyword to search TikTok | | `hashtags` | `list[str]` | `None` | Hashtags without `#` (e.g. `["fyp", "cooking"]`) | | `profiles` | `list[str]` | `None` | TikTok usernames to scrape videos from | @@ -598,7 +598,7 @@ Scrape the top 10 TikTok videos for the hashtag 'programming' and return their v Scrape posts from a Facebook page or profile. Uses [Facebook Posts Scraper](https://apify.com/apify/facebook-posts-scraper). | Parameter | Type | Default | Description | -|---|---|---|---| +| --- | --- | --- | --- | | `page_url` | `str` | *required* | Facebook page or profile URL | | `results_limit` | `int` | `20` | Maximum posts to return | | `only_posts_newer_than` | `str` | `None` | Date filter: `"2024-01-01"`, `"1 week ago"`, `"3 months ago"` | @@ -621,15 +621,15 @@ Get the last 15 posts from https://www.facebook.com/apifytech newer than 1 month ## Troubleshooting -| Problem | Cause | Fix | -| ----------------------------------------------- | ------------------------------------ | -------------------------------------------------------------------------------------------------- | -| `APIFY_TOKEN environment variable is not set` | Token not configured | Run `export APIFY_TOKEN=your_apify_token` before executing your script | -| `apify-client package is required` | Missing dependency | Run `pip install strands-apify` | -| `Invalid URL` or `urls[N]: Invalid URL scheme '...'` | Tool input wasn't a well-formed http(s) URL | Confirm the URL has an `http://` or `https://` scheme and a valid host. When passing a list, the index in `urls[N]` points to the offending entry. | -| Actor run finishes with status `FAILED` | Invalid input or Actor error | The error text includes the Actor's `statusMessage` (e.g. `Message: invalid query`) - fix the input based on that, or check the full run logs in [Apify Console](https://console.apify.com). | -| Actor run finishes with status `TIMED-OUT` | Timeout too short for the workload | Increase the `timeout_secs` parameter (use 600+ for large crawls) | -| Agent selects the wrong tool | Too many tools registered or ambiguous prompt | Reduce the number of registered tools, add more context to the prompt, or use a more capable model | -| Empty results from social media tools | Private or geo-restricted profile | Verify the profile is public. Test with a known public account first. | +| Problem | Cause | Fix | +| --- | --- | --- | +| `APIFY_TOKEN environment variable is not set` | Token not configured | Run `export APIFY_TOKEN=your_apify_token` before executing your script | +| `apify-client package is required` | Missing dependency | Run `pip install strands-apify` | +| `Invalid URL` or `urls[N]: Invalid URL scheme '...'` | URL is not well-formed http(s) | Confirm the URL has an `http://` or `https://` scheme and a valid host. The index in `urls[N]` points to the offending entry. | +| Actor run finishes with status `FAILED` | Invalid input or Actor error | Check the `statusMessage` in the error text, or check the full run logs in [Apify Console](https://console.apify.com). | +| Actor run finishes with status `TIMED-OUT` | Timeout too short for the workload | Increase the `timeout_secs` parameter (use 600+ for large crawls) | +| Agent selects the wrong tool | Too many tools registered or ambiguous prompt | Reduce the number of registered tools, add more context to the prompt, or use a more capable model | +| Empty results from social media tools | Private or geo-restricted profile | Verify the profile is public. Test with a known public account first. | ## Resources From d968962292499bcfdd818febfde19bd1aaa88a02 Mon Sep 17 00:00:00 2001 From: David Omrai Date: Tue, 19 May 2026 17:33:05 +0200 Subject: [PATCH 5/5] docs: update strands agent sdk description --- sources/platform/integrations/ai/strands-agents.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/platform/integrations/ai/strands-agents.md b/sources/platform/integrations/ai/strands-agents.md index ed405922d5..99b20a81e6 100644 --- a/sources/platform/integrations/ai/strands-agents.md +++ b/sources/platform/integrations/ai/strands-agents.md @@ -2,8 +2,8 @@ title: Strands Agents SDK integration sidebar_label: Strands Agents SDK description: >- - Learn how to integrate Apify with the Strands Agents SDK to give your - AI agents web scraping, search, and social media capabilities. + Integrate Apify with the Strands Agents SDK to give your AI agents web + scraping, search, crawling, and social media capabilities through 18 prebuilt tools. sidebar_position: 20 slug: /integrations/strands-agents ---