n8n

Learn how to connect MrScraper to n8n, the open-source workflow automation tool, and retrieve pages, extract brand details and structured JSON, search the web, and check account status from your workflows.

n8n Integration

n8n is an open-source workflow automation tool that lets teams connect apps, services, and APIs using a visual, node-based interface. Similar to Zapier or Make, n8n automates repetitive tasks and builds workflows without custom code.

Workflows in n8n run automatically based on triggers such as schedules, webhooks, or events from connected tools.

Overview

The n8n-nodes-mrscraper community node brings the seven MrScraper services into n8n. Its operations share their descriptions, parameter meanings, and defaults with the CLI, the MCP server, and the SDKs. The node organizes them into three resources, stores authentication in credentials, and returns results as n8n items.

ResourceOperationDescription
Scraper APIScrape HTMLRetrieve the raw HTML of a page. Browser rendering is optional.
Scraper APIScrape MarkdownRetrieve a page as clean Markdown. Browser rendering is optional.
Scraper APIGet ScreenshotCapture a Base64 PNG screenshot of the full page, first viewport, or custom viewport. Browser rendering is always enabled.
Scraper APIScrape BrandExtract a website's colors, typography, logos, and social links as JSON.
Scraper APIScrape JSONExtract structured JSON from a page using a natural-language prompt and optional schema.
DiscoveryWeb SearchSearch the web and return ranked results with titles, URLs, descriptions, and sources.
AccountGet StatusReturn the raw account status API response without summarizing, redacting body fields, or adding calculated fields.

Package Information

This page documents version 6.0.0. Version 6.0.0 renames Get Account Info to Get Status, moves Geo Code to the main configuration, adds Max Age and custom screenshot viewports, and always saves page results to your dashboard. See Migrating from earlier versions. See n8n-nodes-mrscraper on npm for the latest release.

Use MrScraper as an AI Agent tool

The MrScraper node is tool-enabled. You can attach it to an n8n AI Agent node and let the model call MrScraper operations on its own, instead of wiring them into a fixed workflow path.

Prerequisites

Before you start, ensure you have:

Installation

Install n8n-nodes-mrscraper through Settings > Community Nodes in your n8n instance. See the community node installation guide for other installation methods and requirements.

Authentication

  1. Obtain an API token from the MrScraper app.
  2. Create a MrScraper API credential in n8n.
  3. Paste the token into API Token and select that credential in your MrScraper node.

The saved credential supplies Authorization: Bearer <token> and x-api-token headers. Tokens are not sent in the request URL. Store the token in the credential rather than in workflow fields or Code nodes.

For more information on generating API tokens, see the Generate Token guide.

Quick Start

Add the MrScraper Node

  1. Open the n8n workflow editor and add a Manual Trigger
  2. Click the + button, search for MrScraper, and connect the MrScraper node to the trigger
  3. In Credential to connect with, select your MrScraper API credential

Configure Scrape HTML

  1. Set Resource to Scraper API and Operation to Scrape HTML
  2. Enter https://example.com in URL
  3. Leave Browser Rendering at None, Warm Start off, and Geo Code blank

Test and Execute

  1. Click Test step
  2. Read the HTML using {{ $json.html }} in a following node
  3. Connect the output to other nodes in your workflow

Replace the example target with your page. Live scraping and search calls use tokens from your plan. Response examples below show selected fields with placeholder values; actual responses can include additional fields.

Shared Page Controls

Scrape HTML, Scrape Markdown, Get Screenshot, and Scrape JSON share the following controls. Scrape Brand, Web Search, and Get Status have separate inputs described below.

Fields marked Main configuration appear directly in the node. Fields marked Options are added through Options > Add Option. Defaults describe what the node sends.

