Getting Started with our API
Overview
The following pages will help you to get started with using our V1 API to check your numbers.
We recommend you submit all requests to HLR Lookup API over HTTPS.
HLR Lookup’s V1 API is based on GET standards, enabling you to use your browser for accessing URLs. Use any HTTP client in any programming language to interact with our API.
To use the HLR Lookup V1 API use the following base URL
Method: GET
https://hlrlookup.com/api/hlr/
Required Parameters
For all lookups you need to include your KEY and PASSWORD so we can authenticate your request.
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 check |
Making a request
To make a request you can copy the following code into your browser replacing $KEY, $PASSWORD and $MSISDN with your own details.
https://hlrlookup.com/api/hlr/?apikey=$key&password=$password&msisdn=$msisdn
A successful HLR Lookup of a valid number will result in one credit being removed from your balance.
Code Examples
Copy our code examples below to integrate a real time HLR Lookup into your own code
const axios = require('axios');
await axios.get('https://www.hlrlookup.com/api/hlr/',
{
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);
}).catch(function (error)
{
console.log(error);
});
function hlr_lookup($key, $password, $msisdn)
{
$curl = curl_init("https://www.hlrlookup.com/api/hlr/?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 HLR Lookup 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/hlr/?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"])
public void hlr_lookup(string key, string password, string msisdn)
{
WebRequest webRequest = WebRequest.Create("https://www.hlrlookup.com/api/hlr/?apikey=" + key + "&password=" + password + "&msisdn=" + msisdn);
webRequest.Method = "GET";
WebResponse webResp = webRequest.GetResponse();
}