HLR Lookup Documentation

The HLR Lookup Developer Hub

Welcome to the HLR Lookup help pages. Here you'll find all the information you need to get started with our API or batch upload services.
Search the docs for explanations on the results you'll receive and a breakdown of all the possible parameters available.

Validation Requests over API

Here's how to use the API to validate your numbers.

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.

This is a free request.

The process of getting a validate request API is the same as a HLR look up request, the required parameters are the same but the base URL has slightly changed by adding /validate at the end.

URL: https://www.hlrlookup.com/api/validate/
Method: GET

Required Parameters

apikey - Your API key, obtained from account settings

password - Your account password

msisdn - The number you wish check.

This is limited to a maximum of 1 number per request.

For Example

https://www.hlrlookup.com/api/validate/?apikey=$key&password=$password&msisdn=$msisdn

Note

Replace $key, $password and $msisdn with your own details

Examples:

function validate($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;
}
static size_t hlr_result(char *ptr, size_t size, size_t nmemb, void *userdata)
{
	printf( "Validation Result: %s\n" ptr );
 
	return size*nmemb;
}
 
CURLcode validate( char* szKey, char* szPassword, char* szMSISDN )
{
	char szURL[1024];
	sprintf( szURL, "https://www.hlrlookup.com/api/validate/?apikey=%s&password=%smsisdn=%s", szKey, szPassword, szMSISDN );
 
	CURL* pCurl = curl_easy_init();
 
	curl_easy_setopt( pCurl, CURLOPT_URL, szURL );
	curl_easy_setopt( pCurl, CURLOPT_FOLLOWLOCATION, 1L );
	curl_easy_setopt( pCurl, CURLOPT_WRITEFUNCTION, &hlr_result );
	curl_easy_setopt( pCurl, CURLOPT_HEADER, 0 );
	curl_easy_setopt( pCurl, CURLOPT_POST, 0L );
 
	CURLcode res = curl_easy_perform( pCurl );
	curl_easy_cleanup(pCurl);
	return res;
}
void validate( 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();
}