Setup
Put them in your environment or
.env; Data APIs 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
Live HLR lookup of a phone number
- 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
- 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
- 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
- A read over POST; the body carries only the credentials.