SeoPrimo · SEO for Google and for AI · guaranteed presence, or your setup fee refunded · Free audit of your site
SeoPrimo · SEO for Google and for AI · guaranteed presence, or your setup fee refunded · Free audit of your site
seoprimo
— Developers · n8n

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.

HTTP
HTTP Request node
MCP
MCP Client Tool node
3
workflows to download
— Before you start

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:

Header Auth credential in n8n
FieldValue
NameAuthorization
ValueBearer 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.

— Way 1

HTTP Request node.

The most direct way: every endpoint of the REST API is an HTTP call.

HTTP Request node for the quick audit
SettingValue
MethodPOST
URLhttps://seoprimo.it/api/v1/sites/{{ $json.site_id }}/audits
AuthenticationGeneric Credential Type, Header Auth, "SeoPrimo API"
BodyJSON, 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.

— Way 2

MCP Client Tool node.

To let an agent use SeoPrimo: the eleven tools of the MCP server become tools of your AI Agent.

  1. Add an AI Agent node and connect a chat model to it.
  2. In the agent's Tool connector add MCP Client Tool.
  3. Endpoint: https://seoprimo.it/mcp. Server Transport: HTTP Streamable.
  4. Authentication: Header Auth, "SeoPrimo API" credential.
  5. 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_credits and the read actions of the others).
  6. In the agent's instructions (System Message) tell it to call dry_run before every credit tool and to start from seoprimo_sites to get the site_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.

— Way 3

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.

  1. Webhook node: Method POST, a Path of your choice, Respond = "Using 'Respond to Webhook' Node". In Options turn Raw Body on.
  2. Code node with the code below: it recomputes the HMAC on the raw body and returns valid.
  3. IF node on valid: the true branch answers 200 and continues, the false branch answers 401 with Respond to Webhook.
  4. On the n8n server set the environment variable NODE_FUNCTION_ALLOW_BUILTIN=crypto: the Code node can load the crypto module only if it is allowed.
  5. 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.
  6. Press "Send test" on the webhook: a test event arrives.
n8n Code node (JavaScript)
// 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.

— Ready-made workflows

Download, import, activate.

Trigger: Schedule Trigger

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.json
Trigger: Webhook

Score 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.json
Trigger: Webhook

Credits 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
  1. Download the JSON file.
  2. In n8n: Workflows, "…" menu, Import from File.
  3. 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.
  4. 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.

Automate

Fewer clicks,
more results.

Create the key, download a workflow and get a message when the Score changes.

What the guide gives you
HTTP
Any endpoint
Import cURL and a credential
MCP
An agent in n8n
eleven tools
3
Ready workflows
JSON without secrets