Dify

Connect MrScraper to Dify to fetch web pages, search Google, and check account usage from agents, chatflows, and workflows.

The MrScraper plugin for Dify adds web retrieval and search to your Dify applications. Use its tools as workflow nodes or let an agent choose when to call them.

Available tools

ToolTool IDPurpose
Accountmrscraper_accountCheck your MrScraper account, token usage, and limits.
Scraper APImrscraper_scraper_apiRetrieve a page as HTML, Markdown, a screenshot, or a combination.
Web Searchmrscraper_web_searchSearch Google using query text or a Google search URL.

This guide covers plugin version 0.1.0, which requires Dify 1.17.0 or later. See the marketplace listing for releases and compatibility details.

Prerequisites

  • A Dify workspace with permission to install tool plugins.
  • A MrScraper API token.
  • A model configured in Dify if you want an agent or LLM node to process the results.

Installation and authentication

Install the plugin

Open MrScraper in the Dify Marketplace, click Install, and select your Dify environment. You can also find MrScraper from the marketplace inside your workspace's Integrations page.

Add your API token

In Dify, open Integrations > Tools > Tool Plugin, select MrScraper, and add a credential. Paste your MrScraper token into API Token and save it.

Dify supplies this credential whenever a MrScraper tool runs. You do not need to pass the token as a tool input or include it in an agent prompt.

Verify the connection

Add a MrScraper Account tool node to a workflow and select the credential you saved. Run the node without additional inputs and check that it returns your account information.

For help creating a token, see Token Plan. Dify's tools guide explains workspace credentials and using tools across applications.

Fetch a page with Scraper API

Use Scraper API when you already have a target URL. For example, configure a tool node with these inputs to retrieve Markdown for an LLM:

{
  "url": "https://example.com",
  "html": false,
  "markdown": true
}

Common inputs

InputDefaultDescription
urlRequiredThe page URL to retrieve.
htmltrueInclude HTML in the response.
markdownfalseInclude Markdown in the response.
screenshotfalseInclude a screenshot; this also enables browser rendering.
browser_renderingautoSelect auto, true, or false to control browser rendering.

The tool also exposes options for proxy routing, page loading, and retries. Start with the defaults and adjust them for the target page. See the Scraper API guide for retrieval use cases.

Use Web Search when you have a topic or keyword rather than a target page. Its Query or Google URL input is named url, and accepts either search text or a full Google search URL containing a q parameter.

For parsed search results, use:

{
  "url": "web scraping tutorials",
  "raw": false,
  "format": "json",
  "region": "us",
  "language": "en",
  "page": 1
}
InputDescription
urlRequired. Query text or a Google search URL.
rawDefaults to true. Set to false to request parsed results.
formatUse json for structured results or html for search-page HTML when raw is false.
regionOptional two-letter region code, such as us.
languageOptional language code, such as en.
pageOptional results page number, starting at 1.

Setting format to json alone does not enable parsed results: raw: true takes precedence over format.

Example: summarize a web page

Build a workflow that accepts a URL, retrieves its content, and produces a summary:

  1. Add a User Input node with a required text input named page_url.
  2. Choose Add Node > Tools > MrScraper > Scraper API.
  3. Bind the tool's url input to page_url, set html to false, and set markdown to true.
  4. Test the tool node and inspect its output. Bind the returned page text or Markdown field to an LLM node with an instruction such as Summarize this page in three bullet points.
  5. Connect the LLM response to an Output node, then test the workflow with https://example.com.

For research workflows, run Web Search first, select a result URL from its parsed output, and pass that URL to Scraper API before summarizing the page. See Dify's Tool node guide for adding nodes and choosing credentials.

Use MrScraper in an agent

Add Web Search and Scraper API to your agent's available tools and select your MrScraper credential. Configure Web Search with raw: false and format: "json" when the agent needs structured search results.

An example agent instruction:

Search Google for pages relevant to the user's question. Fetch the most useful
pages with Scraper API, then answer using the retrieved content and cite the
source URLs.

Working with outputs

The plugin returns the API response data directly. Objects and arrays appear as Dify JSON messages; strings such as HTML appear as text. HTTP status and response headers are not included in the tool output.

Scraper API can return text or an object containing multiple requested formats. Inspect a test run before connecting its output to another node. Screenshot data stays within the API response; the plugin does not create a separate Dify file.

Troubleshooting

IssueWhat to check
Plugin will not installConfirm your Dify version meets the plugin requirement and your workspace permissions allow installation.
Authentication failsCheck the provider's API Token credential and verify it with Account.
Search returns HTML instead of parsed resultsSet both raw: false and format: "json".
A downstream node receives an unexpected valueInspect the tool's JSON or text output and bind the specific content your next node needs.
A request times outCheck the tool timeout and any shorter limits imposed by your Dify deployment or reverse proxy.

For self-hosted Dify, allow outbound HTTPS access to api.app.mrscraper.com, api.mrscraper.com, and sync.scraper.mrscraper.com.

If you are upgrading an older MrScraper plugin workflow, version 0.1.0 uses the three tool IDs listed above. Replace nodes that reference removed tools and check their input and output bindings before running the workflow again.

On this page