PHPackages                             vmgltd/hlr-lookup-api-php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. vmgltd/hlr-lookup-api-php-sdk

ActiveLibrary[API Development](/categories/api)

vmgltd/hlr-lookup-api-php-sdk
=============================

Official HLR Lookup API PHP SDK by www.hlr-lookups.com

0.0.14(8y ago)2021.4k↓21.7%40Apache-2.0PHPPHP &gt;=5.3.0

Since Dec 28Pushed 3y ago6 watchersCompare

[ Source](https://github.com/vmgltd/hlr-lookup-api-php-sdk)[ Packagist](https://packagist.org/packages/vmgltd/hlr-lookup-api-php-sdk)[ Docs](https://www.hlr-lookups.com)[ RSS](/packages/vmgltd-hlr-lookup-api-php-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)DependenciesVersions (5)Used By (0)

HLR Lookups SDK (PHP)
=====================

[](#hlr-lookups-sdk-php)

Official HLR Lookup API SDK for PHP by [www.hlr-lookups.com](http://www.hlr-lookups.com). Obtain live mobile phone connectivity and portability data from network operators directly.

This SDK implements the REST API documented at  and includes an [HLR API](https://www.hlr-lookups.com/en/api-docs#post-hlr-lookup) (live connectivity), [NT API](https://www.hlr-lookups.com/en/api-docs#post-nt-lookup) (number types), as well as an [MNP API](https://www.hlr-lookups.com/en/api-docs#post-mnp-lookup) (mobile number portability).

For SDKs in different programming languages, see

Requirements
------------

[](#requirements)

- PHP &gt;=5.3.0
- cURL extension for PHP
- OpenSSL extension for PHP

Installation as Drop-In
-----------------------

[](#installation-as-drop-in)

Copy the contents of `src` into the "include path" of your project.

**Usage Client**

```
include('HlrLookupClient.class.php');

$client = new HlrLookupClient(
    'YOUR-API-KEY',
    'YOUR-API-SECRET',
    '/var/log/hlr-lookups.log' // an optional log file location
);
```

Get your API key and secret [here](https://www.hlr-lookups.com/en/api-settings).

Examples
--------

[](#examples)

**Test Authentication** ([Authentication Docs](https://www.hlr-lookups.com/en/api-docs#get-auth-test))

Performs an authenticated request against the `GET /auth-test` endpoint. A status code of 200 indicates that you were able to authenticate using your [API credentials](https://www.hlr-lookups.com/en/api-settings).

```
$response = $client->get('/auth-test');

if ($response->httpStatusCode == 200) {
    // authentication was successful
}
```

**Submitting an HLR Lookup** ([HLR API Docs](https://www.hlr-lookups.com/en/api-docs#post-hlr-lookup))

```
$response = $client->post('/hlr-lookup', array(
    'msisdn' => '+905536939460'
));

// capture the HTTP status code and response body
$status_code = $response->httpStatusCode;
$data = $response->responseBody;
```

The HLR API Response Object:

```
{
   "id":"f94ef092cb53",
   "msisdn":"+14156226819",
   "connectivity_status":"CONNECTED",
   "mccmnc":"310260",
   "mcc":"310",
   "mnc":"260",
   "imsi":"***************",
   "msin":"**********",
   "msc":"************",
   "original_network_name":"Verizon Wireless",
   "original_country_name":"United States",
   "original_country_code":"US",
   "original_country_prefix":"+1",
   "is_ported":true,
   "ported_network_name":"T-Mobile US",
   "ported_country_name":"United States",
   "ported_country_code":"US",
   "ported_country_prefix":"+1",
   "is_roaming":false,
   "roaming_network_name":null,
   "roaming_country_name":null,
   "roaming_country_code":null,
   "roaming_country_prefix":null,
   "cost":"0.0100",
   "timestamp":"2020-08-07 19:16:17.676+0300",
   "storage":"SYNC-API-2020-08",
   "route":"IP1",
   "processing_status":"COMPLETED",
   "error_code":null,
   "data_source":"LIVE_HLR"
}
```

A detailed documentation of the attributes and connectivity statuses in the HLR API response is [here](https://www.hlr-lookups.com/en/api-docs#post-hlr-lookup).

**Submitting a Number Type (NT) Lookup** ([NT API Docs](https://www.hlr-lookups.com/en/api-docs#post-nt-lookup))

```
$response = $client->post('/nt-lookup', array(
    'number' => '+4989702626'
));

// capture the HTTP status code and response body
$status_code = $response->httpStatusCode;
$data = $response->responseBody;
```

The NT API Response Object:

```
{
     "id":"2ed0788379c6",
     "number":"+4989702626",
     "number_type":"LANDLINE",
     "query_status":"OK",
     "is_valid":true,
     "invalid_reason":null,
     "is_possibly_ported":false,
     "is_vanity_number":false,
     "qualifies_for_hlr_lookup":false,
     "mccmnc":null,
     "mcc":null,
     "mnc":null,
     "original_network_name":null,
     "original_country_name":"Germany",
     "original_country_code":"DE",
     "regions":[
        "Munich"
     ],
     "timezones":[
        "Europe/Berlin"
     ],
     "info_text":"This is a landline number.",
     "cost":"0.0050",
     "timestamp":"2015-12-04 10:36:41.866283+00",
     "storage":"SYNC-API-NT-2015-12",
     "route":"LC1"
}
```

A detailed documentation of the attributes and connectivity statuses in the NT API response is [here](https://www.hlr-lookups.com/en/api-docs#post-nt-lookup).

**Submitting an MNP Lookup (Mobile Number Portability)** ([MNP API Docs](https://www.hlr-lookups.com/en/api-docs#post-mnp-lookup))

```
$response = $client->post('/mnp-lookup', array(
    'msisdn' => '+14156226819'
));

// capture the HTTP status code and response body
$status_code = $response->httpStatusCode;
$data = $response->responseBody;
```

The MNP API Response Object:

```
{
   "id":"e428acb1c0ae",
   "msisdn":"+14156226819",
   "query_status":"OK",
   "mccmnc":"310260",
   "mcc":"310",
   "mnc":"260",
   "is_ported":true,
   "original_network_name":"Verizon Wireless:6006 - SVR/2",
   "original_country_name":"United States",
   "original_country_code":"US",
   "original_country_prefix":"+1415",
   "ported_network_name":"T-Mobile US:6529 - SVR/2",
   "ported_country_name":"United States",
   "ported_country_code":"US",
   "ported_country_prefix":"+1",
   "extra":"LRN:4154250000",
   "cost":"0.0050",
   "timestamp":"2020-08-05 21:21:33.490+0300",
   "storage":"WEB-CLIENT-SOLO-MNP-2020-08",
   "route":"PTX",
   "error_code":null
}
```

A detailed documentation of the attributes and connectivity statuses in the MNP API response is [here](https://www.hlr-lookups.com/en/api-docs#post-mnp-lookup).

API Documentation
-----------------

[](#api-documentation)

Please inspect  for detailed API documentation or email us at .

Support and Feedback
--------------------

[](#support-and-feedback)

We appreciate your feedback! If you have specific problems or bugs with this SDK, please file an issue on Github. For general feedback and support requests, email us at .

Contributing
------------

[](#contributing)

1. Fork it (  )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~246 days

Total

5

Last Release

3174d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c409ac0e3a438004c1373f1a49453deb10b80253dad1b4ca9448e50cf1ab247e?d=identicon)[marcinxvmg](/maintainers/marcinxvmg)

---

Top Contributors

[![marcinx](https://avatars.githubusercontent.com/u/4034123?v=4)](https://github.com/marcinx "marcinx (31 commits)")[![marcinxvmg](https://avatars.githubusercontent.com/u/9935797?v=4)](https://github.com/marcinxvmg "marcinxvmg (15 commits)")[![amaelftah](https://avatars.githubusercontent.com/u/17250137?v=4)](https://github.com/amaelftah "amaelftah (1 commits)")

---

Tags

hlrhlr-apihlr-datahlr-lookupshlr-querymccmccmncmncmnpmnp-apimnp-datamscportabilitysdkhlrhlr lookuphlr lookup apinumber type lookupslandline lookups

### Embed Badge

![Health badge](/badges/vmgltd-hlr-lookup-api-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/vmgltd-hlr-lookup-api-php-sdk/health.svg)](https://phpackages.com/packages/vmgltd-hlr-lookup-api-php-sdk)
```

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)[hubspot/api-client

Hubspot API client

23914.2M16](/packages/hubspot-api-client)[smsapi/php-client

SMSAPI API PHP Client

652.1M17](/packages/smsapi-php-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
