{"uid":"cap_zRTtVVVdKgl0I13gJ6UK7","slug":"x402-utils-phone-number-validation-formatting-e7fe864e","name":"x402 Utils – Phone Number Validation & Formatting","description":"Check whether a phone number is valid and possible, find its country and type (mobile, fixed line, toll free and others), and format it as E.164, international and national (libphonenumber metadata).","url":"https://qcb7fnxsbd7fbhj4.68r.lambda-web.us-east-1.on.aws/v1/phone?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["number"],"properties":{"number":{"type":"string","description":"the phone number, international (+81 3-1234-5678) or national with country"},"country":{"type":"string","description":"ISO country code for national numbers, such as JP"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"e164":{},"type":{},"valid":{},"country":{},"national":{},"international":{}}}}}}},"responseSchema":{"type":"json","example":{"e164":"+16502530000","type":"FIXED_LINE_OR_MOBILE","valid":true,"country":"US","national":"(650) 253-0000","international":"+1 650 253 0000"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_pczvORhbajpNQDdbxO0-0","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Validates a phone number, identifies its country and type (mobile, fixed line, toll-free, etc.), and returns it formatted as E.164, international, and national formats using libphonenumber metadata.","exampleAgentPrompt":"Can you check if +1 650-253-0000 is a valid phone number, tell me what type it is (mobile, landline, etc.) and what country it belongs to, and give me its properly formatted E.164 version?","exampleUseCases":[{"title":"Validate user-submitted phone at signup","prompt":"Before we create this account, check whether the phone number the user entered — +44 7911 123456 — is valid, and tell me if it's a mobile number in the UK."},{"title":"Normalize contact list to E.164","prompt":"I have a Japanese phone number written nationally as 03-1234-5678 with country code JP — can you validate it and give me the clean E.164 and international format I need to store in our system?"},{"title":"Identify toll-free vs mobile number","prompt":"Can you tell me whether +1 800 555 0199 is a real phone number, what type it is (toll-free, mobile, or landline), and format it in E.164?"}],"resultDescription":"A JSON object containing: whether the number is valid (boolean), the phone number type (e.g. MOBILE, FIXED_LINE, TOLL_FREE, FIXED_LINE_OR_MOBILE), the ISO country code, and three formatted representations — E.164 (e.g. +16502530000), international (e.g. +1 650 253 0000), and national (e.g. (650) 253-0000).","failureModes":["Invalid or unparseable phone number string returns valid: false with no formatting","Missing required 'number' query parameter causes a 400 error","National number provided without a country code (ISO) may fail or misclassify","Rare or extremely new number ranges may not be recognized by libphonenumber metadata"],"whenToPreferThis":"Use this endpoint when you need authoritative phone number validation and multi-format output (E.164, international, national) powered by Google's libphonenumber data — the gold standard for phone parsing. Prefer it over regex-only checks, which cannot verify number range validity or classify type. Ideal for pre-flight checks before sending SMS, normalizing phone data for storage, or enriching contact records with country and line-type metadata.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T06:31:02.186Z","isFirstParty":false,"canonicalSlug":"x402-utils-phone-number-validation-formatting-e7fe864e"}