Add live web search to a Dify workflow
Dify is an open-source LLM app platform where you build Workflows and Chatflows by wiring nodes on a canvas — no framework code required. To give a Dify app live web results you have two paths: drop in an HTTP Request node that calls the Superhighway REST API with a free key (simplest), or import Superhighway's OpenAPI spec as a Custom Tool and hand all five tools to an Agent node. Dify's variable syntax is {{variable_name}} throughout.
Two paths
| Path | Best for | What you need |
|---|---|---|
| HTTP Request node | The simplest setup — one endpoint (web search), wired into an LLM node | A free API key from /pricing |
| Custom Tool (OpenAPI) | An Agent node that calls all five tools as needed | The same free key + Settings → Tools → Custom |
Get a free API key
Create a free-tier key — no credit card — from Settings → API Keys → Generate, or with one request:
curl -X POST https://superhighway.walls.sh/auth/guest-key
The response contains a key you pass as a bearer token on every request.
Path 1 — HTTP Request node (REST API + free key)
In a Dify Workflow or Chatflow, add an HTTP Request node. Configure it like this:
| Field | Value |
|---|---|
| Method | GET |
| URL | https://superhighway.walls.sh/search |
| Params | q = {{query}}, limit = 5 |
| Headers | Authorization = Bearer YOUR_FREE_KEY |
Here {{query}} is the input variable carrying the user's question (the Start node's input, or any upstream variable). Replace YOUR_FREE_KEY with the key from the guest-key call above.
The HTTP Request node exposes the full JSON response body as {{http_request.body}}. The body is a JSON object whose results array holds objects with title, url, and description. You can hand the raw body straight to an LLM, or parse it first in a Code node.
Pass results to an LLM node. Add an LLM node after the HTTP Request node and feed the body in as context in the system prompt:
Here are web search results:
{{http_request.body}}
Answer the user's question using only these results. Cite the URLs.
That's the whole loop: Start → HTTP Request → LLM → End. The model reads the live results and answers. If you'd rather give the LLM clean text instead of raw JSON, drop a Code node between them and parse the body:
def main(body: str) -> dict:
import json
data = json.loads(body)
lines = []
for r in data.get("results", []):
lines.append(f"{r['title']}\n{r['url']}\n{r.get('description','')}")
return {"context": "\n\n".join(lines)}
Wire {{http_request.body}} into the Code node's input and reference {{code.context}} in the LLM node's prompt.
Same pattern, other endpoints. Swap the URL to /news, /images, /scrape, or /research — they take the same bearer header and return JSON in the same shape, so any of them drops into an HTTP Request node the same way.
Path 2 — Custom Tool from the OpenAPI spec (Agent node, all five tools)
Dify lets you add Custom Tools from an OpenAPI 3.0 spec, and Superhighway publishes a live one at https://superhighway.walls.sh/openapi.json. Importing it registers all five endpoints as tools an Agent can call on its own.
Go to Settings → Tools → Custom → Create Custom Tool. In the Schema field, either paste the OpenAPI URL https://superhighway.walls.sh/openapi.json to import it, or paste the JSON directly. Dify parses it and lists the available actions — search, news, images, scrape, and research.
Under Authorization, set the auth method to API Key / Bearer and enter your free key as the token (header Authorization: Bearer YOUR_FREE_KEY). Save the tool.
Now add an Agent node to a Workflow (or use Agent mode in a Chatflow), pick a model, and under Tools add the Superhighway tools you imported. The agent decides when to call them — ask a time-sensitive question and it invokes search or research, reads the live results, and answers. You can export the finished workflow as a YAML DSL file to share or version it.
x402 pay-per-call. Superhighway also supports x402 — paying per call in USDC on Base with no API key. That flow needs a funded wallet to sign payments, which Dify's HTTP layer doesn't do natively; for now use the free-key path above, or run self-hosted Dify with a Code node that holds the wallet and signs requests.
Which tools are available
| Tool / endpoint | What it returns | Price |
|---|---|---|
search / /search | Ranked web results — title, URL, description | $0.001 |
news / /news | Recent news with published dates | $0.001 |
images / /images | Image URLs, thumbnails, source pages | $0.001 |
scrape / /scrape | Any URL → clean markdown text | $0.002 |
research / /research | Search + read top pages in one call | $0.005 |
Full API reference: /openapi.json. Get a free API key or learn the x402 wallet flow.