Validation Requests using our API
Overview
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.
Method GET
https://hlrlookup.com/api/validate/
Required Parameters
Required Parameter | Value | Notes |
| The API KEY you want to use | You can find your KEY by navigating to your account settings |
| The Password to go with the API KEY | This is the Password you created when creating an account |
| The number you want to validate |
Example:
https://hlrlookup.com/api/validate/?apikey=$key&password=$password&msisdn=$msisdn
Code Examples
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();
}
Over Use
Please restrict your Validator API calls to 5 per second. We will monitor all validation requests sent through our API for over use. Accounts will be blocked if we identify that this service is being abused.
If you wish to send more requests than we currently allow please contact support and we'll be happy to help.