Number Lookup API
Check phone numbers before you send: whether a number is valid, which carrier it belongs to, and whether it is mobile, landline or VoIP. One number at a time, up to 100 per request, or up to 10,000 per CSV batch.
What a lookup tells you
Lookups query carrier and numbering databases. They do not contact the phone or its network (this is not a live HLR query).
| Information | Provided | Notes |
|---|---|---|
| Valid / invalid number | Yes | Invalid numbers are free and never sent to our provider. |
| Carrier name | Yes | For Canadian numbers this may be the original carrier if the number was ported. |
| Line type | Yes | mobile, landline, voip, toll_free, premium or unknown. |
| Country, MCC / MNC | Yes | MCC is sometimes a country code (e.g. US) rather than numeric. |
| Ported | US only | Always false for Canadian numbers (no portability data). |
| Phone switched on / reachable | No | Needs a live network query, which this service does not make. Every result has "lookup_type": "database". |
| Roaming | No | |
| Still in service | No |
Authentication
Base URL: https://api.talky.ca/api/v1/hlr/
Create an API key on the API Keys page of your dashboard, ticking the hlr:lookup scope (add messages:read if the key should only read results), and send it in the Authorization header. The secret is shown only once, when you create the key.
Authorization: ApiKey tk_AbCd1234.your-secret
The key needs one of these scopes:
| To | Any one of these scopes |
|---|---|
| Run lookups (charged) | hlr:lookup, send or messages:send |
| Read history, batches, stats, balance | any of the above, or read / messages:read |
A key without the right scope gets 403. Requests from a logged-in dashboard session work too.
Pricing and billing
- Each lookup of a valid number is charged from your Talky balance before it runs, at the price shown on your Number Lookup page (also returned as
priceby/balance/). - Invalid numbers are free. If a lookup fails, it is refunded automatically.
- Every charge and refund appears in Billing → Transactions.
- If your balance doesn't cover a request, it is refused with
402and nothing is charged.
Look up one number
POST/lookup/ with {"phone": "..."} (any common format; Canadian/US numbers without a country code are accepted).
curl -X POST https://api.talky.ca/api/v1/hlr/lookup/ \
-H "Authorization: ApiKey tk_AbCd1234.your-secret" \
-H "Content-Type: application/json" \
-d '{"phone": "+14165550100"}'
{
"id": "6f1c…",
"phone": "+14165550100",
"is_valid": true,
"is_ported": false,
"network_type": "mobile",
"carrier": "Rogers Wireless",
"mcc": "302",
"mnc": "720",
"country": "Canada",
"country_code": "CA",
"error_message": null,
"lookup_type": "database",
"charged": 0.01,
"created_at": "2026-10-27T03:38:56.573200+00:00"
}
GET /lookup/?phone_number=+14165550100 works the same way.
Bulk: up to 100 numbers
POST/lookup/bulk/ with {"phone_numbers": [...]}. Repeated numbers are looked up (and charged) once. Results are keyed by number.
curl -X POST https://api.talky.ca/api/v1/hlr/lookup/bulk/ \
-H "Authorization: ApiKey tk_AbCd1234.your-secret" \
-H "Content-Type: application/json" \
-d '{"phone_numbers": ["+14165550100", "+16045550123"]}'
{
"success": true,
"total": 2,
"completed": 2,
"stopped": null,
"not_processed": [],
"results": { "+14165550100": { … }, "+16045550123": { … } }
}
A bulk request stops early rather than time out: stopped is "time", "balance" or "daily_limit", and the numbers it didn't reach are listed in not_processed (not charged). Send those again, or use a batch.
CSV batches: up to 10,000 numbers
POST/batch/ as multipart/form-data with a file field: a .csv (max 2 MB) whose first column is the phone number. Header rows, blank lines and duplicates are skipped. The batch is refused up front (402) if your balance can't cover its valid numbers.
curl -X POST https://api.talky.ca/api/v1/hlr/batch/ \
-H "Authorization: ApiKey tk_AbCd1234.your-secret" \
-F "file=@numbers.csv"
The batch runs in the background (usually a few hundred numbers a minute). Poll its status:
| Request | Returns |
|---|---|
GET/batches/ | Your batches, 20 per page (?page=2, ?status=completed) |
GET/batches/{id}/ | status (pending, processing, completed, failed), processed, valid, invalid, total_cost, error_message |
GET/batches/{id}/results/ | Results in upload order (?limit=100&offset=0, max 1,000 per page) |
GET/batches/{id}/export/?format=csv | All results as CSV (or format=json) |
A batch that runs out of balance or hits the daily limit stops with status: "failed" and an error_message; the numbers already done are kept and can be exported.
History, stats and balance
| Request | Returns |
|---|---|
GET/history/?limit=50 | Your most recent lookups (max 500; &carrier=rogers to filter) |
GET/stats/?days=30 | Totals: lookups, valid, invalid, ported, amount spent |
GET/carriers/?days=30 | Your valid lookups by carrier |
GET/balance/ | {"balance": 12.34, "enabled": true, "price": 0.01} |
You only ever see your own lookups.
Limits
| Limit | Value |
|---|---|
| Requests | 60 per minute per account (429 beyond that) |
| Bulk request | 100 numbers |
| Batch file | 10,000 numbers, 2 MB |
| Lookups per day | 10,000 per account (batches waiting to run count toward it) |
429 with a message saying so.Errors
Errors are JSON with a detail message.
| Status | Meaning |
|---|---|
400 | Missing or malformed input (e.g. no phone, more than 100 numbers, not a CSV) |
401 | Missing, invalid or revoked API key |
402 | Your balance doesn't cover the request; nothing was charged |
403 | The key lacks a required scope, or the account is suspended |
404 | Batch not found (or not yours) |
429 | Rate limit, your daily limit, or the platform pause; the message says which |
503 | Number Lookup isn't available at the moment |
A result with error_message set (e.g. "Invalid phone number" or "Lookup failed; not charged") is a completed request that wasn't charged.
Questions: contact support from your dashboard.
