> ## Documentation Index
> Fetch the complete documentation index at: https://docs.webrouter.net/llms.txt
> Use this file to discover all available pages before exploring further.

# HLR Lookup

> Live HLR and mobile number portability lookups: whether a phone number is live, its type, and its original and current network.

![](https://mintcdn.com/webrouter/gPu3tCeozwRcDBjt/logo/data-apis/hlrlookup.webp?fit=max\&auto=format\&n=gPu3tCeozwRcDBjt\&q=85\&s=9e5718ff0d79e85e5030e55baaf57b4e)

[Web Catalog · Verification](https://docs.webrouter.net/data-apis.md?category=verification)

Needs&#x20;

`HLRLOOKUP_API_KEY`

,&#x20;

`HLRLOOKUP_API_SECRET`

Endpoints

4

Auth

Key in body

[Vendor docs](https://www.hlrlookup.com/knowledge)

&#x20;·&#x20;

[Pricing](https://www.hlrlookup.com/pricing)

## Setup

| Variable | | What it is |
| - | - | - |
| `HLRLOOKUP_API_KEY` | required | your hlrlookup.com API key (account > API settings) |
| `HLRLOOKUP_API_SECRET` | required | the API secret paired with that key |

Put them in your environment or `.env`; [Data APIs](https://docs.webrouter.net/vendors.md) covers the other ways.

## Notes

* hlrlookup.com, not the different provider hlr-lookups.com.
* Every call is a POST with a JSON body; the credentials travel in that body (this entry adds them).
* Send one number as telephone\_number, or up to 80 in requests; more than 80 is a BAD\_REQUEST.
* 429 Too many requests means the API is busy; back off and retry.
* Non-200 responses and per-result errors such as INSUFFICIENT\_CREDIT, BAD\_FORMAT and NO\_COVERAGE are not charged.

## Endpoints

POST

Live HLR lookup of a phone number

Number type, live status (LIVE, DEAD, ABSENT\_SUBSCRIBER...), original and current network, porting, for one number or up to 80.

[Open](#hlrlookup-hlr-lookup)

POST

Number portability lookup

Original and current network and whether the number is ported, without the live HLR status.

[Open](#hlrlookup-mnp-lookup)

POST

Validate and format a number

Number type, issuing network and formatted number from numbering plans only; no network query.

[Open](#hlrlookup-validate)

POST

Get credit balance

The account's remaining credits.

[Open](#hlrlookup-balance-get)

### Live HLR lookup of a phone number

POST

`/apiv2/hlr`

`hlrlookup.hlr.lookup`

Number type, live status (LIVE, DEAD, ABSENT\_SUBSCRIBER...), original and current network, porting, for one number or up to 80.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`telephone_number`</td><td>string</td><td>body</td><td>One number: international E.164 digits without '+', or national format with input\_format set. Use this or requests. Example `447790606023`</td></tr>
    <tr><td>`requests`</td><td>array</td><td>body</td><td>Batch of up to 80 items, each \{telephone\_number, and any of the options below}. Use this or telephone\_number. Example `[{"telephone_number": "447790606023"}, {"telephone_number": "16175551212", "usa_status": "YES"}]`</td></tr>
    <tr><td>`input_format`</td><td>string</td><td>body</td><td>'' (default) for international input, or the ISO3 country code when the number is national. Example `GBR`</td></tr>
    <tr><td>`output_format`</td><td>string</td><td>body</td><td>Format of formatted\_telephone\_number: '', E164, PLUS\_E164, NATIONAL, or an ISO3 country code. Example `PLUS_E164`</td></tr>

    <tr>
      <td>
        `cache_days_global`
      </td>

      <td>
        integer
      </td>

      <td>
        body
      </td>

      <td>
        Accept a shared cached result up to this many days old, 0 to 30.
      </td>
    </tr>

    <tr>
      <td>
        `cache_days_private`
      </td>

      <td>
        integer
      </td>

      <td>
        body
      </td>

      <td>
        Accept an account-private cached result up to this many days old, 0 to 30.
      </td>
    </tr>

    <tr><td>`get_ported_date`</td><td>string</td><td>body</td><td>Return ported\_date when available; default NO. One of `YES`, `NO`</td></tr>
    <tr><td>`get_landline_status`</td><td>string</td><td>body</td><td>Return landline\_status when available; default NO. One of `YES`, `NO`</td></tr>
    <tr><td>`usa_status`</td><td>string</td><td>body</td><td>For US numbers, return live status instead of NOT\_AVAILABLE\_NETWORK\_ONLY; costs an extra credit per lookup. One of `YES`, `NO`</td></tr>
    <tr><td>`get_imsi_hash`</td><td>string</td><td>body</td><td>Return an IMSI hash under current\_network\_details when available. One of `YES`, `NO`</td></tr>
  </tbody>
</table>

[Vendor docs](https://www.hlrlookup.com/hlr-api-v2.openapi.json) · Same job: [Telnyx](https://docs.webrouter.net/data-apis/telnyx.md#telnyx-number-lookup), [Trestle](https://docs.webrouter.net/data-apis/trestleiq.md#trestleiq-phone-validate), [Twilio](https://docs.webrouter.net/data-apis/twilio.md#twilio-lookup), [Whitepages Pro](https://docs.webrouter.net/data-apis/whitepages.md#whitepages-phone-get)

```python Python theme={null}
router.call_data_api("hlrlookup.hlr.lookup", {'telephone_number': '447790606023', 'requests': [{'telephone_number': '447790606023'}, {'telephone_number': '16175551212', 'usa_status': 'YES'}], 'input_format': 'GBR', 'output_format': 'PLUS_E164'})
```

```text MCP theme={null}
call_data_api(endpoint="hlrlookup.hlr.lookup", params={"telephone_number": "447790606023", "requests": [{"telephone_number": "447790606023"}, {"telephone_number": "16175551212", "usa_status": "YES"}], "input_format": "GBR", "output_format": "PLUS_E164"})
```

> [!NOTE]
>
> * A read over POST that spends credits (credits\_spent per result). Cached network data (cache\_days\_\*) can lower the charge; ported dates, usa\_status and landline status add to it.
> * The response is always \{results: \[...]}; each item has error 'NONE' or its own error, e.g. TOO\_MANY\_REQUESTS for one throttled item in a batch.
> * Whether a new result is stored in hlrlookup's cache follows the account's own cache setting; the save\_to\_cache option is left out because it can write to the cache shared by every hlrlookup user.

### Number portability lookup

POST

`/apiv2/mnp`

`hlrlookup.mnp.lookup`

Original and current network and whether the number is ported, without the live HLR status.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`telephone_number`</td><td>string</td><td>body</td><td>One number: international E.164 digits without '+', or national format with input\_format set. Use this or requests. Example `447790606023`</td></tr>
    <tr><td>`requests`</td><td>array</td><td>body</td><td>Batch of up to 80 items, each \{telephone\_number, and any of the options below}. Use this or telephone\_number. Example `[{"telephone_number": "447790606023"}, {"telephone_number": "16175551212", "usa_status": "YES"}]`</td></tr>
    <tr><td>`input_format`</td><td>string</td><td>body</td><td>'' (default) for international input, or the ISO3 country code when the number is national. Example `GBR`</td></tr>
    <tr><td>`output_format`</td><td>string</td><td>body</td><td>Format of formatted\_telephone\_number: '', E164, PLUS\_E164, NATIONAL, or an ISO3 country code. Example `PLUS_E164`</td></tr>

    <tr>
      <td>
        `cache_days_global`
      </td>

      <td>
        integer
      </td>

      <td>
        body
      </td>

      <td>
        Accept a shared cached result up to this many days old, 0 to 30.
      </td>
    </tr>

    <tr>
      <td>
        `cache_days_private`
      </td>

      <td>
        integer
      </td>

      <td>
        body
      </td>

      <td>
        Accept an account-private cached result up to this many days old, 0 to 30.
      </td>
    </tr>

    <tr><td>`get_ported_date`</td><td>string</td><td>body</td><td>Return ported\_date when available; default NO. One of `YES`, `NO`</td></tr>
  </tbody>
</table>

[Vendor docs](https://www.hlrlookup.com/hlr-api-v2.openapi.json) · Same job: [Neutrino API](https://docs.webrouter.net/data-apis/neutrino-api.md#neutrino-api-phone-hlr)

```python Python theme={null}
router.call_data_api("hlrlookup.mnp.lookup", {'telephone_number': '447790606023', 'requests': [{'telephone_number': '447790606023'}, {'telephone_number': '16175551212', 'usa_status': 'YES'}], 'input_format': 'GBR', 'output_format': 'PLUS_E164'})
```

```text MCP theme={null}
call_data_api(endpoint="hlrlookup.mnp.lookup", params={"telephone_number": "447790606023", "requests": [{"telephone_number": "447790606023"}, {"telephone_number": "16175551212", "usa_status": "YES"}], "input_format": "GBR", "output_format": "PLUS_E164"})
```

> [!NOTE]
>
> * A read over POST that spends credits: half the price of an HLR lookup; a ported date is charged on top. For +1 (NANP) numbers telephone\_number\_type is left out of results.
> * usa\_status and landline status do not work on this endpoint.
> * Whether a new result is stored in hlrlookup's cache follows the account's own cache setting; the save\_to\_cache option is left out because it can write to the cache shared by every hlrlookup user.

### Validate and format a number

POST

`/apiv2/validate`

`hlrlookup.validate`

Number type, issuing network and formatted number from numbering plans only; no network query.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`telephone_number`</td><td>string</td><td>body</td><td>One number: international E.164 digits without '+', or national format with input\_format set. Use this or requests. Example `447790606023`</td></tr>
    <tr><td>`requests`</td><td>array</td><td>body</td><td>Batch of up to 80 items, each \{telephone\_number, and any of the options below}. Use this or telephone\_number. Example `[{"telephone_number": "447790606023"}, {"telephone_number": "16175551212", "usa_status": "YES"}]`</td></tr>
    <tr><td>`input_format`</td><td>string</td><td>body</td><td>'' (default) for international input, or the ISO3 country code when the number is national. Example `GBR`</td></tr>
    <tr><td>`output_format`</td><td>string</td><td>body</td><td>Format of formatted\_telephone\_number: '', E164, PLUS\_E164, NATIONAL, or an ISO3 country code. Example `PLUS_E164`</td></tr>

    <tr>
      <td>
        `cache_days_global`
      </td>

      <td>
        integer
      </td>

      <td>
        body
      </td>

      <td>
        Accept a shared cached result up to this many days old, 0 to 30.
      </td>
    </tr>

    <tr>
      <td>
        `cache_days_private`
      </td>

      <td>
        integer
      </td>

      <td>
        body
      </td>

      <td>
        Accept an account-private cached result up to this many days old, 0 to 30.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://www.hlrlookup.com/hlr-api-v2.openapi.json) · Same job: [IPQualityScore](https://docs.webrouter.net/data-apis/ipqualityscore.md#ipqualityscore-phone-check), [Neutrino API](https://docs.webrouter.net/data-apis/neutrino-api.md#neutrino-api-phone-validate)

```python Python theme={null}
router.call_data_api("hlrlookup.validate", {'telephone_number': '447790606023', 'requests': [{'telephone_number': '447790606023'}, {'telephone_number': '16175551212', 'usa_status': 'YES'}], 'input_format': 'GBR', 'output_format': 'PLUS_E164'})
```

```text MCP theme={null}
call_data_api(endpoint="hlrlookup.validate", params={"telephone_number": "447790606023", "requests": [{"telephone_number": "447790606023"}, {"telephone_number": "16175551212", "usa_status": "YES"}], "input_format": "GBR", "output_format": "PLUS_E164"})
```

> [!NOTE]
>
> * A read over POST. Returns no live\_status, current network or porting.
> * Whether a new result is stored in hlrlookup's cache follows the account's own cache setting; the save\_to\_cache option is left out because it can write to the cache shared by every hlrlookup user.

### Get credit balance

POST

`/apiv2/balance`

`hlrlookup.balance.get`

The account's remaining credits.

Input

No inputs.

[Vendor docs](https://www.hlrlookup.com/hlr-api-v2.openapi.json)

```python Python theme={null}
router.call_data_api("hlrlookup.balance.get")
```

```text MCP theme={null}
call_data_api(endpoint="hlrlookup.balance.get")
```

> [!NOTE]
>
> * A read over POST; the body carries only the credentials.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.