# Web search for n8n AI agents with the HTTP Request tool

> Web search for n8n AI agents: HTTP Request tool settings, a model-filled query and Optimize Response, so the agent gets sources with page text. No KYC, crypto.

- URL: https://llmwebsearch.com/docs/n8n/
- Last updated: 2026-10-22
- Publisher: LLMWebSearch (https://llmwebsearch.com)

n8n's HTTP Request node can be attached to an AI Agent as a tool. Point it at `/search`, let the model write the query, and trim the answer to titles, URLs and page text. No community node is needed.

**Quick answer — How do I give an n8n AI agent a web search tool?**

Attach an HTTP Request node to n8n's AI Agent as a tool, set it to `GET https://llmwebsearch.com/api/v1/search` with a Header Auth credential holding your **LLMWebSearch** key, and let the model fill the `q` parameter with `$fromAI()`. Turn on Optimize Response and keep `title`, `url` and `content`. A search with the top 3 pages read costs 1 credit, from $1.20/1K searches as of October 2026. No KYC.

## Which HTTP Request settings do I use?

Option names as written in n8n's HTTP Request node documentation, read on 22 October 2026.

| Setting | Value |
| --- | --- |
| Placement | Attached to the **AI Agent** node as a tool |
| Method | `GET` |
| URL | `https://llmwebsearch.com/api/v1/search` |
| Authentication | Generic credential type → **Header Auth** |
| Header Auth credential | Name `Authorization`, value `Bearer ` followed by your key |
| Send Query Parameters | On, **Using Fields Below** |
| Parameter `q` | Filled by the model with `$fromAI()` (see below) |
| Parameter `max_results` | `5` |
| Parameter `read` | `3` |
| Parameter `max_chars` | `4000` |
| Optimize Response | On · **JSON** · Field Containing Data `results` · Include Fields **Selected**: `title`, `url`, `content` |

## Why the HTTP Request node rather than a custom node?

Because one GET request with a header and four query parameters is all the API needs. n8n's documentation says the HTTP Request node can run as a regular node or be attached to an AI agent as a tool, and that some options exist only in the tool form.

Nothing of ours has to be installed or updated, and the key stays in n8n's credential store instead of the workflow. Give n8n a key of its own. Make one API key per agent, app or teammate and revoke any of them from the dashboard without touching the others.

## How does the model write the search query?

Through n8n's `$fromAI()` function in the value of the `q` field. Its documented form is `$fromAI(key, description, type, defaultValue)`: use the key `query`, a description such as "What to search for on the web", and the type `string`. n8n notes that `$fromAI()` only works in tools connected to the AI Agent node.

Describe the tool itself in plain words too, for example "Searches the web and returns sources with their page text; cite the URLs". The agent uses that text to decide when to search.

## Why turn on Optimize Response?

Because everything a tool returns lands in the model's context. Optimize Response is a tool-only option that reduces what is passed to the model. With the JSON type, set Field Containing Data to `results`, then include only `title`, `url` and `content`.

The agent then sees a short list of sources with their text, and nothing else. Cap the length on our side with `max_chars`, which trims each page before it leaves the API.

## Can I run searches on a schedule without an agent?

Yes. Use the HTTP Request node as a regular node behind a Schedule Trigger, with a fixed query. Add `topic=news` and `time_range=day` to collect the day's articles on a subject, then send the titles and URLs to a chat, a sheet or an email.

One scheduled news search per day uses about 30 credits a month, so 5,000 searches ($9.25) covers many topics for a long time. Search credits have no expiry date: what you do not use this month is still there next year.

## What does the workflow receive when a page is refused?

The search still succeeds. The refused result keeps its title and URL, has no `content`, and its `content_status` says why, such as `blocked_by_robots`. Our reader respects robots.txt: it introduces itself as LLMWebSearch, follows the rules a site writes for it or for all robots, and leaves out the content of any page it is not allowed to read.

HTTP errors are different: a wrong key returns `401`, an empty balance `402`, too many calls `429`. In an agent, let the tool hand the error back so the model can explain it. In a scheduled workflow, route errors to a branch that logs them. The [errors page](https://llmwebsearch.com/docs/errors/) lists every code.

## How do I test the call before building the workflow?

Run the same request with curl from the [curl recipes](https://llmwebsearch.com/docs/curl/). If it works in a terminal and fails in n8n, the cause sits in the node settings. The usual suspects are a credential value without the `Bearer ` prefix, or an empty `q` field.

## n8n: common questions

### Is there an LLMWebSearch community node?

No, and none is needed. The built-in HTTP Request node does the job, as a tool for the AI Agent or as a regular node in any workflow.

### Can I send the request as POST with a JSON body?

Yes. Turn on Send Body with the JSON content type, and use the same names as the GET parameters. POST is handier when you add lists such as `include_domains`.

### How do I limit how many searches the agent runs?

Write a limit in the agent's system message, such as two searches per question, and keep `read` at 3 or less so each search stays at one credit.

### How do I pay?

Top up from $25 in BTC, USDT, USDC, ETH, SOL, LTC, then buy a pack from your balance. LLMWebSearch asks for no ID, no selfie and no documents.

## Sources

1. [HTTP Request node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/) — n8n docs (read 2026-10-22)
2. [HTTP Request credentials](https://docs.n8n.io/integrations/builtin/credentials/httprequest/) — n8n docs (read 2026-10-22)
3. [Let AI specify tool parameters with $fromAI()](https://docs.n8n.io/advanced-ai/examples/using-the-fromai-function/) — n8n docs (read 2026-10-22)

---

LLMWebSearch: LLMWebSearch is a web search API for AI agents that returns ranked results with the content of the top pages in Markdown, paid in crypto with no ID upload. Prepaid credits from $1.20/1K searches never expire. No KYC — no ID, no selfie, no documents. Pay in crypto.
