Identity & Verification

Spanish DNI, NIE and NIF validation API

Validate Spanish identity and tax numbers in forms, onboarding and invoicing. The API recognises DNIs, NIEs, K, L and M numbers and company NIFs, checks the control character and returns the one expected when it does not match.

Category Identity & Verification
Endpoints 1
Key Features 4
Frequently asked questions 4

Used by people at these companies

InstantOutseerMongoDBRespondentSage Expense ManagementInstantlyD.R. HortonWhatConvertsAdobeLLM Pulse

Trust signals before you integrate

Transparent docs, authenticated requests, and visible reliability details make it easier to evaluate DomScan before you ship.

Live Service status

Check live service health and documented failure responses before you integrate.

OpenAPI API artifacts

OpenAPI, Swagger, Postman, CLI, SDK, and MCP links are one click away.

API keys Protected access

Authenticated endpoints use API keys with clear credit costs before you call them.

10,000 Free allowance

Start with 10,000 monthly credits and upgrade only when usage grows.

What this API helps you ship

Use this page as a production brief: endpoints, examples, response shape, and the workflow pieces needed to plug DomScan into your own product.

Product workflows

Embed domain checks, DNS intelligence, risk signals, or enrichment into onboarding, search, and internal tools.

Analyst automation

Replace repeated manual lookups with scheduled jobs, alerting, and reproducible investigation steps.

Clean JSON data

Use predictable fields, documented status codes, and credit costs instead of scraping provider pages.

AI and ops tooling

Feed agents, dashboards, SOAR playbooks, and CRMs through OpenAPI, SDK, Postman, or MCP.

Integration workflow

A simple path from first request to repeatable production usage.

1
Authenticate once

Send your API key with the documented header and keep requests consistent across services.

2
Query with examples

Start from the curl and HTTP samples, then map the parameters into your application code.

3
Operate and monitor

Use status codes, credit costs, and response fields to build retries, logs, and alerts.

Developer kit

Jump from this page into machine-readable docs, request collections, SDKs, or agent tooling.

Parameters and response map

Scan the inputs, output fields, and status codes before wiring the endpoint into your client.

Request parameters

Parameter

idcountry
Response fields

Example response

countrynormalizedvalidtypeentity_typecheckschecks.formatchecks.controlexpected_controlerrors
Status coverage

HTTP status codes

200400401402429

Endpoints

GET /v1/national-id/validate
Credits: 1Authentication: Authentication required

Trust signals before you integrate

Transparent docs, authenticated requests, and visible reliability details make it easier to evaluate DomScan before you ship.

Live Service status

Check live service health and documented failure responses before you integrate.

OpenAPI API artifacts

OpenAPI, Swagger, Postman, CLI, SDK, and MCP links are one click away.

API keys Protected access

Authenticated endpoints use API keys with clear credit costs before you call them.

10,000 Free allowance

Start with 10,000 monthly credits and upgrade only when usage grows.

Key Features

Every Spanish number type

DNI, NIE, K, L and M NIFs and company NIFs (formerly CIF), each recognised with its own format and control rules.

Expected control character

A wrong last character comes back with the correct one, so you can suggest the fix to your user.

Type of company

Company NIFs return the type of entity and enforce whether that type must end in a letter or a digit.

Forgiving input

Spaces, dots, hyphens, lowercase letters, the ES prefix and 7-digit DNIs without the leading zero are all accepted.

Example request

GET /v1/national-id/validate?id=B58378431 bash
curl -H "X-API-Key: $DOMSCAN_API_KEY" "https://domscan.net/v1/national-id/validate?id=B58378431"

Example response

200 OK json
{
  "country": "ES",
  "normalized": "B58378431",
  "valid": true,
  "type": "cif",
  "entity_type": "sociedad_responsabilidad_limitada",
  "checks": { "format": true, "control": true },
  "expected_control": null,
  "errors": []
}

Frequently asked questions

Does a valid result mean the person or company exists?

No. The check proves the number is well formed with a correct control character. It does not prove the number was issued or who holds it.

Can I confirm that a Spanish company is registered for VAT?

Yes. Send the NIF with the ES prefix to the VAT validation API, which checks it live with the EU VAT register.

Is any data stored or shared?

No. The check runs offline and the number is never sent to a third party.

How many credits does it cost?

One credit per number.

Related tools and resources

HTTP status codes

These are the HTTP status codes to handle, so you can tell apart successful responses, auth issues, credits, rate limits, missing data, and upstream failures.

OK 200

Request successful

Bad Request 400

Invalid parameters

Unauthorized 401

Missing or invalid API key/session.

Payment Required 402

Not enough credits to run this request.

Too Many Requests 429

Rate limit exceeded