WEIR

Reddit and X Data in n8n: HTTP, Webhooks and MCP

Use Reddit and X data in n8n workflows: HTTP Request calls to Weir's API, signed monitor webhooks checked in a Code node, and the MCP Client Tool.


Published · Updated · 5 min read

Cover image: New mentions, into n8n

To use Reddit and X data in n8n, call Weir's REST API from an HTTP Request node with a bearer key.

For new mentions only, a Weir monitor pushes signed webhooks to n8n's Webhook node. For an AI Agent, the MCP Client Tool gives it the same tools Claude uses. We run Weir.

Paste this as the JSON body of an HTTP Request to POST https://api.weirapp.io/v1/x/search:

{
  "query": "acme",
  "excludeWords": ["hiring"],
  "language": "en",
  "minLikes": 2,
  "since": "2026-10-12T00:00:00Z",
  "limit": 20
}

Which n8n node should you use?

Pick by what should trigger the workflow:

You want Use
A scheduled report or search on demand HTTP Request node
Only new mentions, pushed to you A Weir monitor plus the Webhook node
An agent that decides what to look up MCP Client Tool on an AI Agent

Using Zapier or Make instead? Our Zapier and Make guides cover what still works.

Path 1: Call the API from an HTTP Request node

Create a key under API keys in the Weir dashboard. Keys start with weir_live_ and are shown once.

  1. Set the requestMethod POST, URL https://api.weirapp.io/v1/x/search or /v1/reddit/search.
  2. Add the credentialGeneric Credential Type, then Bearer Auth, holding your Weir key.
  3. Send the bodySend Body on, Body Content Type JSON, Specify Body: Using JSON.
  4. Split the resultsAdd a Split Out node on data to get one item per post.

For Reddit, only query is required. This body searches two communities for the past week:

{ "query": "\"acme\" pricing", "subreddits": ["saas", "startups"], "sort": "new", "time": "week" }

Keep the platforms in separate branches. An X post has text, url, likeCount and an author object. A Reddit post has title, permalink, score and author as a string.

An X call returns about 20 posts, one X page. To page, send meta.nextCursor back as cursor, and set a maximum, because each page is billed. Turn on Include Response Headers and Status to read x-credits-charged.

Path 2: Get new mentions from a monitor webhook

A scheduled search re-reads everything each time. A Weir monitor remembers what it has reported and sends only new items.

  1. Add a Webhook nodeHTTP Method POST, Respond Immediately, and the Raw Body option on.
  2. Register it with WeirCreate a webhook for monitor.result.created at the production URL. Save the whsec_ secret; it's shown once.
  3. Create a monitorGive it a search target and the webhook's id.
  4. Verify in a Code nodeCheck the signature on the raw bytes, then map each result.

Raw Body matters. The signature covers the exact bytes Weir sent, and n8n puts them in the binary property data.

The monitor body, sent to POST /v1/monitors:

{
  "name": "Acme mentions",
  "target": { "kind": "search", "query": "acme", "sources": ["reddit", "x"] },
  "schedule": "daily",
  "webhookId": "<webhook id>"
}

The free tier allows one monitor and one webhook, on daily or weekly. hourly needs a paid tier.

Add a Code node (JavaScript, Run Once for All Items). Its first half verifies the delivery:

const crypto = require("crypto");
const SECRET = "whsec_..."; // pasted: n8n 2.x blocks $env in the Code node by default
const { headers } = $input.first().json;
const timestamp = headers["weir-timestamp"] ?? "";
const raw = await this.helpers.getBinaryDataBuffer(0, "data");
const ts = Number(timestamp);
if (!Number.isFinite(ts) || Math.abs(Date.now() / 1000 - ts) > 300) throw new Error("Stale");
const expected = crypto
  .createHmac("sha256", SECRET)
  .update(`${timestamp}.${headers["weir-event-id"] ?? ""}.`)
  .update(raw)
  .digest("hex");
const a = Buffer.from(headers["weir-signature"] ?? "");
const b = Buffer.from(expected);
if (a.length !== b.length || !crypto.timingSafeEqual(a, b)) throw new Error("Bad signature");

Its second half turns each result into one n8n item:

const event = JSON.parse(raw.toString("utf8"));
if (event.type !== "monitor.result.created") return [];

return event.data.results.map((r) => {
  const isX = r.author !== null && typeof r.author === "object";
  return {
    json: {
      eventId: event.id,
      platform: isX ? "x" : "reddit",
      author: isX ? r.author.username : r.author,
      text: isX ? r.text : (r.title ?? r.body ?? ""),
      url: isX ? r.url : `https://www.reddit.com${r.permalink}`,
    },
  };
});

Then add a Filter node and a Slack node that posts {{ $json.platform }} / {{ $json.author }}: {{ $json.url }} to #mentions.

A delivery carries up to 25 items. If data.newResults is larger, GET /v1/monitors/{id}/results returns the rest, free.

Path 3: Give an AI Agent the MCP Client Tool

Attach an MCP Client Tool to an AI Agent node to let the agent decide what to search:

Setting Value
Endpoint https://api.weirapp.io/mcp
Server Transport HTTP Streamable
Authentication Bearer Auth with your key, or MCP OAuth2
Tools to Include Only what the agent needs, e.g. search_reddit, search_x

A shorter tool list keeps prompts smaller and spending easier to predict.

What it costs

You pay 1 credit per call or monitor run, plus each result: 3 credits per Reddit post, 1 per X post.

21credits at most for the X body above
76credits at most for 25 Reddit posts
23for a run with 4 new Reddit and 10 new X posts
1credit for a run that finds nothing new

Webhook deliveries and reading monitor results are free. After the 5,000 free monthly credits, packs start at $5 for 25,000 credits, as of October 2026. See pricing.

Caveats

  • There's no official Weir node. You use HTTP Request, Webhook and MCP Client Tool.
  • Self-hosted n8n needs crypto allowed. Set NODE_FUNCTION_ALLOW_BUILTIN=crypto and restart. It works on n8n Cloud.
  • Deliveries can repeat. weir-event-id stays the same on retries, so check eventId against a store if duplicates matter.
  • Weir isn't affiliated with Reddit or X, and reads public data only.

FAQ

Why does the signature never match?

Raw Body is off, or the code hashes parsed JSON. Turn Raw Body on in the Webhook node and hash getBinaryDataBuffer(0, "data").

Why does the MCP Client Tool return 405?

The node is on version 1 or 1.1, which uses SSE. Weir serves Streamable HTTP. Add a fresh node, or set Server Transport to HTTP Streamable.

Why do deliveries fail while I build?

The test URL only listens after Listen for test event. Register the production URL with Weir and publish the workflow. Weir disables an endpoint after 20 failures in a row.

Should n8n retry a 402?

No. A 402 means the Weir account is out of credits, and retrying never fixes it. Turn off retries for that status.

Sources