v1 / v2
Balance Requests over API
Overview
You can use this API call to query the amount of credits you have left on your account.
This is a free request.
Method GET
https://hlrlookup.com/api/balance/
Required Parameters
For all balance requests 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 |
Example:
https://hlrlookup.com/api/balance/?apikey=$key&password=$password
Code Examples
Copy our code examples below to integrate a real time Balance Check into your own code
// Copy & paste the code snippet below
const axios = require('axios');
await axios.get('https://www.hlrlookup.com/api/balance/',
{
params:
{
apikey: 'Your API KEY goes here',
password: 'Your PASSWORD goes here'
}
}).then(function (response)
{
console.log(response.data);
}).catch(function (error)
{
console.log(error);
});
function balance_check($key,$password)
{
$curl = curl_init("https://www.hlrlookup.com/api/balance/?apikey=$key&password=$password");
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 balance check 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"
url = "https://www.hlrlookup.com/api/balance/?apikey={0}&password={1}&msisdn={2}"
url = url.format(apikey, password,)
# 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 balance_check(string key, string password)
{
WebRequest webRequest = WebRequest.Create("https://www.hlrlookup.com/api/balance/?apikey=" + key + "&password=" + password);
webRequest.Method = "GET";
WebResponse webResp = webRequest.GetResponse();
}