- Region-specific number formatting and validation
- Carrier and service provider information
- Portability information (US and Canada only)
Prerequisites
You need your Plivo Auth ID and Auth Token, which you can find on the Plivo console.Authentication
Lookup API requests are protected with HTTP Basic authentication. Use your Plivoauth_id as the username and auth_token as the password.
Look Up a Phone Number
Retrieve carrier and formatting information for a phone number.Request
+14155551234).
Query Parameters
| Name | Type | Description |
|---|---|---|
type | string | Set to carrier to retrieve carrier information |
Example Request
Response
Returns a JSON response with anapi_id that uniquely identifies the request.
Success Response (HTTP 200)
| Attribute | Type | Description |
|---|---|---|
api_id | string | Unique request identifier |
phone_number | string | The phone number in E.164 format |
country | object | Country information: name, iso2, iso3 |
format | object | Number formats: e164, national, international, rfc3966 |
carrier | object | Carrier details (see below) |
resource_uri | string | URI to look up the same number again |
Carrier Object
| Attribute | Type | Description |
|---|---|---|
mobile_country_code | string | MCC (empty for fixed numbers) |
mobile_network_code | string | MNC (empty for fixed numbers) |
name | string | Carrier name |
type | string | fixed, mobile, voip, toll-free, or unknown |
ported | string | yes, no, or unknown (US/Canada only) |
Success Example
Error Response
| Attribute | Type | Description |
|---|---|---|
api_id | string | Unique request identifier |
error_code | integer | Error code |
message | string | Error description |
Related
- Postman Collection - Test the Lookup API with Postman
- Troubleshooting - Error codes and solutions