Dify
Connect MrScraper to Dify to scrape pages as HTML, Markdown, screenshots, brand data, or JSON, search the web, and check account status from agents, chatflows, and workflows.
The MrScraper plugin for Dify adds web scraping, structured extraction, and search to your Dify applications. Use its tools as workflow nodes or let an agent choose when to call them.
Available tools
| Tool | Tool ID | Purpose |
|---|---|---|
| Status | mrscraper_status | Return your MrScraper account status, plan, and usage. |
| Scrape HTML | mrscraper_scrape_html | Retrieve the raw HTML of a page, optionally with a screenshot. |
| Scrape Markdown | mrscraper_scrape_markdown | Retrieve a page as Markdown. |
| Get screenshot | mrscraper_get_screenshot | Capture a base64 PNG screenshot of the full page, the top viewport, or a custom viewport. |
| Scrape brand | mrscraper_scrape_brand | Extract a website's colors, typography, logos, and social links as JSON. |
| Scrape JSON | mrscraper_scrape_json | Extract structured JSON from a page using a natural-language prompt. |
| Web search | mrscraper_web_search | Search the web and return ranked results with titles, URLs, descriptions, and sources. |
This guide covers plugin version 0.4.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 Status tool node to a workflow and select the credential you saved. Run the node without 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.
Page tools
Scrape HTML, Scrape Markdown, Get screenshot, and Scrape JSON retrieve a known URL. For example, configure Scrape Markdown with these inputs to retrieve a page for an LLM:
{
"url": "https://example.com",
"max_retries": 2
}Shared inputs
| Input | Default | Description |
|---|---|---|
url | Required | Absolute HTTP or HTTPS URL of the page. |
timeout | 300 | Page timeout in seconds, from 1 to 330. |
wait_for_selector | Omitted | CSS selector or text to wait for before returning the page, up to 500 characters. |
geo_code | Omitted | Two-letter country code for the request, such as us. See Country Codes. |
max_age | 0 | Return a cached result of the same request if it is newer than this many milliseconds, up to 604800000 (7 days). 0 always fetches a fresh page. A cached result costs the same tokens as the original scrape. |
max_retries | Omitted | Maximum number of retries, as a nonnegative integer. Omit for no limit. |
Scrape HTML, Scrape Markdown, and Scrape JSON also accept these loading inputs:
| Input | Default | Description |
|---|---|---|
browser_rendering | auto | true always uses a browser and false never does. auto tries without a browser first and switches automatically when needed. |
warm_start | false | Visit the site's home page before the target URL. |
block_resources | false | Block images, fonts, and stylesheets. |
Scrape HTML
Returns the page HTML. Set screenshot to also capture the page:
| Value | Result |
|---|---|
false (default) | No screenshot. |
full | The entire scroll height. |
top | The first viewport. |
WIDTHxHEIGHT[-ZOOM] | A custom viewport from 100 to 3840 pixels with an optional zoom from 25 to 300, such as 1280x800 or 1920x1080-75. |
Any value other than false also enables browser rendering.
Scrape Markdown
Returns the page as Markdown. It takes only the shared and loading inputs.
Get screenshot
Returns a base64 PNG screenshot. Browser rendering is always enabled. Set screenshot to full (default), top, or WIDTHxHEIGHT[-ZOOM]; any other value, including false, is rejected before a request is sent.
Scrape JSON
Extracts structured data from the page with AI.
| Input | Default | Description |
|---|---|---|
prompt | Extract all data as complete as possible. | What to extract. Append Json Schema: and a JSON schema to shape the output. |
html | true | Include the page HTML in the response. |
screenshot | false | Include a base64 screenshot. Unlike the other tools, this input is a boolean. |
{
"url": "https://example.com/products",
"prompt": "Extract the first 2 items with title and price. Json Schema: {\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"title\":{\"type\":\"string\"},\"price\":{\"type\":\"string\"}},\"required\":[\"title\",\"price\"]}}",
"html": false
}See the Scraper API guide for retrieval use cases.
Scrape brand
Scrape brand takes only url and returns the site's colors, typography, logos, and social links as JSON. See Scrape Brand.
Discover pages with Web search
Use Web search when you have a topic or keyword rather than a target page. It always returns structured JSON results.
{
"query": "web scraping tutorials",
"country": "us",
"num_results": 10
}| Input | Default | Description |
|---|---|---|
query | Required | The search query, from 1 to 1000 characters. |
country | Omitted | Optional two-letter country code for localized results, such as us. |
num_results | 10 | Number of results to return, from 10 to 100. |
Each result includes its rank, title, url, description, and source.
Example: summarize a web page
Build a workflow that accepts a URL, retrieves its content, and produces a summary:
- Add a User Input node with a required text input named
page_url. - Choose Add Node > Tools > MrScraper > Scrape Markdown.
- Bind the tool's
urlinput topage_url. - Test the tool node and inspect its output. Bind the returned Markdown to an LLM node with an instruction such as
Summarize this page in three bullet points. - 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 output, and pass that URL to Scrape Markdown before summarizing the page. To get structured fields instead of a summary, use Scrape JSON with a prompt and schema. See Dify's Tool node guide for adding nodes and choosing credentials.
Use MrScraper in an agent
Add Web search, Scrape Markdown, and any other MrScraper tools you need to your agent's available tools, and select your MrScraper credential. The agent can fill in the search query, page URL, and extraction prompt on its own.
An example agent instruction:
Search the web for pages relevant to the user's question. Fetch the most useful pages with Scrape Markdown, 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 and Markdown appear as text. HTTP status and response headers are not included in the tool output.
Page tools use the page timeout plus 30 seconds of transport, up to 360 seconds. Scrape brand and Web search use a fixed 120-second deadline, and Status uses 600 seconds. The plugin's maximum request time is 660 seconds.
Inspect a test run before connecting a tool's output to another node. Screenshot data is returned as base64 inside the JSON response; the plugin does not create a separate Dify file.
Troubleshooting
| Issue | What to check |
|---|---|
| Plugin will not install | Confirm your Dify version meets the plugin requirement and your workspace permissions allow installation. |
| Authentication fails | Check the provider's API Token credential and verify it with Status. |
| Get screenshot rejects the input | Set screenshot to full, top, or WIDTHxHEIGHT[-ZOOM]. |
| Web search rejects the result count | Set num_results to an integer from 10 to 100. |
| A downstream node receives an unexpected value | Inspect the tool's JSON or text output and bind the specific content your next node needs. |
| A request times out | Check 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 and api.mrscraper.com.
Upgrading
- From 0.2.x: Account is now Status (
mrscraper_status). Scraper API (mrscraper_scraper_api) is replaced by Scrape HTML, Scrape Markdown, and Get screenshot; recreate affected nodes with the tool that matches the format you used. Scrape brand and Scrape JSON are new.home_pageis nowwarm_start, andmax_ageis new. Theuse_proxy,proxy_country,proxy,bypass_proxy,super,wait_until,cookie_jar,headers,token_cap,stream, anddiscard_token_secretinputs were removed. Web search is unchanged. - From 0.1.x or earlier: Recreate all MrScraper nodes with the tools listed above and reconnect their bindings. Crawl, scraper creation, rerun, and saved-result operations have no equivalent.
Map & Listing & General Agents
Build an n8n workflow that chains the Map, Listing, and General Agents to discover pages, collect item URLs, and scrape details from every one.
Scalekit
Connect MrScraper MCP through Scalekit AgentKit to give your AI agents per-user web fetching, web search, and account usage tools.