HLR Lookup

GET Method

This API allows you to get comprehensive information about a phone number by just using it's Lookup ID. A Lookup ID is generated when you query for lookup information for a single number using GET API Lookup or for multiple phone numbers using the POST API Lookup. When a lookup if performed for multiple numbers, the response does not contain comprehensive information about the phone number. However, with the Lookup ID generated for each phone number, you can pass the id as a parameter to this API and get all the details for the phone number.

  1. Sign up for free

Before you get started, sign up in Kaleyra Cloud for free and Create an API Key. To view the API Key and the SID, see View API Key and SID.

  1. Get API Lookup

Use the following command:

curl -X GET "https://api.kaleyra.io/v1/<SID>/lookup/pull/<LOOKUP_ID>" \
     -H 'api-key: <API_KEY>' \
     -H 'Content-Type: <CONTENT_TYPE>'

Replace placeholders above with relevant values as described in the table below:

ReplaceWithExamplesMandatory?
SIDAccount SID (Security Identifier). Generated by Kaleyra.io while creating an API key.HXXXXXXX071USTrue
LOOKUP_IDThe Lookup ID of the phone number for which you want to access details. This ID is generated when you perform a Get or Post Lookup request for a phone number.1d762218-XXXf-XXXd-XXXX-XbXdXbXdXbbX:1
API_KEYYour API Key generated by Kaleyra.io.
Example: Ac4XXXXX21f
Ac4XXXXX21fTrue
CONTENT_TYPEIndicates the format of the content the API will be processing.application/jsonTrue
  1. View Response

{
    "data": {
        "code": "LKP200",
        "message": "Request processed successfully",
        "total": 1,
        "failed_count": 0,
        "data": [
            {
                "lookup_id": "XdXXXXXX-XXXf-XXXd-XXXX-XbXdXbXdXbbXX:X",
                "phone_number": "+9190XXXXXX",
                "national_format": "091XXXXXXXX",
                "country": "India",
                "iso": "IN",
                "country_code": 91,
                "type": "MOBILE",
                "current_mcc": "404",
                "current_mnc": "06",
                "current_operator": "Airtel // Karnataka",
                "original_mcc": "",
                "original_mnc": "",
                "original_operator": "Airtel // Karnataka",
                "roaming_mcc": "404",
                "roaming_mnc": "06",
                "roaming_opearator": "Airtel // Karnataka",
                "is_ported": 0,
                "url": "https://api.ap.kaleyra.io/v1/HXXXXXXX071US/lookup/pull/XdXXXXXX-XXXf-XXXd-XXXX-XbXdXbXdXbbXX:X"
            }
        ],
        "error": []
    },
    "error": {}

📘

Note:

In case of an error, ensure that the parameter values are correct in the above code. Refer to the Understand Error Codes page for detailed information.