# n8n integration: Spider community node docs | Spider

Install the Spider community node in n8n to crawl, scrape, search, screenshot and transform pages into markdown, or use it as an AI Agent tool.

Canonical: https://spider.cloud/docs/integrations/n8n/

The [Spider community node](https://www.npmjs.com/package/@spider-cloud/n8n-nodes-spider) crawls sites, scrapes pages, searches the web, takes screenshots and converts HTML to markdown inside any [n8n](https://n8n.io/) workflow. Pages come back as markdown, text, raw HTML or XML.

## Install

In n8n, open **Settings**, then **Community Nodes**, select **Install** and enter the package name. The [n8n install guide](https://docs.n8n.io/integrations/community-nodes/installation/) covers self-hosted setups and manual installs.

Package name

```
@spider-cloud/n8n-nodes-spider
```

## Credentials

Create a key on [your API keys page](/api-keys). In n8n, add a **Spider API** credential and paste the key. n8n tests the credential with `GET /data/credits`, which reads your balance and costs nothing.

## Operations

Operations are grouped by resource. Crawl, Get Links and Search return one n8n item per page by default, or all pages in one item, set by **Output Mode**.

| Resource | Operation   | Endpoint          | What it does                                                                    |
| -------- | ----------- | ----------------- | ------------------------------------------------------------------------------- |
| Page     | Scrape      | POST /scrape      | Fetch one page and return its content.                                          |
| Page     | Screenshot  | POST /screenshot  | Capture a PNG of a page, returned as n8n binary data in the data property.      |
| Page     | Transform   | POST /transform   | Convert HTML you already have into markdown, text or XML. It fetches nothing.   |
| Website  | Crawl       | POST /crawl       | Follow links from a start URL and return each page found, up to the page limit. |
| Website  | Get Links   | POST /links       | Crawl a site and return the URLs found, without page content.                   |
| Web      | Search      | POST /search      | Search the web, and optionally fetch the content of each result.                |
| Account  | Get Credits | GET /data/credits | Read the remaining credit balance.                                              |

## Additional fields

Each operation has an **Additional Fields** section. The common ones are below. The [API reference](/docs/api) documents each parameter and what it costs.

| Field                                          | What it does                                                                                                                                     |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| Fetch Mode                                     | Smart, the default, uses plain HTTP and switches to a browser when the page needs JavaScript. HTTP Only is the cheapest. Browser always renders. |
| Main Content Only                              | Drops navigation, headers and footers from the output.                                                                                           |
| Readability Mode                               | Runs the page through a reader view before conversion.                                                                                           |
| Root Selector                                  | Keeps only the part of the page that matches a CSS selector.                                                                                     |
| Country Code                                   | Routes the request through a proxy in that country, for example us or de.                                                                        |
| Request Timeout                                | In seconds, from 5 to 255.                                                                                                                       |
| Include Metadata                               | Adds the page title, description and other metadata.                                                                                             |
| Crawl Depth, Include Paths Only, Exclude Paths | Limit a crawl. The path fields take a comma-separated list, for example /docs/, /blog/.                                                          |
| Full Page                                      | Captures the whole page in a screenshot instead of the visible window.                                                                           |
| Fetch Page Content                             | Makes Search fetch each result page, not only the title, link and snippet.                                                                       |

## Use the node as an AI Agent tool

Attach the node to an n8n AI Agent from the agent's **Tool** connector, pick the resource and operation, and let the model fill a field with `$fromAI`. Self-hosted n8n needs `N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true` to use community nodes as tools.

URL field filled by the model

```
{{ $fromAI('url', 'The full URL of the page to read', 'string') }}
```

## Example workflows

The [templates folder](https://github.com/spider-rs/n8n-nodes-spider/tree/main/templates) holds three workflows to import with **Workflows**, then **Import from File**: a docs crawl into a vector store with a chat agent, a daily price scrape into Google Sheets, and a research agent that searches and scrapes with cited links. Each has a sticky note with its setup steps. The first and third also need an OpenAI credential.

## Errors

The node reports the HTTP status and Spider's message. Turn on **Continue On Fail** in the node settings to keep a workflow running when one URL fails.

| Status | Meaning                                                                                                                                                               |
| ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 401    | The key is missing or wrong. Check the Spider API credential.                                                                                                         |
| 402    | The account is out of credits.                                                                                                                                        |
| 429    | Rate limited. An exhausted account usage window can cause this after a single request. Wait the number of seconds in the Retry-After response header before retrying. |

## Compatibility

Tested with n8n 1.x. The node has no runtime dependencies. Workflows built with version 1 of the node keep working, because n8n keeps each node at the version it was created with. Source and issues are on [GitHub](https://github.com/spider-rs/n8n-nodes-spider).
