Dify Web Search Integration — Add Search to Your AI Workflows
Dify is an open-source platform for building AI workflows with a visual no-code editor. While Dify ships with a plugin marketplace and custom tool support, adding reliable web search requires choosing the right search API and configuring it properly. This guide compares every option and shows you how to get web search working in Dify workflows.
Key Takeaways
- Dify supports four tool types: Plugin (marketplace), Custom (API), Workflow, and MCP
- The plugin marketplace has some search tools, but they're often outdated or limited
- Custom tools let you connect any REST API — including SearchHive for search, scraping, and deep research
- SearchHive's $9/mo Starter plan covers what would cost $50-80/month with individual search providers
Dify Web Search Options Compared
| Approach | Setup Effort | Free Tier | Capabilities | Best For |
|---|---|---|---|---|
| Plugin Marketplace | Low (click to install) | Varies | Search only | Quick setup |
| Custom API Tool | Medium (free JSON formatter config) | Depends on API | Any REST API | Full control |
| MCP Server | Medium | Depends on server | Any MCP-compatible tool | Standardized tools |
| Workflow Node | Low (drag and drop) | None | Orchestration | Multi-step pipelines |
Option 1: Plugin Marketplace
Dify's plugin marketplace includes several search-related plugins. To install:
- Navigate to Tools in your Dify workspace
- Click Marketplace
- Search for "search" — you'll find options like Google Search, Tavily, and SerpApi plugins
- Click Install and add your API key
Limitations of marketplace plugins:
- Often outdated — API schemas change frequently
- Limited configuration options
- No combined search + scraping capabilities
- Vendor lock-in to specific providers
Option 2: Custom API Tool with SearchHive (Recommended)
Custom tools give you full control over the API call, response parsing, and error handling. Here's how to set up SearchHive as a custom tool in Dify:
Step 1: Create the Search Tool
Go to Tools > Custom Tool > Create Custom Tool:
Tool Configuration:
- Name:
web_search - Description: Search the web for current information. Returns titles, URLs, and text snippets from relevant results.
- Method:
GET - URL:
https://api.searchhive.dev/v1/swift-search - Headers:
Authorization: Bearer YOUR_SEARCHHIVE_KEY - Query Parameters:
query:{{query}}(required)limit:5
Input Variables:
query(string, required): "The search query to execute"
Output Mapping:
{
"results": [
{
"title": "{{results.0.title}}",
"url": "{{results.0.url}}",
"snippet": "{{results.0.snippet}}"
}
]
}
Step 2: Create the Page Scraper Tool
Tool Configuration:
- Name:
page_scraper - Description: Extract content from a web page as clean markdown text.
- Method:
POST - URL:
https://api.searchhive.dev/v1/scrape-forge - Headers:
Authorization: Bearer YOUR_SEARCHHIVE_KEY Content-Type: application/json - Body (JSON):
{ "url": "{{url}}", "format": "markdown" }
Step 3: Create the Deep Research Tool
Tool Configuration:
- Name:
deep_research - Description: Conduct comprehensive research on a topic with multi-source analysis.
- Method:
GET - URL:
https://api.searchhive.dev/v1/deep-dive - Headers:
Authorization: Bearer YOUR_SEARCHHIVE_KEY - Query Parameters:
query:{{query}}(required)
Step 4: Use in a Workflow
In the Dify workflow editor:
- Add a Start node with a
user_queryinput - Add an LLM node connected to the start
- Enable the three search tools on the LLM node
- The LLM will automatically decide when to search, scrape, or research
[Start] --> [LLM (with web_search, page_scraper, deep_research tools)] --> [Direct Reply]
Option 3: MCP Server Integration
Dify supports MCP (Model Context Protocol) servers, which is a standardized way to expose tools. If SearchHive has an MCP server, you can connect it directly:
- Navigate to Tools > MCP in Dify
- Add a new MCP server configuration
- Point to the SearchHive MCP server endpoint
- Tools from the server appear automatically in your workflow editor
Option 4: Workflow Node (HTTP Request)
For simple one-off search queries in a workflow, use the HTTP Request node:
- Add an HTTP Request node to your workflow
- Set URL to
https://api.searchhive.dev/v1/swift-search - Set method to GET
- Add headers with your API key
- Map the query parameter from a previous node
- Use the results in downstream nodes (LLM, template, conditional)
This approach is useful for workflows where the search is deterministic (always search for X, not LLM-decided).
Search API Pricing for Dify Workflows
Dify workflows can make many API calls per run — a complex research workflow might search, scrape 3-5 pages, and summarize. Costs add up fast with per-query pricing:
| Provider | Search | Scrape | Deep Research | 1K workflow runs/mo |
|---|---|---|---|---|
| Serper.dev | $1/1K | N/A | N/A | ~$10 (search only) |
| SerpApi | $25/1K | No | No | ~$25+ |
| Tavily | $8/1K | $8/1K | No | ~$24 |
| Brave Search | $5/1K | No | No | ~$5 (search only) |
| Firecrawl | No | $16/3K | No | ~$53 (scrape only) |
| SearchHive | Included | Included | Included | $9-49 |
With SearchHive, a workflow that searches 1 query, scrapes 3 pages, and runs 1 deep research per run uses 5 credits per run. At $49/month for 100K credits, that's 20,000 workflow runs — or $0.00245 per run. No other provider comes close to this for combined search + scrape + research.
Advanced: Multi-Step Research Workflow
Here's a more complex Dify workflow pattern for research applications:
[Start: user_question]
|
[LLM: Classify question type]
|
+--> [Factual] --> [HTTP: SwiftSearch] --> [LLM: Answer from snippets]
|
+--> [Deep Research] --> [HTTP: DeepDive] --> [LLM: Synthesize]
|
+--> [Specific URL] --> [HTTP: ScrapeForge] --> [LLM: Analyze content]
|
[Template: Format output]
|
[End: Final answer with sources]
This pattern uses conditional routing to pick the right search tool based on the question type, maximizing both speed and cost efficiency.
Verdict
For Dify web search integration:
- Fastest setup: Plugin marketplace — install and go, but limited customization
- Best for production: Custom API tool with SearchHive — full control, search + scraping + research from one API key, and dramatically lower costs
- Standardized integration: MCP server — future-proof, works across platforms
The real differentiator for SearchHive in Dify is the combination of capabilities. Most Dify workflows that involve web research need search (find pages), scraping (read content), and sometimes deep analysis. With separate providers, you're managing 2-3 API keys and paying 3-5x more. SearchHive bundles all three under one credit system.
Get started with SearchHive's free tier — 500 credits, no credit card. Check the API docs for Dify-specific configuration examples.
Related: /compare/tavily | /compare/serpapi | /compare/firecrawl