|
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 |
| -## Prerequisites |
| 10 | +--- |
10 | 11 |
|
11 |
| -You need the following installed on your development machine: |
| 12 | +## Installation |
12 | 13 |
|
13 |
| -* [git](https://git-scm.com/downloads) |
14 |
| -* 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). |
15 |
| -* Install n8n with: |
| 14 | +### Via the n8n UI (recommended) |
| 15 | + |
| 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**. |
| 19 | + |
| 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. |
16 | 73 | ```
|
17 |
| - pnpm install n8n -g |
| 74 | + {{$json.parameters}} |
18 | 75 | ```
|
19 |
| -* 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 workflows |
| 81 | + |
| 82 | +To easily see how to work with SearchApi on n8n, refer to the examples we've prepared. To use them you can download the json file and import on n8n, or you can paste the url for the, you can also copy the contents and paste inside a workflow. Refer to [n8n docs](https://docs.n8n.io/courses/level-one/chapter-6/#exporting-and-importing-workflows_1) on how to import workflows. |
| 83 | + |
| 84 | +- [Youtube video summarization with SearchApi](/examples/searchapi_youtube_transcripts/) |
| 85 | +- [Chatbot that searchs the web with SearchApi](/examples/searchapi_chatbot/) |
| 86 | + |
| 87 | +## Output |
| 88 | + |
| 89 | +The node returns the raw JSON received from SearchApi.io. See the [official docs](https://www.searchapi.io/docs/google) for complete schemas. |
20 | 90 |
|
21 |
| -## Using this starter |
| 91 | +--- |
22 | 92 |
|
23 |
| -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/). |
| 93 | +## Troubleshooting |
24 | 94 |
|
25 |
| -1. [Generate a new repository](https://github.com/n8n-io/n8n-nodes-starter/generate) from this template repository. |
26 |
| -2. Clone your new repo: |
27 |
| - ``` |
28 |
| - git clone https://github.com/<your organization>/<your-repo-name>.git |
29 |
| - ``` |
30 |
| -3. Run `pnpm i` to install dependencies. |
31 |
| -4. Open the project in your editor. |
32 |
| -5. Browse the examples in `/nodes` and `/credentials`. Modify the examples, or replace them with your own nodes. |
33 |
| -6. Update the `package.json` to match your details. |
34 |
| -7. Run `pnpm lint` to check for errors or `pnpm lintfix` to automatically fix errors when possible. |
35 |
| -8. Test your node locally. Refer to [Run your node locally](https://docs.n8n.io/integrations/creating-nodes/test/run-node-locally/) for guidance. |
36 |
| -9. Replace this README with documentation for your node. Use the [README_TEMPLATE](README_TEMPLATE.md) to get started. |
37 |
| -10. Update the LICENSE file to use your details. |
38 |
| -11. [Publish](https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry) your package to npm. |
| 95 | +| Error message | Likely cause | Fix | |
| 96 | +| ---------------------------- | ---------------------------- | --------------------------------------------------------------------------- | |
| 97 | +| **401 Unauthorized** | Invalid or missing API key | Double‑check the credentials. | |
| 98 | +| **400 Bad Request** | Missing required parameter | Verify against SearchApi docs. | |
| 99 | +| **429 Too Many Requests** | Rate limit exceeded | Slow down the workflow or [upgrade plan](https://www.searchapi.io/pricing). | |
39 | 100 |
|
40 |
| -## More information |
| 101 | +--- |
41 | 102 |
|
42 |
| -Refer to our [documentation on creating nodes](https://docs.n8n.io/integrations/creating-nodes/) for detailed information on building your own nodes. |
| 103 | +## Resources |
43 | 104 |
|
44 |
| -## License |
| 105 | +- **SearchApi.io documentation** – [https://www.searchapi.io/](https://www.searchapi.io/docs/google) |
| 106 | +- **n8n Community Forum** – [https://community.n8n.io](https://community.n8n.io) |
| 107 | +- **Community nodes installation** – [https://docs.n8n.io/integrations/community-nodes/installation/](https://docs.n8n.io/integrations/community-nodes/installation/) |
45 | 108 |
|
46 |
| -[MIT](https://github.com/n8n-io/n8n-nodes-starter/blob/master/LICENSE.md) |
|
0 commit comments