Docs/APIs/Tax ID Validator

Tax ID Validator

Validate US Tax IDs (SSN, EIN, ITIN)

OperationalCredits 10 per callp50 175msText ProcessingStar

Overview

Tax ID Validator removes spaces and hyphens from `taxid` and requires exactly nine digits; anything else returns `valid: false`, `type` Unknown, a format error and a fixed `risk_score` of 50. The type is then inferred from shape alone. A number starting with 9 is treated as an ITIN. A number written with a hyphen after the second digit (XX-XXXXXXX) is treated as an EIN. Every other nine-digit number is treated as an SSN. Because the leading 9 check runs first, an EIN with a 9x prefix is classified and validated as an ITIN, so send hyphen-formatted EINs and read `type` before trusting the result.

SSN rules reject area 000, 666 and 900 to 999, group 00 and serial 0000, stopping at the first failure, which is reported in `error` and the matching `validation_details` flag. EINs must start with one of the two-digit prefixes the IRS has assigned; unassigned prefixes such as 07, 08, 09, 17 or 89 fail `prefix_valid`. ITINs must have middle digits in 50 to 65, 70 to 88, 90 to 92 or 94 to 99, checked by `itin_range_valid`.

`normalized` is the hyphenated standard form, `digits_only` the bare digits, `last4` the final four, and `masked` hides all but those four (***-**-6789, or **-****6789 for an EIN). `taxid` echoes the input as sent. `is_placeholder` is true for all-identical digits or a strict ascending or descending run such as 123456789. `risk_score` adds 40 for a failed rule and 35 for a placeholder, so a valid placeholder scores 35; `risk_level` is high at 60 or above, medium at 25 or above, otherwise low. On the Free plan `type`, `type_full`, `format`, `is_placeholder`, the risk fields and the SSN component flags are null.

Live Test Tax ID Validator API →

Endpoint

One host, one path per API. The block below shows this call in four languages; every one of them is the same HTTP request. Making requests covers the timeouts, retries and parameter rules that apply to all of them. The SDKs wrap the same call in a typed client.

GEThttps://api.apiverve.com/v1/taxidvalidator
curl "https://api.apiverve.com/v1/taxidvalidator?taxid=123-45-6789" \
  -H "x-api-key: your_api_key_here"

Replace your_api_key_here with the key from your dashboard. When the inputs arrive as a list rather than one at a time, batch requests run up to 200 of them through this same API in a single call.

Authentication

Send your key in the x-api-key header. That is the only auth step — there is no token exchange and no per-endpoint scope to configure. Authentication covers creating, rotating and revoking keys.

401 is the only auth verdict

A 401 means the key is missing, invalid or expired. A 403 means the key is valid but not permitted here — blocked by a key restriction or an IP allow-list. Running out of credits is a 429.

Parameters

Sent in the query string. Premium parameters are accepted on every plan but only take effect on plans that include them.

ParameterTypeDescription
taxidRequiredstringThe US Tax ID to validate (SSN, EIN, or ITIN format)

Response

Every API returns the same three top-level keys, so one response handler covers your whole integration: status, error and data. Only data changes shape. Response format covers the envelope, the other output formats and how premium fields are withheld.

Sample response
{
  "status": "ok",
  "error": null,
  "data": {
    "valid": true,
    "taxid": "123-45-6789",
    "type": "SSN",
    "type_full": "Social Security Number",
    "format": "XXX-XX-XXXX",
    "normalized": "123-45-6789",
    "digits_only": "123456789",
    "masked": "***-**-6789",
    "last4": "6789",
    "is_placeholder": true,
    "validation_details": {
      "format_valid": true,
      "area_number_valid": true,
      "group_number_valid": true,
      "serial_number_valid": true
    },
    "risk_score": 35,
    "risk_level": "medium",
    "error": null
  }
}

Response fields

Paths are relative to data. Premium fields are absent rather than zeroed on plans that do not include them, so check for presence instead of comparing to 0.

FieldTypeExampleDescription
validbooleantrueWhether the Tax ID passed validation checks
taxidstring"123-45-6789"The formatted Tax ID with standard formatting applied
typePremiumstring"SSN"Abbreviated Tax ID type: SSN, EIN, or ITIN
type_fullPremiumstring"Social Security Number"Full name of Tax ID type like Social Security Number
formatPremiumstring"XXX-XX-XXXX"Expected format pattern for the Tax ID type
normalizedstring"123-45-6789"Tax ID normalized to standard format with hyphens
digits_onlystring"123456789"Tax ID with all non-numeric characters removed
maskedstring"***-**-6789"Tax ID with sensitive digits masked for privacy protection
last4string"6789"Last four digits of the Tax ID only
is_placeholderPremiumbooleantrueWhether the number is obvious filler (all-identical digits or a simple sequence like 123-45-6789) — true even when it structurally validates
validation_detailsobject{...}
format_validPremiumbooleantrueWhether the Tax ID matches the expected format
area_number_validPremiumbooleantrueWhether SSN area number is valid (first three digits)
group_number_validPremiumbooleantrueWhether SSN group number is valid (middle two digits)
serial_number_validPremiumbooleantrueWhether SSN serial number is valid (last four digits)
risk_scorePremiumnumber35Composite 0-100 risk score combining structural validity and placeholder detection (higher is riskier)
risk_levelPremiumstring"medium"Risk band derived from the score: low, medium or high
errorobjectnullError message if validation failed, otherwise null

Errors

Read the HTTP status first, then error for the specific reason. The body names the parameter that has to change. Error handling covers the full status list and which of them are worth retrying.

StatusMeaningWhat to do
400Input was rejectedRead error; it names the parameter.
401Key missing or invalidCheck the header name and the key value.
403Key valid, but not permittedA key restriction or IP allow-list; see key scoping.
429Rate limited, or out of creditsRead error to tell them apart; see rate limits.

Use cases

Form Validation
Validate Tax IDs in online forms and applications to ensure correct format before submission
Compliance
Verify Tax ID format compliance for tax reporting, payroll processing, and financial services
Data Quality
Validate Tax IDs in databases during data cleaning and migration to identify invalid entries
Identity Verification
Check Tax ID format as part of identity verification processes while maintaining privacy with masking

Other ways to use Tax ID Validator

Set up Tax ID Validator on APIVerve, or reach the same source a different way. Your APIVerve account and credits work on all of them — one key, one balance.

Give it to an AI agentConnect over MCP and your agent calls it as a native tool — Claude, Cursor, ChatGPT.VerveKit →Reference →
Google Sheets or ExcelA =VERVE() formula fills a column — no script, no export, recalculates in place.VerveSheets →Reference →

More in Text Processing:

Was this page helpful?