|
1 | 1 | 
|
2 | 2 |
|
3 |
| -# n8n-nodes-starter |
| 3 | +# n8n SearchAPI.io Node |
4 | 4 |
|
5 |
| -This repo contains example nodes to help you get started building your own custom integrations for [n8n](n8n.io). It includes the node linter and other dependencies. |
| 5 | +Search the web with [SearchAPI.io](https://www.searchapi.io/) directly from your n8n workflows. The node exposes the full power of the `/api/v1/search` endpoint and supports **all engines and query parameters** offered by the service. |
6 | 6 |
|
7 |
| -To make your custom node available to the community, you must create it as an npm package, and [submit it to the npm registry](https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry). |
| 7 | +> **Why SearchAPI.io?**\ |
| 8 | +> Real‑time SERP data from Google, Bing, DuckDuckGo, Yahoo, Yandex and more – no captchas, no proxies, one simple API. |
8 | 9 |
|
9 |
| -## Plan |
| 10 | +--- |
10 | 11 |
|
11 |
| -- Node type: Action |
12 |
| -- Style: Declarative |
| 12 | +## Installation |
13 | 13 |
|
14 |
| -## Prerequisites |
| 14 | +### Via the n8n UI (recommended) |
15 | 15 |
|
16 |
| -You need the following installed on your development machine: |
| 16 | +1. Open **Settings → Community Nodes** inside your self‑hosted n8n instance. |
| 17 | +2. Click **Install → Browse** and search for `n8n-nodes-searchapi`. |
| 18 | +3. Select the package, accept the risk prompt, and hit **Install**. |
17 | 19 |
|
18 |
| -* [git](https://git-scm.com/downloads) |
19 |
| -* Node.js and pnpm. Minimum version Node 18. You can find instructions on how to install both using nvm (Node Version Manager) for Linux, Mac, and WSL [here](https://github.com/nvm-sh/nvm). For Windows users, refer to Microsoft's guide to [Install NodeJS on Windows](https://docs.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-windows). |
20 |
| -* Install n8n with: |
| 20 | +### Via the command line |
| 21 | + |
| 22 | +```bash |
| 23 | +# inside your n8n installation folder |
| 24 | +npm install n8n-nodes-searchapi |
| 25 | +# or with pnpm |
| 26 | +pnpm add n8n-nodes-searchapi |
| 27 | +``` |
| 28 | + |
| 29 | +Restart n8n after the install finishes. |
| 30 | + |
| 31 | +> **Compatibility** |
| 32 | +> |
| 33 | +> - n8n ≥ 1.30.0 |
| 34 | +> - Node.js ≥ 18 |
| 35 | +
|
| 36 | +--- |
| 37 | + |
| 38 | +## Credentials |
| 39 | + |
| 40 | +1. Sign up at **[SearchAPI.io](https://www.searchapi.io/)** and copy your **API Key**. |
| 41 | +2. In n8n go to **Credentials → + New Credential → SearchAPI**. |
| 42 | +3. Paste the key and save.\ |
| 43 | + The new credential will now appear in the node’s **Credential** dropdown. |
| 44 | + |
| 45 | +--- |
| 46 | + |
| 47 | +## Usage |
| 48 | + |
| 49 | +### 1. Drag‑and‑drop UI |
| 50 | + |
| 51 | +1. Add the **SearchAPI** node to your workflow. |
| 52 | +2. Choose your **Credential** and the **Engine**. |
| 53 | +3. Under **Parameters,** click **Add Parameter** for each query string field you need. To determine which fields to add, refer to the engine's documentation. |
| 54 | + - **Name**: `q` |
| 55 | + - **Value**: `weather new york` |
| 56 | +4. Execute the workflow to receive the response as JSON. |
| 57 | + |
| 58 | +### 2. Pass a parameters object (programmatic) |
| 59 | + |
| 60 | +You can also pass a parameters object directly to the node, instead of the UI: |
| 61 | + |
| 62 | +```json |
| 63 | +{ |
| 64 | + "parameters": { |
| 65 | + "q": "n8n workflow automation", |
| 66 | + "device": "mobile", |
| 67 | + "location": "Berlin" |
| 68 | + } |
| 69 | +} |
| 70 | +``` |
| 71 | + |
| 72 | +- Feed the object through a **Set** node or any previous node. |
21 | 73 | ```
|
22 |
| - pnpm install n8n -g |
| 74 | + {{$json.parameters}} |
23 | 75 | ```
|
24 |
| -* Recommended: follow n8n's guide to [set up your development environment](https://docs.n8n.io/integrations/creating-nodes/build/node-development-environment/). |
| 76 | +- The node will give preference to the parameters object. |
| 77 | + |
| 78 | +--- |
| 79 | + |
| 80 | +## Example workflow |
| 81 | + |
| 82 | +The sample below searches Google for “n8n community nodes” and extracts the first organic result. |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | +You can import the full `.json` from `/examples/searchapi_google_basic.json` in this repo. |
| 87 | + |
| 88 | +--- |
| 89 | + |
| 90 | +## Output |
| 91 | + |
| 92 | +The node returns the raw JSON received from SearchAPI.io. See the [official docs](https://www.searchapi.io/docs/google) for complete schemas. |
25 | 93 |
|
26 |
| -## Using this starter |
| 94 | +--- |
27 | 95 |
|
28 |
| -These are the basic steps for working with the starter. For detailed guidance on creating and publishing nodes, refer to the [documentation](https://docs.n8n.io/integrations/creating-nodes/). |
| 96 | +## Troubleshooting |
29 | 97 |
|
30 |
| -1. [Generate a new repository](https://github.com/n8n-io/n8n-nodes-starter/generate) from this template repository. |
31 |
| -2. Clone your new repo: |
32 |
| - ``` |
33 |
| - git clone https://github.com/<your organization>/<your-repo-name>.git |
34 |
| - ``` |
35 |
| -3. Run `pnpm i` to install dependencies. |
36 |
| -4. Open the project in your editor. |
37 |
| -5. Browse the examples in `/nodes` and `/credentials`. Modify the examples, or replace them with your own nodes. |
38 |
| -6. Update the `package.json` to match your details. |
39 |
| -7. Run `pnpm lint` to check for errors or `pnpm lintfix` to automatically fix errors when possible. |
40 |
| -8. Test your node locally. Refer to [Run your node locally](https://docs.n8n.io/integrations/creating-nodes/test/run-node-locally/) for guidance. |
41 |
| -9. Replace this README with documentation for your node. Use the [README_TEMPLATE](README_TEMPLATE.md) to get started. |
42 |
| -10. Update the LICENSE file to use your details. |
43 |
| -11. [Publish](https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry) your package to npm. |
| 98 | +| Error message | Likely cause | Fix | |
| 99 | +| ---------------------------- | ---------------------------- | --------------------------------------------------------------------------- | |
| 100 | +| **401 Unauthorized** | Invalid or missing API key | Double‑check the credentials. | |
| 101 | +| **422 Unprocessable Entity** | Wrong parameter name / value | Verify against SearchAPI docs. | |
| 102 | +| **429 Too Many Requests** | Rate limit exceeded | Slow down the workflow or [upgrade plan](https://www.searchapi.io/pricing). | |
44 | 103 |
|
45 |
| -## More information |
| 104 | +--- |
46 | 105 |
|
47 |
| -Refer to our [documentation on creating nodes](https://docs.n8n.io/integrations/creating-nodes/) for detailed information on building your own nodes. |
| 106 | +## Resources |
48 | 107 |
|
49 |
| -## License |
| 108 | +- **SearchAPI.io documentation** – [https://www.searchapi.io/docs](https://www.searchapi.io/docs) |
| 109 | +- **n8n Community Forum** – [https://community.n8n.io](https://community.n8n.io) |
| 110 | +- **Community nodes installation** – [https://docs.n8n.io/integrations/community-nodes/installation/](https://docs.n8n.io/integrations/community-nodes/installation/) |
50 | 111 |
|
51 |
| -[MIT](https://github.com/n8n-io/n8n-nodes-starter/blob/master/LICENSE.md) |
|
0 commit comments