API

Phone Validation Tool API

Validate phone numbers and get detailed information including country, phone type, and formatted numbers.

Quick Start

bash
curl "https://softwaresphere.ca/tools/PhoneValidationTool/api.php?phone=+16478726583"

Endpoint

api.php
GET / POST https://softwaresphere.ca/tools/PhoneValidationTool/api.php

Parameters

phone
string Required

Phone number to validate. Supports various formats: E.164 (+16478726583), national (647-872-6583), or with country code (1-647-872-6583)

phone_number
string Optional (alias)

Alternative parameter name for phone

Response Structure

success boolean

Whether the API call was successful

valid boolean

Whether the phone number is valid

type string

Phone type: mobile, landline, mobile_or_landline, toll_free, or unknown

country_code string

International country code (e.g., +1, +44)

country_name string

Country name (e.g., United States/Canada, United Kingdom)

national_number string

Phone number without country code

formatted object

Contains: international, national, and e164 formatted versions

Authentication

Public Access

This endpoint is currently publicly accessible without an API key, allowing for seamless testing and integration.

Usage Examples

cURL

bash
curl "https://softwaresphere.ca/tools/PhoneValidationTool/api.php?phone=+16478726583"

JavaScript

javascript
fetch('https://softwaresphere.ca/tools/PhoneValidationTool/api.php?phone=+16478726583')
    .then(response => response.json())
    .then(data => {
        console.log('Valid:', data.valid);
        console.log('Type:', data.type);
        console.log('Country:', data.country_name);
    });

Example Response

json
{
    "success": true,
    "input": "+16478726583",
    "phone": "+16478726583",
    "valid": true,
    "type": "mobile_or_landline",
    "country_code": "+1",
    "country_name": "United States/Canada",
    "national_number": "6478726583",
    "formatted": {
        "international": "+1 6478726583",
        "national": "(647) 872-6583",
        "e164": "+16478726583"
    }
}