FieldLocationHTTP fieldTypeDefaultDescription
URLMain configurationurlStringRequiredAbsolute HTTP or HTTPS URL of the page to process, such as https://example.com.
Geo CodeMain configurationgeoCodeStringBlank; omittedTwo-letter country code to load the page from, sent in lowercase. For example, US, GB, or ID becomes us, gb, or id. Leave blank to use the API default location, the United States.
TimeoutOptionstimeoutInteger300 secondsMaximum seconds to wait for the scrape, from 1 to 330. The HTTP request allows 30 additional seconds: a value of 120 gives the transport 150 seconds.
Wait for SelectorOptionswaitForSelectorStringBlank; omittedCSS selector or text to wait for on the page before returning the result, up to 500 characters. For example, .product-list waits for the product list.
Max AgeOptionsmaxAgeInteger0 millisecondsReturn a cached result of the same request when it is newer than this age. Range: 0 to 604800000 milliseconds (seven days). 0 always scrapes fresh; 86400000 accepts results up to one day old. A cached result costs the same tokens as the original scrape.
Max RetriesOptionsmaxRetriesIntegerOmitted; 3 when addedMaximum retries, as a nonnegative integer. Leave the option absent for no limit. Adding it inserts 3; change that value as needed. 0 disables retries.

Every page request sends saveResult=true, so results are always saved to your dashboard. There is no Save Result toggle.

Loading controls

Scrape HTML, Scrape Markdown, and Scrape JSON also accept these controls. Get Screenshot always sends browserRendering=true and has no Browser Rendering, Warm Start, or Block Resources input.

FieldLocationHTTP fieldTypeDefaultDescription
Browser RenderingMain configurationbrowserRenderingTrue / False / NoneNoneWhether to load the page in a browser: True always does and False never does. None leaves the HTTP field out, so the API loads the page without a browser first and switches to a browser if the request is blocked.
Warm StartMain configurationwarmStartBoolean toggleOff (false)Whether to open the site's home page first to warm the session before loading the target URL.
Block ResourcesOptionsblockResourcesBoolean toggleOff (false)Whether to block images, fonts, and stylesheets while loading the page. This can affect the appearance of captured screenshots.

Scraper API

Select Resource > Scraper API for the five operations below. All of them call https://api.mrscraper.com/.

Scrape HTML

Retrieve the raw HTML of a page. Browser rendering is optional.

Accepts shared page controls, loading controls, and:

FieldLocationHTTP fieldTypeDefaultDescription
ScreenshotOptionsscreenshotBoolean toggleOff (false)Whether to include a Base64 screenshot in the response. This is a toggle, not a screenshot-area input. Browser Rendering follows its selected setting.

The request uses GET with html=true, markdown=false, and saveResult=true.

Example configuration

FieldValue
URLhttps://example.com
Browser RenderingTrue
Warm StartOn
Options > Wait for Selectorbody
Options > Timeout120
Options > Max Retries0

The node wraps the response body in html:

{
  "html": "<html><body>Example page content...</body></html>"
}

Use {{ $json.html }} in a following node, or connect an HTML node to extract elements. When you request a screenshot, inspect the output first: this operation reads the response as text and places the complete body in html, including a JSON response returned by the API.

Scrape Markdown

Retrieve a page as clean Markdown. Browser rendering is optional.

Accepts shared page controls, loading controls, and the same Screenshot toggle as Scrape HTML.

The request uses GET with markdown=true, html=false, and saveResult=true.

Example: choose Scrape Markdown, enter https://example.com, turn Warm Start on, and add Options > Max Age with 86400000 to accept a cached result up to one day old.

{
  "markdown": "# Example page\n\nExample Markdown content..."
}

Use {{ $json.markdown }} in a following node. The complete response body is read as text; inspect it before mapping fields when you request a screenshot.

Get Screenshot

Capture a Base64 PNG screenshot of the full page, first viewport, or custom viewport. Browser rendering is always enabled.

Accepts shared page controls and:

FieldLocationHTTP fieldTypeDefaultDescription
Screenshot ModeMain configurationscreenshotStringfullArea to capture: full for the entire scroll height, top for the first viewport, or WIDTHxHEIGHT[-ZOOM]. Width and height must be 100 to 3840 pixels; the optional zoom must be 25 to 300 percent, default 100. Examples: 1280x800, 1920x1080-75.

The request uses GET with browserRendering=true, html=false, markdown=false, and saveResult=true. The API can still include HTML in its response.

Example: choose Get Screenshot, set URL to https://example.com, set Screenshot Mode to top, and add Options > Timeout with 120.

