Codice Fiscale API
Calculate Italian tax codes programmatically. One endpoint. JSON in, Codice Fiscale out.
Endpoint
POST https://codice-fiscale.online/api/v1/calculate Content-Type: application/json Authorization: Bearer <your_api_key>
Request
{
"nome": "Mario",
"cognome": "Rossi",
"sesso": "M",
"data_nascita": "1990-01-15",
"comune_nascita": "H501"
}| Field | Type | Notes |
|---|---|---|
| nome | string | First name |
| cognome | string | Last name / surname |
| sesso | "M" | "F" | Gender |
| data_nascita | string | Date of birth — YYYY-MM-DD |
| comune_nascita | string | Belfiore code (e.g. H501 for Roma, Z401 for France) |
Response
// 200 OK
{
"codice_fiscale": "RSSMRA90A15H501Z",
"computed_at": "2026-03-13T14:00:00Z"
}
// 400 Bad Request
{ "error": "Missing required fields: nome, cognome, sesso, data_nascita, comune_nascita" }
// 401 Unauthorized
{ "error": "Invalid API key" }
// 429 Too Many Requests
{ "error": "Rate limit exceeded", "plan": "free", "limit": 10, "calls_today": 10 }Code Examples
curl
curl -X POST https://codice-fiscale.online/api/v1/calculate \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"nome":"Mario","cognome":"Rossi","sesso":"M","data_nascita":"1990-01-15","comune_nascita":"H501"}'Python
import requests
resp = requests.post(
"https://codice-fiscale.online/api/v1/calculate",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"nome": "Mario", "cognome": "Rossi", "sesso": "M",
"data_nascita": "1990-01-15", "comune_nascita": "H501"}
)
print(resp.json()["codice_fiscale"]) # RSSMRA90A15H501ZJavaScript
const res = await fetch('https://codice-fiscale.online/api/v1/calculate', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_API_KEY' },
body: JSON.stringify({ nome: 'Mario', cognome: 'Rossi', sesso: 'M',
data_nascita: '1990-01-15', comune_nascita: 'H501' })
})
const { codice_fiscale } = await res.json()Pricing
| Plan | Price | Daily Calls | |
|---|---|---|---|
| Free | €0 | 10 / day | Testing & eval |
| Starter | €9 / month | 1,000 / day | Small integrations |
| Pro | €29 / month | Unlimited | Production |
| Pay-as-you-go | €0.01 / call | No cap | Variable usage |
Get an API key
Email api@codice-fiscale.online or use the form below to get started with the free tier.