# Phone Number Lookup Service

### Features of phone number Lookup:

1. **Number Validation**: Confirms if the provided phone number is valid.
2. **Country Code Identification**: Determines the international country dialing code.
3. **National Number Format**: Provides the phone number in a national format.
4. **Carrier Information**: Identifies the carrier service associated with the phone number.
5. **Regional Identification**: Pinpoints the country or region of the phone number's registration.

## This service is essential for enterprises looking to verify user contact details, enhance customer data, and improve communication strategies.

<mark style="color:green;">`POST`</mark> `https://api.localmail.io/v1/lookup/phone-number`

#### Request Body

| Name                                            | Type   | Description                                                                                                                                                      |
| ----------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| phone\_number<mark style="color:red;">\*</mark> | String | Format: Should be in E.164 formatting for international numbers, which includes a + followed by the country code and the national number. Example: "+1234567890" |

{% tabs %}
{% tab title="200: OK " %}

```
{
  "original_number": "+91XXXXXXXXXX",
  "country_code": 91,
  "national_number": "XXXXXXXXXX",
  "is_valid": true,
  "carrier": "Example Carrier",
  "region": "Example Country"
}
```

{% endtab %}
{% endtabs %}

### Response Format

The API responds with a JSON object providing detailed information about the queried phone number:

* `original_number`: The original phone number queried.
* `country_code`: International country dialing code.
* `national_number`: National format of the phone number.
* `is_valid`: Boolean indicating if the phone number is valid.
* `carrier`: Name of the phone carrier.
* `region`: Country or region where the phone number is registered.

### Error Responses

* **400 Bad Request**: Invalid phone number format or missing data in the request.
* **401 Unauthorized**: Access token is missing or invalid.
* **404 Not Found**: Phone number not found in the database.
* **500 Internal Server Error**: Unexpected server error.