{
  "html": "<html>...</html>",
  "screenshot": "BASE64_PNG_DATA"
}

Read {{ $json.screenshot }}. This is Base64 text, not an n8n binary attachment; convert it before passing it to a node that requires a file.

Scrape Brand

Extract a website's colors, typography, logos, and social links as JSON. Only URL is accepted; shared page and loading controls are not available.

The request uses GET with action=brand-scraping, bundle=none, and the URL. The action is fixed and is not an input field.

{
  "data": {
    "job_id": "JOB_ID",
    "status": "succeeded",
    "url": "https://example.com",
    "final_url": "https://example.com",
    "brand": {
      "name": "Example brand",
      "colors": { "background": "#ffffff", "text": "#222222" },
      "typography": { "body": { "font_family": "Example font" } }
    },
    "error": null,
    "bundle_url": null
  },
  "message": "Example response"
}

Use {{ $json.data.brand }} for brand details and {{ $json.data.job_id }} for the job ID.

Scrape JSON

Extract structured JSON from a page using a natural-language prompt. Append a JSON schema to shape the output.

Accepts shared page controls, loading controls, and:

FieldLocationHTTP fieldTypeDefaultDescription
PromptMain configurationpromptStringExtract all data as complete as possible.Non-empty instructions describing the data to extract. For example, Extract the product name, price, and availability.
Expected Output SchemaMain configurationAppended to promptJSONEmptyOptional valid JSON describing the expected output. The node appends Json Schema: and the serialized schema to Prompt; it does not send a separate schema parameter. Invalid JSON fails before the request.
Return HTMLOptionshtmlBoolean toggleOn (true)Whether to include the page HTML alongside the extracted JSON. Turn it off to send false when only the extracted data is needed.
ScreenshotOptionsscreenshotBoolean toggleOff (false)Whether to include a Base64 screenshot in the response. Browser Rendering follows its selected setting.

The request sends agent=general and saveResult=true. It uses GET unless the encoded URL exceeds 8,000 characters, when it switches to POST with only url, prompt, and agent in the body. Page controls remain in the query.

Example configuration

FieldValue
URLhttps://example.com
PromptExtract the first two items with title and price.
Expected Output Schema{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"price":{"type":"string"}},"required":["title","price"]}}
Browser RenderingTrue
Options > Return HTMLOff
{
  "success": true,
  "data": [{ "title": "Example item", "price": "10.00" }],
  "thread_id": "THREAD_ID",
  "token_usage": 1,
  "html": "",
  "markdown": "",
  "screenshot": "",
  "status": "Results ready",
  "error": "",
  "runtime": 1.23,
  "cookies": []
}

Extracted results are in {{ $json.data }} and follow the requested schema. Use Split Out on data when it is an array and you need one n8n item per result. Response metadata can include thread_id, token_usage, status, error, runtime, and cookies.

Discovery

Search the web and return ranked results with titles, URLs, descriptions, and sources. Select Resource > Discovery and Operation > Web Search.

FieldHTTP fieldTypeDefaultDescription
Search QueryqueryStringRequiredSearch text, trimmed before sending, containing 1 to 1000 characters.
CountrycountryStringBlank; omittedTwo-letter country code to search from, sent in lowercase. Leave blank to search from the United States.
Number of ResultsnumResultsInteger10Number of results to request, from 10 to 100. Fewer results may be returned.

The request uses GET https://api.mrscraper.com/ with a fixed action=websearch. The transport timeout is fixed at 120 seconds.

Example: set Search Query to site:example.com documentation, Country to id, and Number of Results to 20.

{
  "success": true,
  "message": "Example response",
  "data": [
    {
      "rank": 1,
      "title": "Example result",
      "url": "https://example.com",
      "description": "Example result description.",
      "source": "example.com"
    }
  ],
  "tokenUsage": 1
}

To scrape each result, use Split Out on data, connect a second MrScraper node, choose Scrape HTML or Scrape Markdown, and map the resulting URL field into URL. Inspect the Split Out output to choose the correct expression.

Account

Get Status

Return the raw account status API response without summarizing, redacting body fields, or adding calculated fields. Select Resource > Account and Operation > Get Status; there are no operation-specific input fields.

