How to validate and format a phone number with an API

Updated 2026-10-12

Use when an agent must parse a phone number and format it as E.164 or national before storing or dialling it.

From an MCP client, add https://tanod.dev/mcp and call parse_phone_number; its free daily calls are applied automatically, no key or signup.

POST a phone number to /v1/phone. It returns whether the number fits its country's numbering plan, its E.164, international, national and RFC 3966 forms, the region, number type, location and time zones.

Request

number is in international form (+CC ...) or in national form together with region, an ISO 3166-1 alpha-2 code such as US.

curl, using the free tier
curl -s -X POST https://tanod.dev/v1/phone \
  -H 'X-Tanod-Free: 1' -H 'content-type: application/json' \
  -d '{"number": "+1 202 555 0100"}'

Response

Response (example from the API spec, trimmed)
{
  "valid": true,
  "possible": true,
  "e164": "+12025550100",
  "international": "+1 202-555-0100",
  "national": "(202) 555-0100",
  "rfc3966": "tel:+1-202-555-0100",
  "country_calling_code": 1,
  "region": "US",
  "type": "fixed_line_or_mobile",
  "location": "Washington D.C.",
  "timezones": ["America/New_York"],
  "source": {
    "library": "phonenumbers 9.0.40",
    "license": "Apache-2.0",
    "url": "https://github.com/daviddrysdale/python-phonenumbers"
  },
  "note": "Offline numbering-plan check: 'valid' means the number fits its …"
}

Limits and caveats

Format, not reachability. valid means the number fits the numbering plan. It does not mean the number is assigned, in service or reachable, and no call or SMS is sent. To confirm ownership, send a verification code.

Carrier is the original range holder. Ported numbers are not detected, and type can be fixed_line_or_mobile where the plan does not tell them apart.

Checked offline with the open-source phonenumbers library. Tanod does not log or store the number; it is processed in memory for the answer.

Price and free allowance

USD 0.001 per call, paid in USDC on Base, Polygon, Solana, BNB Chain or Arbitrum with x402. 10 free calls per IP per UTC day with the header X-Tanod-Free: 1. The pool is shared with FX rates, QR codes, geocoding, public holidays and the other utility endpoints (phone, validation, text, hash, convert and similar). MCP tool: parse_phone_number at https://tanod.dev/mcp, where the free tier is automatic.

All endpoints →

Use it from Claude without writing code: in claude.ai or Claude Desktop, add https://tanod.dev/mcp/util?via=phone-number-validation-api as a custom connector (steps), then ask in plain words, for example "Format +14155552671 as a national number, and tell me where it is from." The free daily allowance is applied automatically over MCP. Beyond it a call needs an x402 payment, which these clients can make.

Related guides: What phone number validation APIs cost over x402, How to validate an IBAN or BIC with an API, How to verify an email address with an API (syntax, MX, disposable), How to parse a User-Agent string into browser, OS and device. Back to tanod.dev or the guide index. Results are automated and heuristic.