SeoPrimo in n8n.
Three ways to connect SeoPrimo to your workflows: the HTTP Request node, the MCP Client node in an AI Agent and a Webhook with signature verification. Plus three ready-made workflows to download.
A single credential.
The HTTP node and the MCP node use the same credential. In n8n open Credentials, create a Header Auth credential and name it SeoPrimo API:
| Field | Value |
|---|---|
| Name | Authorization |
| Value | Bearer sp_live_… |
Create the key in the panel, under Integrations, API keys, with the read and write scopes. For read-only workflows read is enough.
The downloadable workflows contain no secrets: they refer to credentials by name. After importing, pick your credential in every node that uses it.
HTTP Request node.
The most direct way: every endpoint of the REST API is an HTTP call.
| Setting | Value |
|---|---|
| Method | POST |
| URL | https://seoprimo.it/api/v1/sites/{{ $json.site_id }}/audits |
| Authentication | Generic Credential Type, Header Auth, "SeoPrimo API" |
| Body | JSON, where the endpoint asks for it (the quick audit has no body) |
Importing endpoints
n8n does not read an OpenAPI file by itself. The quick way is the Import cURL button of the HTTP Request node: paste the curl call of an endpoint (the interactive documentation shows it with "Try it out", and you will find it in the examples of the API guide) and the node fills in method, address and body. Then pick the credential. The /api/v1/openapi.json file is the full contract, useful if you want to generate nodes or clients with an OpenAPI generator.
Waiting for a long job
The quick audit is followed with a loop: Wait, then GET /sites/{id}/audits and look for the audit by id, then an IF that goes back to Wait until the status is done or failed. Long jobs (full audit, rank check) are followed the same way with GET /runs/{id}. The first downloadable workflow does exactly this, with a limit of about 20 minutes.
If your n8n is reachable from the internet, webhooks avoid the loop: SeoPrimo tells you when the job is done.
MCP Client Tool node.
To let an agent use SeoPrimo: the eleven tools of the MCP server become tools of your AI Agent.
- Add an AI Agent node and connect a chat model to it.
- In the agent's Tool connector add MCP Client Tool.
- Endpoint:
https://seoprimo.it/mcp. Server Transport: HTTP Streamable. - Authentication: Header Auth, "SeoPrimo API" credential.
- Tools to Include: all of them, or only the ones you need (with a read-only key the agent can only use
seoprimo_score,seoprimo_report,seoprimo_creditsand the read actions of the others). - In the agent's instructions (System Message) tell it to call
dry_runbefore every credit tool and to start fromseoprimo_sitesto get thesite_id.
Try a message like: "check my credit balance, then run a quick audit of https://www.acmescarpe.it and tell me the Score". If the node is not in your n8n version, update it: the MCP Client Tool node is part of recent versions.
Webhook with signature verification.
To react to an event (Score changed, credits low, report ready) without polling the API. The SeoPrimo webhook signs every delivery: your workflow must check the signature on the raw body.
- Webhook node: Method
POST, a Path of your choice, Respond = "Using 'Respond to Webhook' Node". In Options turn Raw Body on. - Code node with the code below: it recomputes the HMAC on the raw body and returns
valid. - IF node on
valid: the true branch answers 200 and continues, the false branch answers 401 with Respond to Webhook. - On the n8n server set the environment variable
NODE_FUNCTION_ALLOW_BUILTIN=crypto: the Code node can load thecryptomodule only if it is allowed. - Activate the workflow, copy the Webhook node's Production URL and add it in Integrations, Webhooks choosing the events. The
whsec_…secret is shown only once: paste it into the Code node. - Press "Send test" on the webhook: a
testevent arrives.
// Verify X-SeoPrimo-Signature on the RAW body (Webhook node: option "Raw Body" ON).
// Needs the env var NODE_FUNCTION_ALLOW_BUILTIN=crypto on the n8n server (or '*').
const crypto = require('crypto');
// Paste the endpoint secret (whsec_...) here, or expose it as the env var SEOPRIMO_WEBHOOK_SECRET.
let secret = 'whsec_REPLACE_WITH_YOUR_SECRET';
try { if ($env.SEOPRIMO_WEBHOOK_SECRET) secret = $env.SEOPRIMO_WEBHOOK_SECRET; } catch (e) { /* env access blocked */ }
const TOLERANCE_SECONDS = 300;
const item = $input.first();
const header = String(item.json.headers['x-seoprimo-signature'] || '');
const raw = await this.helpers.getBinaryDataBuffer(0, 'data'); // the bytes exactly as received
let valid = false;
try {
const parts = Object.fromEntries(header.split(',').map((p) => p.split('=', 2)));
const t = parseInt(parts.t, 10);
const received = String(parts.v1 || '');
const expected = crypto.createHmac('sha256', secret).update(`${t}.`).update(raw).digest('hex');
const fresh = Math.abs(Date.now() / 1000 - t) <= TOLERANCE_SECONDS;
valid = fresh
&& received.length === expected.length
&& crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(received));
} catch (e) {
valid = false;
}
const event = valid ? JSON.parse(raw.toString('utf8')) : {};
return [{ json: { valid, id: event.id, type: event.type, created: event.created, data: event.data || {} } }];
The whsec_REPLACE_WITH_YOUR_SECRET value is a placeholder: replace it with your endpoint's secret or read it from $env.SEOPRIMO_WEBHOOK_SECRET. The code is the same as the Node verification in the webhook guide.
Download, import, activate.
Weekly quick audit by email
Every Monday it starts the quick audit of a site, waits for it to finish, reads the full Score and emails you the result.
Download the workflow seoprimo-weekly-audit-email.jsonScore changed: alert on Telegram or Slack
Receives the score.changed webhook, verifies the signature in a Code node and sends a Telegram message (Slack as a disabled alternative).
Download the workflow seoprimo-score-changed-telegram.jsonCredits running low: email alert
Receives the credits.low webhook, verifies the signature and emails you the balance and the threshold.
Download the workflow seoprimo-credits-low-email.json- Download the JSON file.
- In n8n: Workflows, "…" menu, Import from File.
- Pick your credentials in the nodes (SeoPrimo API, SMTP, Telegram) and replace the placeholders:
REPLACE_WITH_SITE_ID,you@example.com,REPLACE_WITH_CHAT_ID,whsec_REPLACE_WITH_YOUR_SECRET. - Test the workflow with Execute workflow (webhook ones, with "Send test" from the panel) and then activate it.
The first workflow spends 10 credits on every run (the quick audit): set its frequency sensibly. The sp_live_… and whsec_… placeholders are example words, not secrets.
Fewer clicks,
more results.
Create the key, download a workflow and get a message when the Score changes.