---
title: Phone Validation API - Carrier Lookup, Line Type Detection & Location Data
version: 1.0.0
description: Validate a single phone number and receive detailed metadata including carrier, line type, geolocation, time zones, and four standardized formats (E.164, International, National, RFC3966). Accepts international format (+ prefix), local format (with region), or IDD format (with dialer_region). Returns possible/valid status, country code, national number, area code length, and NDC length.
openapi: 3.1.1
servers:
  - https://api.apifreaks.com/v1.0
paths: 1
operations: 1
schemas: 5
---

## Table of Contents

- [Phone Validation API - Carrier Lookup, Line Type Detection & Location Data v1.0.0](#phone-validation-api-carrier-lookup-line-type-detection-location-data-v100)
  - [Authentication](#authentication)
  - [Phone Validation APIs](#phone-validation-apis)
    - [validatePhoneNumber](#validatephonenumber)
      - [Parameters](#parameters)
      - [Responses](#responses)
  - [Schemas](#schemas)
    - [PhoneValidationResponse](#phonevalidationresponse)
    - [PhoneRawInput](#phonerawinput)
    - [PhoneFormats](#phoneformats)
    - [PhoneValidationRequest](#phonevalidationrequest)
    - [ErrorResponse](#errorresponse)



# Phone Validation API - Carrier Lookup, Line Type Detection & Location Data v1.0.0

Validate a single phone number and receive detailed metadata including carrier, line type, geolocation, time zones, and four standardized formats (E.164, International, National, RFC3966). Accepts international format (+ prefix), local format (with region), or IDD format (with dialer_region). Returns possible/valid status, country code, national number, area code length, and NDC length.

Base URLs:

* [https://api.apifreaks.com/v1.0](https://api.apifreaks.com/v1.0)

## Authentication

* API Key (ApiKeyAuthHeader)
    - Parameter Name: **X-apiKey**, in: header. Pass your API key via the X-apiKey request header.

* API Key (ApiKeyAuthQuery)
    - Parameter Name: **apiKey**, in: query. Pass your API key via the apiKey query parameter.

## Phone Validation APIs

### validatePhoneNumber

`POST /phone/validation`

*Validate a single phone number*

Validates a single phone number and returns detailed metadata including carrier, line type, geolocation, time zones, and standardized formats.

> Body parameter

```json
{
  "number": "+14155552671"
}
```

#### Parameters

|Name|In|Type|Required|Description|
|---|---|---|---|---|
|format|query|string|false|Specifies the desired format for the API response. Choose 'json' for a JSON object. If not provided, the API defaults to JSON format.|
|body|body|[PhoneValidationRequest](#phonevalidationrequest)|true|Send a JSON object with `number` as the only required field. Use `region` **or** `dialer_region` when needed — never both at the same time.|

##### Detailed descriptions

**body**: Send a JSON object with `number` as the only required field. Use `region` **or** `dialer_region` when needed — never both at the same time.

- **International format** (`+` prefix): provide `number` only — no region needed.
- **Local format** (no `+`, e.g. `03301112233`): provide `number` + `region` (ISO 2-letter country code).
- **IDD format** (exit code, e.g. `00923301112233`): provide `number` + `dialer_region` (country you are dialing from).

##### Enumerated Values

|Parameter|Value|
|---|---|
|format|json|
|format|xml|

> Example responses

> Successful phone validation response. Note: numbers that are too short or otherwise not a plausible phone number are NOT rejected with a 400 — they return 200 with possible/valid set to false and most other fields absent.

```json
{
  "raw_input": {
    "number": "+14155552671"
  },
  "possible": true,
  "valid": true,
  "country_prefix": 1,
  "national_number": 4155552671,
  "country_code": "US",
  "location": "San Francisco, CA",
  "time_zones": [
    "America/Los_Angeles"
  ],
  "line_type": "FIXED_LINE_OR_MOBILE",
  "formats": {
    "E164": "+14155552671",
    "International": "+1 415-555-2671",
    "National": "(415) 555-2671",
    "RFC3966": "tel:+1-415-555-2671"
  },
  "area_code_length": 3,
  "ndc_length": 3,
  "can_be_internationally_dialled": true
}
```

```json
{
  "raw_input": {
    "number": "123",
    "region": "US"
  },
  "possible": false,
  "valid": false
}
```

> Bad Request – e.g. missing required field or both region codes provided

```json
{
  "timestamp": "2026-07-27T12:55:03.470Z",
  "status": 400,
  "error": "Missing Number",
  "message": "The 'number' is required in POST Body and cannot be empty.",
  "path": "/v1.0/phone-number/info"
}
```

```json
{
  "timestamp": "2026-07-27T12:55:03.962Z",
  "status": 400,
  "error": "Missing Region Information",
  "message": "Provide the region explicitly (e.g. 'US') or include a '+' with the country code.",
  "path": "/v1.0/phone-number/info"
}
```

```json
{
  "timestamp": "2026-07-27T12:55:04.456Z",
  "status": 400,
  "error": "Multiple Region Codes Provided",
  "message": "Provide only one region code, either 'region' or 'dialer_region', not both.",
  "path": "/v1.0/phone-number/info"
}
```

```json
{
  "timestamp": "2026-07-27T12:55:20.810Z",
  "status": 400,
  "error": "Invalid Region Code",
  "message": "Region code must be a 2-letter ISO country code (e.g., 'US', 'GB').",
  "path": "/v1.0/phone-number/info"
}
```

```json
{
  "timestamp": "2026-07-27T12:55:21.336Z",
  "status": 400,
  "error": "Invalid Number Format",
  "message": "The input does not match the expected structure of a phone number.",
  "path": "/v1.0/phone-number/info"
}
```

```json
{
  "timestamp": "2026-07-27T12:55:22.391Z",
  "status": 400,
  "error": "Number Too Long",
  "message": "The phone number has more digits than any valid phone number can have.",
  "path": "/v1.0/phone-number/info"
}
```

> Not Found – Wrong HTTP method used on the endpoint (e.g. GET instead of POST)

```json
{
  "error": "Resource Not Found",
  "message": "The requested resource could not be found. Please verify the URL and try again.",
  "path": "/v1.0/phone/validation",
  "status": 404,
  "timestamp": "2026-07-27T12:56:14.351Z"
}
```

> Request Timeout – Timed out while connecting to the remote server

```json
{
  "timestamp": "2026-06-06T14:00:00.000Z",
  "path": "/v1.0/phone/validation",
  "status": 408,
  "error": "Request Timeout",
  "message": "Timed out while connecting to the remote URL."
}
```

> Rate Limit Exceeded – API rate limit exceeded

```json
{
  "timestamp": "2026-06-06T14:00:00.000Z",
  "path": "/v1.0/phone/validation",
  "status": 429,
  "error": "Too Many Requests",
  "message": "API rate limit exceeded."
}
```

#### Responses

|Status|Meaning|Description|Schema|
|---|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful phone validation response. Note: numbers that are too short or otherwise not a plausible phone number are NOT rejected with a 400 — they return 200 with possible/valid set to false and most other fields absent.|[PhoneValidationResponse](#phonevalidationresponse)|
|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad Request – e.g. missing required field or both region codes provided|[ErrorResponse](#errorresponse)|
|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not Found – Wrong HTTP method used on the endpoint (e.g. GET instead of POST)|[ErrorResponse](#errorresponse)|
|408|[Request Timeout](https://tools.ietf.org/html/rfc7231#section-6.5.7)|Request Timeout – Timed out while connecting to the remote server|[ErrorResponse](#errorresponse)|
|429|[Too Many Requests](https://tools.ietf.org/html/rfc6585#section-4)|Rate Limit Exceeded – API rate limit exceeded|[ErrorResponse](#errorresponse)|

#### Response Headers

|Status|Header|Type|Format|Description|
|---|---|---|---|---|
|200|X-AF-Credits-Cost|integer||Specifies the number of credits consumed by the current request.|
|400|X-AF-Credits-Cost|integer||Specifies the number of credits consumed by the current request.|
|404|X-AF-Credits-Cost|integer||Specifies the number of credits consumed by the current request.|
|408|X-AF-Credits-Cost|integer||Specifies the number of credits consumed by the current request.|
|429|X-AF-Credits-Cost|integer||Specifies the number of credits consumed by the current request.|

To perform this operation, you must be authenticated by means of one of the following methods:
ApiKeyAuthHeader, ApiKeyAuthQuery

## Schemas

### PhoneValidationResponse

Phone validation response containing validation status and metadata.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|raw_input|[PhoneRawInput](#phonerawinput)|true|none|Original request payload sent by the caller.|
|possible|boolean|true|none|Whether the number is possible (length and format checks only). A number can be possible but not valid.|
|valid|boolean|true|none|Whether the number is valid according to the numbering plan.|
|country_prefix|integer|false|none|The international dialing prefix for the number's country (e.g., 1 for US/Canada, 44 for United Kingdom).|
|national_number|integer|false|none|The national significant number (the phone number without the country code).|
|country_code|string|false|none|ISO-2 country code inferred from the number (e.g., US, GB).|
|carrier|string|false|none|Carrier name associated with the number (if available). May not reflect ported carriers.|
|location|string|false|none|Geographic description (city/region) for the number (if applicable).|
|time_zones|[string]|false|none|Array of possible time zones associated with the number.|
|line_type|string|false|none|Classification of the phone line (MOBILE, FIXED_LINE, VOIP, etc.).|
|formats|[PhoneFormats](#phoneformats)|false|none|Four standardized representations of the phone number.|
|area_code_length|integer|false|none|Length of the geographic area code. Only applies to geographically-assigned numbers.|
|ndc_length|integer|false|none|Length of the National Destination Code (NDC), the routing prefix within a country.|
|can_be_internationally_dialled|boolean|false|none|Whether the number can be dialled internationally. false for short codes, emergency numbers, and domestic-only services.|

##### Enumerated Values

|Property|Value|
|---|---|
|line_type|MOBILE|
|line_type|FIXED_LINE|
|line_type|FIXED_LINE_OR_MOBILE|
|line_type|VOIP|
|line_type|TOLL_FREE|
|line_type|PREMIUM_RATE|
|line_type|SHARED_COST|
|line_type|PERSONAL_NUMBER|
|line_type|PAGER|
|line_type|UAN|
|line_type|VOICEMAIL|
|line_type|UNKNOWN|

### PhoneRawInput

Original request payload sent by the caller.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|number|string|true|none|The phone number as entered by the user.|
|region|string|false|none|ISO-2 country code. Present when provided in the request.|
|dialer_region|string|false|none|ISO-2 country code of the dialing origin. Present when provided in the request.|

### PhoneFormats

Four standardized representations of the phone number.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|E164|string|false|none|Number in E.164 format, the standard machine-readable format.|
|International|string|false|none|Human-readable international format with country code.|
|National|string|false|none|Local format as dialed within the country.|
|RFC3966|string|false|none|URI format following RFC 3966 for tel: links.|

### PhoneValidationRequest

Request body for phone validation.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|number|string|true|none|Phone number to validate. Accepts international format (+14155552671), local format (4155552671) with region, or IDD format (0014155552671) with dialer_region.|
|region|string|false|none|Two-letter ISO country code (e.g., US, GB). Required when number is in local format without + prefix. Cannot be used together with dialer_region.|
|dialer_region|string|false|none|Two-letter ISO country code indicating the country the number is being dialed from. Required when number uses IDD exit code. Cannot be used together with region.|

### ErrorResponse

Standard error envelope returned by the API on failed requests.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|error|string|false|none|Short error category or exception type.|
|message|string|true|none|Human-readable error message describing the failure.|
|path|string|false|none|API endpoint path that produced the error.|
|status|integer|false|none|HTTP status code returned with the error.|
|timestamp|string(date-time)|false|none|Timestamp when the error occurred (ISO 8601).|
