Validation Requests using our API
Our number validation service is different to a full HLR Lookup as we do not make a real time check with the relevant network.
This service simply tells you if your numbers are in a valid format, the country the number is from and the type of number that has been checked.
As this is a FREE request please limit your API calls to 5 requests per second.
Base URL https://hlrlookup.com/api/validate/
Method GET
Required Parameters:
apikey – Your API key can be obtained from your Account Settings
password – Your Account Password
msisdn – The number you wish to check
Try it – Copy this link into your browser and replace $key, $password and $msisdn with your own details.
https://hlrlookup.com/api/validate/?apikey=$key&password=$password&msisdn=$msisdn
Copy our code examples below to integrate a Validation Request into your own code
// Copy & paste the code snippet below
const axios = require('axios');
await axios.get('https://www.hlrlookup.com/api/validate/',
{
params:
{
apikey: 'Your API KEY goes here',
password: 'Your PASSWORD goes here',
msisdn: 'The number to check goes here'
}
}).then(function (response)
{
console.log(response.data);
});
// Copy & paste the code snippet below
function hlr_lookup($key, $password, $msisdn)
{
$curl = curl_init("https://www.hlrlookup.com/api/validate/?apikey=$key&password=$password&msisdn=$msisdn");
curl_setopt($curl, CURLOPT_HEADER,0);
curl_setopt($curl, CURLOPT_POST, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($curl);
curl_close($curl);
return $response;
}
# Python example for performing a Validation request using the hlrlookup.com API
# This example uses the 'requests' package for HTTP operations.
#(Install with "pip install requests")
import json
import requests
apikey = "Your API KEY goes here"
password = "Your PASSWORD goes here"
# Telephone number to lookup, including country code
msisdn = "447777123456"
url = "https://www.hlrlookup.com/api/validate/?apikey={0}&password={1}&msisdn={2}"
url = url.format(apikey, password, msisdn)
# Perform GET request
response = requests.get(url)
print("response.content: ", response.content)
# If request succeeded, parse JSON and use result
if response.status_code == 200:
# Parse JSON result and access individual fields
json_result = json.loads(response.content)
print("status: ", json_result["status"])
print("type: ", json_result["type"])
// Copy & paste the code snippet below
public void hlr_lookup(string key, string password, string msisdn)
{
WebRequest webRequest = WebRequest.Create("https://www.hlrlookup.com/api/validate/?apikey=" + key + "&password=" + password + "&msisdn=" + msisdn);
webRequest.Method = "GET";
WebResponse webResp = webRequest.GetResponse();
}
Please restrict your Validator API calls to 5 per second. We will monitor all validation requests sent through our API for over use and get in touch if we think you are sending too many.