The request uses GET https://api.app.mrscraper.com/api/v1/subscription-accounts.

{
  "message": "Example response",
  "data": {
    "id": "ACCOUNT_ID",
    "tokenLimit": 100000,
    "tokenUsage": 2500,
    "stripeStatus": "active",
    "user": {
      "name": "Example user",
      "email": "user@example.com",
      "isVerified": true
    },
    "subscriptionItem": { "name": "Example plan", "tokenLimit": 100000 },
    "scraperAllowance": { "remaining": 97500, "plans": [{ "remaining": 97500 }] }
  }
}

Account fields remain nested in data. For example, use {{ $json.data.tokenUsage }} or inspect {{ $json.data.scraperAllowance }}.

Working with n8n Output

The node returns n8n items. It does not add the CLI and SDK response envelope containing status_code, data, and headers; a data field shown above belongs to the API body itself.

OperationResult expression
Scrape HTML{{ $json.html }}
Scrape Markdown{{ $json.markdown }}
Get Screenshot{{ $json.screenshot }}
Scrape Brand{{ $json.data.brand }}
Scrape JSON{{ $json.data }}
Web Search{{ $json.data }}
Get Status{{ $json.data }}

To use a URL produced by a previous node, switch URL to expression mode and enter {{ $json.url }}. For search, use {{ $json.query }} in Search Query.

Understanding n8n Upstream Node Execution

When you execute a node in n8n, all upstream nodes automatically re-execute silently. With MrScraper, this means hidden token costs.

For example, in a Web Search → Split Out → Scrape Markdown workflow, clicking Test step on Scrape Markdown also runs the search again and scrapes every result. Testing 10 times means 10 searches and 10 rounds of scrapes. Pin the output of upstream MrScraper nodes while you build downstream steps.

Troubleshooting

HTTP and network failures appear as node execution errors. Input validation rejects invalid URLs, page limits, screenshot viewport formats, search inputs, and JSON schemas before the request is sent. Inspect API response fields such as success, status, and error for service-level results.

SymptomWhat to check
Authentication failsCheck the token in the selected MrScraper API credential.
Dynamic content is missingSet Browser Rendering to True and add Wait for Selector if needed.
A scrape takes too longSet Timeout up to 330 seconds and configure Max Retries. The transport allows 30 additional seconds.
Expected Output Schema is rejectedUse valid JSON with double quotes and no trailing commas.
Screenshot settings are rejectedScrape HTML, Scrape Markdown, and Scrape JSON use boolean toggles. Get Screenshot uses full, top, or a supported viewport.
Screenshot output is text rather than a fileDecode the Base64 output into binary before passing it to a node that requires a file.
An output expression returns undefinedInspect the node's output JSON and map the actual response fields.

Migrating from Earlier Versions

  • Get Account Info is now named Get Status. Its internal operation identifier is unchanged, so existing selections continue to work.
  • Geo Code is in the main configuration. Browser Rendering choices are True, False, and None.
  • Scrape HTML and Scrape Markdown use a boolean Screenshot toggle and have no Action input. Get Screenshot accepts custom viewports in Screenshot Mode.
  • Max Age is new on every page operation, and Timeout accepts up to 330 seconds.
  • proxy, proxyCountry, super, returnCookie, tokenCap, and waitUntil are not exposed or forwarded. Page results are always saved to your dashboard.
  • Web Search and ordinary JSON extraction use GET. Get Screenshot sends html=false, although the API may still return HTML.
  • The Extraction, Result, Scraper Creation, Scraper Run, and Crawl Website URLs resources of earlier node versions are unavailable. Rebuild workflows that use them with the supported operations, or call the REST API with an HTTP Request node for scrapers and results.

Example Workflows

Built on earlier node versions

These example workflows use the Scraper Creation, Scraper Run, and Result resources of earlier node versions, which version 6.0.0 no longer provides.

Prebuilt Workflow Templates

MrScraper provides ready-to-deploy n8n workflow templates for common automation use cases. Each template is built around real-world scenarios and can be deployed in minutes.

Quick Start

Select the template that fits your use case, follow the setup guide, and you'll have a working automation running in minutes.

On this page