Imperio Utilities

Documentazione API — REST, header X-API-Key, esempi cURL, Python & JS

Integra i tool Imperio via REST API: validazione CF/P.IVA/IBAN, FatturaPA SDI, Invoice OCR, AI e altro. Autenticazione con header X-API-Key, esempi cURL, Python e JavaScript, e una chiamata provabile senza account. Pensata per developer e agenti.

Come ci si autentica

Header: X-API-Key: imp_live_la_tua_chiave. Non è un Bearer token: l'header Authorization porta la sessione della web app, non l'integrazione — una chiave mandata come Bearer riceve «Session token not accepted or expired», che manda a cercare il problema nella sessione invece che nell'header.

Base URL: https://imperioutils.com/api/python. Una chiave gratuita si ottiene registrandosi su https://imperioutils.com/signup e si rigenera da https://imperioutils.com/settings/profile.

Senza account: una chiamata vera, e la sua risposta vera

curl -s -X POST https://imperioutils.com/api/registry/demo/fisco-it-validator \
  -H 'Content-Type: application/json' \
  -d '{"action":"cf","input":{"codice_fiscale":"RSSMRA85T10A562S"}}'
{
  "success": true,
  "data": {
    "valid": true,
    "codice_fiscale": "RSSMRA85T10A562S",
    "omocodia": false,
    "birth_date": "10/12/1985",
    "gender": "M",
    "municipality_code": "A562",
    "municipality_name": "San Giuliano Terme",
    "municipality_province": "PI"
  }
}

Con una chiave

cURL

curl -s -X POST https://imperioutils.com/api/python/italian/codice-fiscale/validate \
  -H 'X-API-Key: imp_live_la_tua_chiave' \
  -H 'Content-Type: application/json' \
  -d '{"codice_fiscale":"RSSMRA85T10A562S"}'

Python

import requests

r = requests.post(
    "https://imperioutils.com/api/python/italian/codice-fiscale/validate",
    headers={"X-API-Key": "imp_live_la_tua_chiave"},
    json={"codice_fiscale": "RSSMRA85T10A562S"},
)
print(r.json())

JavaScript

const res = await fetch("https://imperioutils.com/api/python/italian/codice-fiscale/validate", {
  method: "POST",
  headers: {
    "X-API-Key": "imp_live_la_tua_chiave",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ codice_fiscale: "RSSMRA85T10A562S" }),
});
console.log(await res.json());

Per le macchine

Spec OpenAPI: https://imperioutils.com/api/openapi-public.json — elenca i tool, il costo in crediti e gli schemi d'input.

Se integri un agente invece di un'applicazione la porta è il server MCP: https://imperioutils.com/mcp.

In English

Authenticate with the X-API-Key header — not a Bearer token. A free account issues a key; every fiscal tool is also callable anonymously through the public demo endpoint shown above, with a per-IP rate limit and no key at all. The supplier-guardian tools always need a key: they read one account's ledger.