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"
}
FieldTypeNotes
nomestringFirst name
cognomestringLast name / surname
sesso"M" | "F"Gender
data_nascitastringDate of birth — YYYY-MM-DD
comune_nascitastringBelfiore 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"])  # RSSMRA90A15H501Z

JavaScript

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

PlanPriceDaily Calls
Free€010 / dayTesting & eval
Starter€9 / month1,000 / daySmall integrations
Pro€29 / monthUnlimitedProduction
Pay-as-you-go€0.01 / callNo capVariable usage

Get an API key

Email api@codice-fiscale.online or use the form below to get started with the free tier.