PhoneValidator API
The PhoneValidator API is a powerful tool for developers looking to enhance the accuracy and reliability of phone number data in their applications. This API allows you to validate phone numbers in real-time, ensuring they adhere to international standards and providing valuable insights for communication systems, user registration processes, and more.
How to Use
To get started, make a POST request to the PhoneValidator API endpoint:
curl --request POST \
--url https://phone-validator5.p.rapidapi.com/ \
--header 'X-RapidAPI-Host: phone-validator5.p.rapidapi.com' \
--header 'X-RapidAPI-Key: YOUR-RAPIDAPI-KEY' \
--header 'content-type: application/json' \
--data '{
"phone": "<PHONE-NUMBER-WITH-PREFIX>"
}'
Request Parameters:
phone (string, required): The phone number to be validated. Ensure it includes the country code.
Response:
The API will respond with a JSON object containing information about the validation status of the provided phone number. Here’s an example:
{
"subRegion": "Northern Europe",
"e164": "+46707123456",
"rfc3966": "tel:+46-70-712-34-56",
"possible": true,
"significant": "707123456",
"type": "mobile",
"valid": true,
"input": "+46707123456",
"regionCode": "SE",
"canBeInternationallyDialled": true,
"alpha2": "SE",
"national": "070-712 34 56",
"alpha3": "SWE",
"countryName": "Sweden",
"international": "+46 70 712 34 56",
"region": "Europe",
"coutryCode": 46
}
Usage Example:
// Example using Node.js and the 'axios' library
const axios = require('axios');
const apiKey = 'YOUR-RAPIDAPI-KEY';
const apiUrl = 'https://phone-validator5.p.rapidapi.com/';
const phoneNumber = '+46707123456';
axios.post(apiUrl, { phone: phoneNumber }, {
headers: {
'X-RapidAPI-Host': 'phone-validator5.p.rapidapi.com',
'X-RapidAPI-Key': apiKey,
'Content-Type': 'application/json',
},
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
Replace ‘YOUR-RAPIDAPI-KEY’ with your actual RapidAPI key.